From 1e019ec79e4a061221cba6eb5aa4aaf4a74d6f32 Mon Sep 17 00:00:00 2001 From: Johan LACHENAL Date: Thu, 10 Nov 2022 09:03:53 +0100 Subject: [PATCH 1/2] Ajout des classes metiers php --- .idea/.gitignore | 8 ++ .idea/Scripted.iml | 8 ++ .idea/modules.xml | 8 ++ .idea/php.xml | 6 ++ .idea/vcs.xml | 6 ++ Bd/bd.sql | 20 ++--- WEB/Model/Admin.php | 61 ++++++++++++++ WEB/Model/DetailPartie.php | 119 ++++++++++++++++++++++++++++ WEB/Model/Enigme.php | 157 +++++++++++++++++++++++++++++++++++++ WEB/Model/Partie.php | 24 ++++++ WEB/Model/bd.sql | 2 +- WEB/php/.idea/.gitignore | 8 ++ WEB/php/.idea/modules.xml | 8 ++ WEB/php/.idea/php.iml | 8 ++ WEB/php/.idea/php.xml | 6 ++ WEB/php/.idea/vcs.xml | 6 ++ 16 files changed, 444 insertions(+), 11 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/Scripted.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/php.xml create mode 100644 .idea/vcs.xml create mode 100644 WEB/php/.idea/.gitignore create mode 100644 WEB/php/.idea/modules.xml create mode 100644 WEB/php/.idea/php.iml create mode 100644 WEB/php/.idea/php.xml create mode 100644 WEB/php/.idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..73f69e09 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/Scripted.iml b/.idea/Scripted.iml new file mode 100644 index 00000000..c956989b --- /dev/null +++ b/.idea/Scripted.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..6200ce1b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 00000000..0e09af40 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Bd/bd.sql b/Bd/bd.sql index 682cbc11..2db04763 100644 --- a/Bd/bd.sql +++ b/Bd/bd.sql @@ -1,31 +1,31 @@ -CREATE TABLE Admin{ +CREATE TABLE Admin( email varchar(50) PRIMARY KEY, pseudo varchar(50), mdp varchar(50) -}; +); -CREATE TABLE Enigme{ +CREATE TABLE Enigme( idEnigme char(5) PRIMARY KEY, -admin varchar(50) REFERENCES Admin(pseudo), +admin varchar(50) REFERENCES Admin(email), enoncé varchar(250) NOT NULL, aide varchar(250), rappel varchar(250), solution varchar(250) NOT NULL, test varchar(250) NOT NULL, tempsDeResolution numeric CHECK (tempsDeResolution >0) -}; +); -CREATE TABLE Joueur{ +CREATE TABLE Joueur( email varchar(50) PRIMARY KEY, enigmeEnCours varchar(50) REFERENCES Enigme(idEnigme), pseudo varchar(50), mdp varchar(50) -}; +); CREATE TABLE Game( idGame char(5) NOT NULL, -joueur varchar(50) REFERENCES Joueur(pseudo), +joueur varchar(50) REFERENCES Joueur(email), enigme char(5) REFERENCES Enigme(idEnigme), -points numeric CHECK (points >0) +points numeric CHECK (points >0), PRIMARY KEY(idGame, joueur, enigme) -); +); \ No newline at end of file diff --git a/WEB/Model/Admin.php b/WEB/Model/Admin.php index 0a3f2998..12a9b324 100644 --- a/WEB/Model/Admin.php +++ b/WEB/Model/Admin.php @@ -2,5 +2,66 @@ class Admin { + private string $email; + private string $pseudo; + private string $mdp; + /** + * @param string $email + * @param string $pseudo + * @param string $mdp + */ + public function __construct(string $email, string $pseudo, string $mdp) + { + $this->email = $email; + $this->pseudo = $pseudo; + $this->mdp = $mdp; + } + /** + * @return string + */ + public function getEmail(): string + { + return $this->email; + } + + /** + * @param string $email + */ + public function setEmail(string $email): void + { + $this->email = $email; + } + + /** + * @return mixed + */ + public function getPseudo() + { + return $this->pseudo; + } + + /** + * @param mixed $pseudo + */ + public function setPseudo($pseudo): void + { + $this->pseudo = $pseudo; + } + + /** + * @return mixed + */ + public function getMdp() + { + return $this->mdp; + } + + /** + * @param mixed $mdp + */ + public function setMdp($mdp): void + { + $this->mdp = $mdp; + } } \ No newline at end of file diff --git a/WEB/Model/DetailPartie.php b/WEB/Model/DetailPartie.php index 51b709be..9d8eb6d6 100644 --- a/WEB/Model/DetailPartie.php +++ b/WEB/Model/DetailPartie.php @@ -2,5 +2,124 @@ class DetailPartie { + private string $idDetailPartie; + private string $joueur; + private string $partie; + private string $enigme; + private string $pointsObtenus; + private string $classement; + /** + * @param string $idDetailPartie + * @param string $joueur + * @param string $partie + * @param string $enigme + * @param string $pointsObtenus + * @param string $classement + */ + public function __construct(string $idDetailPartie, string $joueur, string $partie, string $enigme, string $pointsObtenus, string $classement) + { + $this->idDetailPartie = $idDetailPartie; + $this->joueur = $joueur; + $this->partie = $partie; + $this->enigme = $enigme; + $this->pointsObtenus = $pointsObtenus; + $this->classement = $classement; + } + + /** + * @return string + */ + public function getIdDetailPartie(): string + { + return $this->idDetailPartie; + } + + /** + * @param string $idDetailPartie + */ + public function setIdDetailPartie(string $idDetailPartie): void + { + $this->idDetailPartie = $idDetailPartie; + } + + /** + * @return string + */ + public function getJoueur(): string + { + return $this->joueur; + } + + /** + * @param string $joueur + */ + public function setJoueur(string $joueur): void + { + $this->joueur = $joueur; + } + + /** + * @return string + */ + public function getPartie(): string + { + return $this->partie; + } + + /** + * @param string $partie + */ + public function setPartie(string $partie): void + { + $this->partie = $partie; + } + + /** + * @return string + */ + public function getEnigme(): string + { + return $this->enigme; + } + + /** + * @param string $enigme + */ + public function setEnigme(string $enigme): void + { + $this->enigme = $enigme; + } + + /** + * @return string + */ + public function getPointsObtenus(): string + { + return $this->pointsObtenus; + } + + /** + * @param string $pointsObtenus + */ + public function setPointsObtenus(string $pointsObtenus): void + { + $this->pointsObtenus = $pointsObtenus; + } + + /** + * @return string + */ + public function getClassement(): string + { + return $this->classement; + } + + /** + * @param string $classement + */ + public function setClassement(string $classement): void + { + $this->classement = $classement; + } } \ No newline at end of file diff --git a/WEB/Model/Enigme.php b/WEB/Model/Enigme.php index f1b51f63..40163a39 100644 --- a/WEB/Model/Enigme.php +++ b/WEB/Model/Enigme.php @@ -2,5 +2,162 @@ class Enigme { + private string $idEnigme; + private string $admin; + private string $enonce; + private string $aide; + private string $rappel; + private string $solution; + private string $test; + private float $tempsDeResolution; + /** + * @param string $idEnigme + * @param string $admin + * @param string $enonce + * @param string $aide + * @param string $rappel + * @param string $solution + * @param string $test + * @param int $tempsDeResolution + */ + public function __construct(string $idEnigme, string $admin, string $enonce, string $aide, string $rappel, string $solution, string $test, float $tempsDeResolution) + { + $this->idEnigme = $idEnigme; + $this->admin = $admin; + $this->enonce = $enonce; + $this->aide = $aide; + $this->rappel = $rappel; + $this->solution = $solution; + $this->test = $test; + $this->tempsDeResolution = $tempsDeResolution; + } + + /** + * @return string + */ + public function getIdEnigme(): string + { + return $this->idEnigme; + } + + /** + * @param string $idEnigme + */ + public function setIdEnigme(string $idEnigme): void + { + $this->idEnigme = $idEnigme; + } + + /** + * @return string + */ + public function getAdmin(): string + { + return $this->admin; + } + + /** + * @param string $admin + */ + public function setAdmin(string $admin): void + { + $this->admin = $admin; + } + + /** + * @return string + */ + public function getEnonce(): string + { + return $this->enonce; + } + + /** + * @param string $enonce + */ + public function setEnonce(string $enonce): void + { + $this->enonce = $enonce; + } + + /** + * @return string + */ + public function getAide(): string + { + return $this->aide; + } + + /** + * @param string $aide + */ + public function setAide(string $aide): void + { + $this->aide = $aide; + } + + /** + * @return string + */ + public function getRappel(): string + { + return $this->rappel; + } + + /** + * @param string $rappel + */ + public function setRappel(string $rappel): void + { + $this->rappel = $rappel; + } + + /** + * @return string + */ + public function getSolution(): string + { + return $this->solution; + } + + /** + * @param string $solution + */ + public function setSolution(string $solution): void + { + $this->solution = $solution; + } + + /** + * @return string + */ + public function getTest(): string + { + return $this->test; + } + + /** + * @param string $test + */ + public function setTest(string $test): void + { + $this->test = $test; + } + + /** + * @return int + */ + public function getTempsDeResolution(): float + { + return $this->tempsDeResolution; + } + + /** + * @param int $tempsDeResolution + */ + public function setTempsDeResolution(float $tempsDeResolution): void + { + $this->tempsDeResolution = $tempsDeResolution; + } } \ No newline at end of file diff --git a/WEB/Model/Partie.php b/WEB/Model/Partie.php index be32f79b..baf996df 100644 --- a/WEB/Model/Partie.php +++ b/WEB/Model/Partie.php @@ -2,5 +2,29 @@ class Partie { + private string $idPartie; + /** + * @param string $idPartie + */ + public function __construct(string $idPartie) + { + $this->idPartie = $idPartie; + } + + /** + * @return string + */ + public function getIdPartie(): string + { + return $this->idPartie; + } + + /** + * @param string $idPartie + */ + public function setIdPartie(string $idPartie): void + { + $this->idPartie = $idPartie; + } } \ No newline at end of file diff --git a/WEB/Model/bd.sql b/WEB/Model/bd.sql index 0fd5b0fc..92dce34c 100644 --- a/WEB/Model/bd.sql +++ b/WEB/Model/bd.sql @@ -13,7 +13,7 @@ DROP TABLE Joueur; CREATE TABLE Joueur( email varchar(50) PRIMARY KEY, -seudo varchar(50), +pseudo varchar(50), mdp varchar(50) ); diff --git a/WEB/php/.idea/.gitignore b/WEB/php/.idea/.gitignore new file mode 100644 index 00000000..73f69e09 --- /dev/null +++ b/WEB/php/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/WEB/php/.idea/modules.xml b/WEB/php/.idea/modules.xml new file mode 100644 index 00000000..2047c36d --- /dev/null +++ b/WEB/php/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/WEB/php/.idea/php.iml b/WEB/php/.idea/php.iml new file mode 100644 index 00000000..c956989b --- /dev/null +++ b/WEB/php/.idea/php.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/WEB/php/.idea/php.xml b/WEB/php/.idea/php.xml new file mode 100644 index 00000000..35715888 --- /dev/null +++ b/WEB/php/.idea/php.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/WEB/php/.idea/vcs.xml b/WEB/php/.idea/vcs.xml new file mode 100644 index 00000000..b2bdec2d --- /dev/null +++ b/WEB/php/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 588bc7a462e9929a4cab29cdfda7382fa4b4c71d Mon Sep 17 00:00:00 2001 From: Pierre BALLANDRAS Date: Thu, 10 Nov 2022 09:51:32 +0100 Subject: [PATCH 2/2] DashBoardV1 --- WEB/View/src/pages/Multijoueur/Dashboard.html | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 WEB/View/src/pages/Multijoueur/Dashboard.html diff --git a/WEB/View/src/pages/Multijoueur/Dashboard.html b/WEB/View/src/pages/Multijoueur/Dashboard.html new file mode 100644 index 00000000..46d71033 --- /dev/null +++ b/WEB/View/src/pages/Multijoueur/Dashboard.html @@ -0,0 +1,75 @@ + + + + + + +
+ + + \ No newline at end of file