diff --git a/Bd/bd.sql b/Bd/bd.sql index 2ac6dd5b..2c961fa7 100644 --- a/Bd/bd.sql +++ b/Bd/bd.sql @@ -22,8 +22,16 @@ pseudo varchar(50), mdp varchar(50) ); -CREATE TABLE Game( -idGame char(5) NOT NULL, +CREATE TABLE Partie( +idPartie char(5) NOT NULL, +joueur varchar(50) REFERENCES Joueur(email), +enigme char(5) REFERENCES Enigme(idEnigme), +points numeric CHECK (points >0), +PRIMARY KEY(idGame, joueur, enigme) +); + +CREATE TABLE DetailPartie( +idPartie char(5) NOT NULL, joueur varchar(50) REFERENCES Joueur(email), enigme char(5) REFERENCES Enigme(idEnigme), points numeric CHECK (points >0), diff --git a/WEB/Controller/DetailPartieGateway.php b/WEB/Controller/DetailPartieGateway.php new file mode 100644 index 00000000..2e2f8102 --- /dev/null +++ b/WEB/Controller/DetailPartieGateway.php @@ -0,0 +1,52 @@ +con = $con; + } + + /** + * @param Connection $con + */ + public function setCon(Connection $con): void + { + $this->con = $con; + } + + public function insert(DetailPartie $detailPartie) + { + $query="INSERT INTO DetailPartie VALUES (:idDetailPartie,:joueur,:partie,:enigme,:pointsObtenus,:classement)"; + $this->con->executeQuery($query,array( + 'idDetailPartie' => array($detailPartie->getIdDetailPartie(),PDO::PARAM_STR), + 'joueur' => array($detailPartie->getJoueur(),PDO::PARAM_STR), + 'partie' => array($detailPartie->getPartie(),PDO::PARAM_STR), + 'enigme' => array($detailPartie->getEnigme(),PDO::PARAM_STR), + 'pointsObtenus' => array($detailPartie->getPointsObtenus(),PDO::PARAM_INT), + 'classement' => array($detailPartie->getClassement(),PDO::PARAM_INT) + )); + } + public function delete(string $partie){ + $query="DELETE * FROM DetailPartie WHERE partie=:partie"; + $this->con->executeQuery($query,array( + 'partie' => array($partie,PDO::PARAM_STR) + )); + } + public function showAll(){ + $query="SELECT * FROM DetailPartie"; + $this->con->executeQuery($query); + $results=$this->con->getResults(); + foreach($results as $row) + { + $row['idDetailPartie']; + } + } + + +} \ No newline at end of file diff --git a/WEB/Controller/EnigmeGateway.php b/WEB/Controller/EnigmeGateway.php index 434371d1..03a33c31 100644 --- a/WEB/Controller/EnigmeGateway.php +++ b/WEB/Controller/EnigmeGateway.php @@ -15,17 +15,26 @@ class EnigmeGateway $this->con = $con; } - public function insert(string $idEnigme, string $admin, string $enonce, string $aide, string $rappel, string $solution, string $test, float $tempsDeResolution) + /** + * @param Connection $con + */ + public function setCon(Connection $con): void + { + $this->con = $con; + } + + public function insert(Enigme $enigme) { $query = "INSERT INTO Enigme VALUES (:idEnigme,:admin,:enonce,:aide,:rappel,:solution,:test,:tempsDeResolution)"; $this->con->executeQuery($query, array( - ':idEnigme' => array($idEnigme, PDO::PARAM_STR), - ':admin' => array($admin, PDO::PARAM_STR), - ':enonce' => array($enonce, PDO::PARAM_STR), - ':aide' => array($aide, PDO::PARAM_STR), - ':rappel' => array($rappel, PDO::PARAM_STR), - ':solution' => array($solution, PDO::PARAM_STR), - ':test' => array($tempsDeResolution, PDO::PARAM_STR) + ':idEnigme' => array($enigme->getIdEnigme(), PDO::PARAM_STR), + ':admin' => array($enigme->getAdmin(), PDO::PARAM_STR), + ':enonce' => array($enigme->getEnonce(), PDO::PARAM_STR), + ':aide' => array($enigme->getAide(), PDO::PARAM_STR), + ':rappel' => array($enigme->getRappel(), PDO::PARAM_STR), + ':solution' => array($enigme->getSolution(), PDO::PARAM_STR), + ':test' => array($enigme->getTest(), PDO::PARAM_STR), + ':tempsDeResolution' => array($enigme->getTempsDeResolution(), PDO::PARAM_INT) )); } diff --git a/WEB/Controller/PartieGateway.php b/WEB/Controller/PartieGateway.php index 6e12e73c..1b0ccaf8 100644 --- a/WEB/Controller/PartieGateway.php +++ b/WEB/Controller/PartieGateway.php @@ -14,9 +14,9 @@ class PartieGateway { $this->con = $con; } - public function insert(string $idPartie){ + public function insert(Partie $partie){ $query= "INSERT INTO Game VALUES (:idPartie)"; - $this->con->executeQuery($query, array(':idPartie' => array($idPartie, PDO::PARAM_STR))); + $this->con->executeQuery($query, array(':idPartie' => array($partie->getIdPartie(), PDO::PARAM_STR))); } public function delete(string $idPartie){ $query= "DELETE FROM Game WHERE idGame = :idPartie"; diff --git a/WEB/Model/DetailPartie.php b/WEB/Model/DetailPartie.php index 9d8eb6d6..b80095cd 100644 --- a/WEB/Model/DetailPartie.php +++ b/WEB/Model/DetailPartie.php @@ -6,18 +6,18 @@ class DetailPartie private string $joueur; private string $partie; private string $enigme; - private string $pointsObtenus; - private string $classement; + private int $pointsObtenus; + private int $classement; /** * @param string $idDetailPartie * @param string $joueur * @param string $partie * @param string $enigme - * @param string $pointsObtenus - * @param string $classement + * @param int $pointsObtenus + * @param int $classement */ - public function __construct(string $idDetailPartie, string $joueur, string $partie, string $enigme, string $pointsObtenus, string $classement) + public function __construct(string $idDetailPartie, string $joueur, string $partie, string $enigme, int $pointsObtenus, int $classement) { $this->idDetailPartie = $idDetailPartie; $this->joueur = $joueur; @@ -92,33 +92,33 @@ class DetailPartie } /** - * @return string + * @return int */ - public function getPointsObtenus(): string + public function getPointsObtenus(): int { return $this->pointsObtenus; } /** - * @param string $pointsObtenus + * @param int $pointsObtenus */ - public function setPointsObtenus(string $pointsObtenus): void + public function setPointsObtenus(int $pointsObtenus): void { $this->pointsObtenus = $pointsObtenus; } /** - * @return string + * @return int */ - public function getClassement(): string + public function getClassement(): int { return $this->classement; } /** - * @param string $classement + * @param int $classement */ - public function setClassement(string $classement): void + public function setClassement(int $classement): void { $this->classement = $classement; } diff --git a/WEB/View/assets/fonts/CentraNo2-Bold.ttf b/WEB/View/assets/fonts/CentraNo2-Bold.ttf deleted file mode 100644 index 4e9636b4..00000000 Binary files a/WEB/View/assets/fonts/CentraNo2-Bold.ttf and /dev/null differ diff --git a/WEB/View/assets/fonts/CentraNo2-Book.ttf b/WEB/View/assets/fonts/CentraNo2-Book.ttf deleted file mode 100644 index 89c5b5df..00000000 Binary files a/WEB/View/assets/fonts/CentraNo2-Book.ttf and /dev/null differ diff --git a/WEB/View/assets/fonts/CentraNo2-Medium.ttf b/WEB/View/assets/fonts/CentraNo2-Medium.ttf deleted file mode 100644 index b8f7f67d..00000000 Binary files a/WEB/View/assets/fonts/CentraNo2-Medium.ttf and /dev/null differ diff --git a/WEB/View/assets/fonts/Equinox.otf b/WEB/View/assets/fonts/Equinox.otf new file mode 100644 index 00000000..6ad19764 Binary files /dev/null and b/WEB/View/assets/fonts/Equinox.otf differ diff --git a/WEB/View/assets/fonts/Fauna.ttf b/WEB/View/assets/fonts/Fauna.ttf new file mode 100644 index 00000000..82eccf41 Binary files /dev/null and b/WEB/View/assets/fonts/Fauna.ttf differ diff --git a/WEB/View/assets/img/BuildingBG.png b/WEB/View/assets/img/BuildingBG.png new file mode 100644 index 00000000..fb4afd6a Binary files /dev/null and b/WEB/View/assets/img/BuildingBG.png differ diff --git a/WEB/View/assets/img/MenBGPres.png b/WEB/View/assets/img/MenBGPres.png new file mode 100644 index 00000000..cad3d4b5 Binary files /dev/null and b/WEB/View/assets/img/MenBGPres.png differ diff --git a/WEB/View/assets/img/ScriptedLogo.png b/WEB/View/assets/img/ScriptedLogo.png new file mode 100644 index 00000000..796e3127 Binary files /dev/null and b/WEB/View/assets/img/ScriptedLogo.png differ diff --git a/WEB/View/src/CSS/Main.css b/WEB/View/src/CSS/Main.css index c20e28cd..592e01f1 100644 --- a/WEB/View/src/CSS/Main.css +++ b/WEB/View/src/CSS/Main.css @@ -1,5 +1,6 @@ @import url("https://fonts.googleapis.com/css2?family=Orbitron&display=swap"); + /*Default CSS*/ body { min-height: 100vh; diff --git a/WEB/View/src/CSS/Pres.css b/WEB/View/src/CSS/Pres.css new file mode 100644 index 00000000..276ba83d --- /dev/null +++ b/WEB/View/src/CSS/Pres.css @@ -0,0 +1,43 @@ +/*Fonts CSS */ + +@font-face { + font-family: Fauna; + src: url("../../assets/fonts/Fauna.ttf"); +} +@font-face { + font-family: Equinox; + src: url("../../assets/fonts/Equinox.otf"); +} + + +body { + min-height: 100vh; + font-family: "Equinox", sans-serif; + color: white; + scroll-behavior: smooth; + height: 100vh; + background-position: center center; + background-attachment: fixed; + background-repeat: no-repeat; + background-size: cover; + background-color: #050e15; +} + +nav{ + background: none; +} + +h1{ + z-index: 10; + color: #fff; + font-size: 65px; + letter-spacing: 1px; +} + +section img { + position: absolute; + top: 0; + left: 0; + width: 100%; + object-fit: cover; +} diff --git a/WEB/View/src/JS/dashboard.js b/WEB/View/src/JS/dashboard.js new file mode 100644 index 00000000..81e00737 --- /dev/null +++ b/WEB/View/src/JS/dashboard.js @@ -0,0 +1,64 @@ +window.onload = function () { + var chart = new CanvasJS.Chart("chartContainer", { + animationEnabled: true, + zoomEnabled: true, + theme: "dark2", + title: { + text: "Score" + }, + axisX: { + title: "Enigme", + valueFormatString: "####", + interval: 1 + }, + axisY: { + title: "Point", + titleFontColor: "#6D78AD", + lineColor: "#6D78AD", + gridThickness: 0, + lineThickness: 1, + }, + legend: { + verticalAlign: "top", + fontSize: 16, + }, + data: [{ + type: "line", + xValueFormatString: "Pierre", + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 50 }, + { x: 2, y: 100 }, + { x: 3, y: 150 }, + { x: 4, y: 150 }, + { x: 5, y: 200 }, + ] + }, + { + type: "line", + xValueFormatString: "Noe", + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 100 }, + { x: 2, y: 100 }, + { x: 3, y: 200 }, + { x: 4, y: 250 }, + { x: 5, y: 300 }, + ] + }, + { + type: "line", + xValueFormatString: "Nathan", + dataPoints: [ + { x: 0, y: 0 }, + { x: 1, y: 75 }, + { x: 2, y: 100 }, + { x: 3, y: 150 }, + { x: 4, y: 200 }, + { x: 5, y: 250 }, + ] + } + ] + }); + chart.render(); + } \ No newline at end of file diff --git a/WEB/View/src/pages/Multijoueur/Dashboard.html b/WEB/View/src/pages/Multijoueur/Dashboard.html index 46d71033..53ed1a99 100644 --- a/WEB/View/src/pages/Multijoueur/Dashboard.html +++ b/WEB/View/src/pages/Multijoueur/Dashboard.html @@ -1,75 +1,29 @@ - - - - - - -
- - - \ No newline at end of file + + + + + + Bootstrap Site + + + + + + +
+ + + diff --git a/WEB/View/src/pages/Pres.html b/WEB/View/src/pages/Pres.html index bf867bbf..3bc899ce 100644 --- a/WEB/View/src/pages/Pres.html +++ b/WEB/View/src/pages/Pres.html @@ -10,6 +10,7 @@ integrity="sha384-r4NyP46KrjDleawBgD5tp8Y7UzmLA05oM1iAEQ17CSuDqnUK2+k9luXQOfXJCJ4I" crossorigin="anonymous" /> + -