Merge branch 'master' of https://codefirst.iut.uca.fr/git/nathan.boileau/Scripted
commit
499bb5a3b9
@ -1,39 +0,0 @@
|
||||
CREATE TABLE Admin(
|
||||
email varchar(50) PRIMARY KEY,
|
||||
pseudo varchar(50),
|
||||
mdp varchar(50)
|
||||
);
|
||||
|
||||
CREATE TABLE Enigme(
|
||||
idEnigme char(5) PRIMARY KEY,
|
||||
admin varchar(50) REFERENCES Admin(email),
|
||||
enonce 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(
|
||||
email varchar(50) PRIMARY KEY,
|
||||
enigmeEnCours varchar(50) REFERENCES Enigme(idEnigme),
|
||||
pseudo varchar(50),
|
||||
mdp varchar(50)
|
||||
);
|
||||
|
||||
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),
|
||||
PRIMARY KEY(idGame, joueur, enigme)
|
||||
);
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
//préfixe
|
||||
$rep='../';
|
||||
|
||||
//BD
|
||||
$dsn = 'mysql:host=londres.uca.local; dbname=dbnogarnier1';
|
||||
$user = 'nogarnier1';
|
||||
$password = 'achanger';
|
||||
|
||||
//View
|
||||
$vues['erreurSignUp']='View/Error/ErreurSignUp.php';
|
||||
$vues['erreur']='View/Error/Erreur.php';
|
||||
$vues['erreurBd']='View/Error/ErreurBd.php';
|
||||
$vues['erreurLoginEmail']='View/Error/ErreurLoginEmail.php';
|
||||
$vues['erreurLoginMdp']='View/Error/ErreurLoginMdp.php';
|
||||
$vues['erreur404']='View/Error/Erreur404.php';
|
@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
class DetailPartieGateway
|
||||
{
|
||||
private Connection $con;
|
||||
|
||||
/**
|
||||
* @param Connection $con
|
||||
*/
|
||||
public function __construct(Connection $con)
|
||||
{
|
||||
$this->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'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class InvalidMdpException extends Exception {
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'Error on line '.$this->getLine().' in '.$this->getFile()
|
||||
.': <b>'.$this->getMessage().'</b> Mdp invalide';
|
||||
return $errorMsg;
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
class JoueurNotFoundException extends Exception {
|
||||
public function errorMessage() {
|
||||
//error message
|
||||
$errorMsg = 'Error on line '.$this->getLine().' in '.$this->getFile()
|
||||
.': <b>'.$this->getMessage().'</b> Joueur not found';
|
||||
return $errorMsg;
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
<?php
|
||||
require 'Controller.php';
|
||||
$dsn = 'mysql:host=londres.uca.local; dbname=dbnogarnier1';
|
||||
$user = 'nogarnier1';
|
||||
$password = 'achanger';
|
||||
$con = new Connection($dsn, $user, $password);
|
||||
$control = new Controller($con)
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@ -1,125 +0,0 @@
|
||||
<?php
|
||||
|
||||
class DetailPartie
|
||||
{
|
||||
private string $idDetailPartie;
|
||||
private string $joueur;
|
||||
private string $partie;
|
||||
private string $enigme;
|
||||
private int $pointsObtenus;
|
||||
private int $classement;
|
||||
|
||||
/**
|
||||
* @param string $idDetailPartie
|
||||
* @param string $joueur
|
||||
* @param string $partie
|
||||
* @param string $enigme
|
||||
* @param int $pointsObtenus
|
||||
* @param int $classement
|
||||
*/
|
||||
public function __construct(string $idDetailPartie, string $joueur, string $partie, string $enigme, int $pointsObtenus, int $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 int
|
||||
*/
|
||||
public function getPointsObtenus(): int
|
||||
{
|
||||
return $this->pointsObtenus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $pointsObtenus
|
||||
*/
|
||||
public function setPointsObtenus(int $pointsObtenus): void
|
||||
{
|
||||
$this->pointsObtenus = $pointsObtenus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getClassement(): int
|
||||
{
|
||||
return $this->classement;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $classement
|
||||
*/
|
||||
public function setClassement(int $classement): void
|
||||
{
|
||||
$this->classement = $classement;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>ERREUR</h1>
|
||||
<p>Erreur inatendu</p>
|
||||
<?php
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>ERREUR</h1>
|
||||
<p>Page introuvable</p>
|
||||
<?php
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>ERREUR</h1>
|
||||
<p>Erreur avec la base de donnée</p>
|
||||
<?php
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>ERREUR</h1>
|
||||
<p>Joueur introuvable</p>
|
||||
<?php
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>ERREUR</h1>
|
||||
<p>Mot de passe invalide</p>
|
||||
<?php
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<body>
|
||||
<h1>ERREUR</h1>
|
||||
<p>E-mail invalide</p>
|
||||
<?php
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -0,0 +1,215 @@
|
||||
/*Fonts CSS */
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Orbitron&display=swap');
|
||||
|
||||
/*Default CSS*/
|
||||
|
||||
|
||||
|
||||
/*Ace CSS */
|
||||
|
||||
.ace{
|
||||
width: 45%;
|
||||
height: 90%;
|
||||
max-height: 100%;
|
||||
margin-bottom: 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* Main Button Css */
|
||||
|
||||
.buttons{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.compiler_class .buttons div{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.buttons .btn{
|
||||
position: relative;
|
||||
width: 120px;
|
||||
height: 60px;
|
||||
display: inline-block;
|
||||
background: transparent;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
|
||||
.buttons .btn:before, .buttons .btn:after
|
||||
{
|
||||
content:'';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
transition: 0.5s;
|
||||
background: #f00
|
||||
}
|
||||
|
||||
|
||||
.buttons .btn:nth-child(1):before, .buttons .btn:nth-child(1):after
|
||||
{
|
||||
background: linear-gradient(45deg, #00ccff, #0e1538, #d400d4)
|
||||
}
|
||||
|
||||
.buttons .btn:nth-child(2):before, .buttons .btn:nth-child(2):after
|
||||
{
|
||||
background: linear-gradient(45deg, #d400d4, #0e1538, #fb5942);
|
||||
}
|
||||
|
||||
.buttons .btn:hover:before
|
||||
{
|
||||
inset: -3px;
|
||||
}
|
||||
|
||||
.buttons .btn:hover:after
|
||||
{
|
||||
inset: -3px;
|
||||
filter: blur(10px);
|
||||
}
|
||||
|
||||
.buttons .btn span{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: inline-block;
|
||||
background: #0e1538;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 1.2em;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
color: #fff;
|
||||
border: 1px solid #040a29;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.buttons .btn span::before{
|
||||
content:'';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -50%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(255,255,255,0.075);
|
||||
transform: skew(25deg)
|
||||
}
|
||||
|
||||
|
||||
|
||||
.buttons .btn .noAnimation {
|
||||
animation: none;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
|
||||
/* Modal CSS */
|
||||
|
||||
.modal-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 10;
|
||||
|
||||
display: none;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--m-background);
|
||||
}
|
||||
|
||||
.modal-container:target {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.modal {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
width: 30%;
|
||||
height: 35%;
|
||||
padding: 10px 0;
|
||||
border-radius: .8rem;
|
||||
|
||||
color: aliceblue;
|
||||
background: var(--background);
|
||||
box-shadow: var(--m-shadow, .4rem .4rem 8.2rem .2rem) var(--shadow-1);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Modal H1 */
|
||||
|
||||
.modal #containerResult{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
/* Modal Container Buttons */
|
||||
|
||||
.modal .buttons{
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
height: 100%;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.modal .buttons #top{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: flex-start;
|
||||
width: auto;
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.modal .buttons #bottom{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-end;
|
||||
width: auto;
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
/* Modal buttons btn */
|
||||
|
||||
.modal .buttons .btn{
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin : 0 15px;
|
||||
}
|
||||
|
||||
.modal .buttons #bottom{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.modal .buttons #fleche{
|
||||
display: none;
|
||||
width: 75px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.modal .buttons .btn span{
|
||||
background: #06124b;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.modal .buttons #bottom .btn:nth-child(1):before, .modal .buttons #bottom .btn:nth-child(1):after
|
||||
{
|
||||
background: linear-gradient(45deg, #d400d4, #0e1538, #fb5942);
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
require_once './Config/Config.php';
|
||||
require_once "./Config/Connection.php";
|
||||
require_once './Config/Validation.php';
|
||||
|
||||
require_once "./Model/Joueur.php";
|
||||
require_once "./Model/Enigme.php";
|
||||
|
||||
require_once './Controller/JoueurGateway.php';
|
||||
require_once './Controller/EnigmeGateway.php';
|
||||
|
||||
require_once './Controller/JoueurNotFoundException.php';
|
||||
require_once './Controller/InvalidMdpException.php';
|
||||
|
||||
require_once './Controller/Controller.php';
|
||||
|
||||
//unset($_SESSION['connected']);
|
||||
|
||||
$con = new Connection($dsn, $user, $password);
|
||||
$control = new Controller($con);
|
||||
|
||||
session_unset(); //efface les variable session
|
||||
session_destroy();//détruit la session
|
||||
$_SESSION = null;//histoire d'être sûre
|
@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/php.iml" filepath="$PROJECT_DIR$/.idea/php.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7">
|
||||
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
||||
</component>
|
||||
</project>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
Loading…
Reference in new issue