diff --git a/Website/models/Admin.php b/Website/models/Admin.php deleted file mode 100755 index 5abe7f9..0000000 --- a/Website/models/Admin.php +++ /dev/null @@ -1,18 +0,0 @@ -id = $id; - $this->username = $username; - } - - public function getUsername() - { - return $this->username; - } -} diff --git a/Website/models/Administrator.php b/Website/models/Administrator.php new file mode 100755 index 0000000..be01ef5 --- /dev/null +++ b/Website/models/Administrator.php @@ -0,0 +1,32 @@ +id = $id; + $this->username = $username; + try { + $this->hashedPassword = $hashedPassword = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]); + } catch (Exception $e) { + echo $e->getMessage(); + } + } + + public function getUsername() + { + return $this->username; + } + public function getHashedPassword() + { + return $this->hashedPassword; + } + public function setHashedPassword(string $hashedPassword) + { + $this->hashedPassword = $hashedPassword; + } +} diff --git a/Website/models/Answer.php b/Website/models/Answer.php new file mode 100755 index 0000000..8722f94 --- /dev/null +++ b/Website/models/Answer.php @@ -0,0 +1,22 @@ +id = $id; + $this->content = $content; + } + + public function getContent() + { + return $this->content; + } + public function setContent(string $content) + { + $this->content = $content; + } +} diff --git a/Website/models/Chapter.php b/Website/models/Chapter.php new file mode 100755 index 0000000..73ae831 --- /dev/null +++ b/Website/models/Chapter.php @@ -0,0 +1,18 @@ +id = $id; + $this->name = $name; + } + + public function getName() + { + return $this->name; + } +} diff --git a/Website/models/Lobby.php b/Website/models/Lobby.php new file mode 100755 index 0000000..61fea67 --- /dev/null +++ b/Website/models/Lobby.php @@ -0,0 +1,31 @@ +id = $id; + $this->name = $name; + $this->password = $password; + $this->nbPlayer = $nbPlayer; + } + + public function getName() + { + return $this->name; + } + + public function getNbPlayer() + { + return $this->nbPlayer; + } + public function setNbplayer(int $nbPlayer) + { + $this->nbPlayer = $nbPlayer; + } +} diff --git a/Website/models/Player.php b/Website/models/Player.php new file mode 100755 index 0000000..79c8712 --- /dev/null +++ b/Website/models/Player.php @@ -0,0 +1,33 @@ +id = $id; + $this->nickname = $nickname; + try { + $this->hashedPassword = $hashedPassword = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]); + } catch (Exception $e) { + echo $e->getMessage(); + } + } + + public function getNickname() + { + return $this->nickname; + } + + public function getHashedPassword() + { + return $this->hashedPassword; + } + public function setHashedPassword(string $hashedPassword) + { + $this->hashedPassword = $hashedPassword; + } +} diff --git a/Website/models/Question.php b/Website/models/Question.php new file mode 100755 index 0000000..8fd0a61 --- /dev/null +++ b/Website/models/Question.php @@ -0,0 +1,44 @@ +id = $id; + $this->content = $content; + $this->difficulty = $difficulty; + $this->nbFails = $nbFails; + } + + public function getContent() + { + return $this->content; + } + public function setContent(string $content) + { + $this->content = $content; + } + + public function getDifficulty() + { + return $this->difficulty; + } + public function setDifficulty(int $difficulty) + { + $this->difficulty = $difficulty; + } + + public function getNbFails() + { + return $this->nbFails; + } + public function setNbFails(int $nbFails) + { + $this->nbFails = $nbFails; + } +} diff --git a/Website/usages/Config.php b/Website/usages/Config.php index 2282b5b..2d12d9d 100755 --- a/Website/usages/Config.php +++ b/Website/usages/Config.php @@ -2,14 +2,14 @@ //préfixe -$rep= __DIR__ . '/../'; +$rep = __DIR__ . '/../'; //BD -$user= 'jeducourth'; -$pass='achanger'; -$dsn='mysql:host=localhost;dbname=dbjeducourth'; +$user = 'jeducourth'; +$pass = 'achanger'; +$dsn = 'mysql:host=localhost;dbname=dbjeducourth'; //Vues -$vues['erreur'] ='vues/erreur.php'; -$vues['listeNews'] ='vues/listeNews.php'; -$vues['connexionView'] ='vues/connexionView.php'; -$vues['Administratoristration'] ='vues/Administratoristration.php'; +$vues['erreur'] = 'vues/erreur.php'; +$vues['listeNews'] = 'vues/listeNews.php'; +$vues['connexionView'] = 'vues/connexionView.php'; +$vues['Administration'] = 'vues/Administration.php';