diff --git a/Controller/UserController.php b/Controller/UserController.php index dd091244..f8b6be1c 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -468,7 +468,7 @@ class UserController global $rep, $vues, $error; $model = new UserModel(); $idPartie = $_SESSION['idPartie']; - $lesJoueurs = $model->getPlayersEmail($idPartie); + $lesJoueurs = $model->getLesJoueurs($idPartie); $lesJoueurs = json_encode($lesJoueurs); echo ($lesJoueurs); } diff --git a/Model/UserModel.php b/Model/UserModel.php index ef0747d0..7ee53a64 100644 --- a/Model/UserModel.php +++ b/Model/UserModel.php @@ -294,9 +294,6 @@ class UserModel } return $lesPseudos; } - public function getPlayersEmail(int $idPartie) : array{ - return $this->partie_gateway->getLesMailJoueurs($idPartie); - } public function getPlayerScore(string $mailUtilisateur,int $idPartie) : array{ global $playerNumberPerGame; $score = array(); diff --git a/View/src/JS/dashboard.js b/View/src/JS/dashboard.js index 6128740a..4c6ca5ff 100644 --- a/View/src/JS/dashboard.js +++ b/View/src/JS/dashboard.js @@ -1,13 +1,13 @@ function dashboard () { - // var xhr = new XMLHttpRequest(); - // xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersEmail', true); - // xhr.responseType = 'text'; - // xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - // var playersEmail = xhr.onload = function () { - // console.log(xhr.responseText + "DONE"); - // return JSON.parse(xhr.responseText); - // }; - // xhr.send(null); + var xhr = new XMLHttpRequest(); + xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersEmail', true); + xhr.responseType = 'text'; + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + var playersEmail = xhr.onload = function () { + console.log(xhr.responseText); + return JSON.parse(xhr.responseText); + }; + xhr.send(null); var xhr = new XMLHttpRequest(); xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=getPlayersPseudo', true); xhr.responseType = 'text';