test
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent a81a036789
commit 08d73a098b

@ -247,6 +247,7 @@ class UserController
$idPartie = $_GET['idPartie']; $idPartie = $_GET['idPartie'];
$index = $_GET['index']; $index = $_GET['index'];
$lastIndex = $model->getLastIndex($idPartie); $lastIndex = $model->getLastIndex($idPartie);
echo $lastIndex;
if ($lastIndex != 0 && $index == $lastIndex + 1) { if ($lastIndex != 0 && $index == $lastIndex + 1) {
if ($model->checkGameIsEnd($idPartie)) { if ($model->checkGameIsEnd($idPartie)) {
$this->endGame(); $this->endGame();

@ -33,13 +33,11 @@
</div> </div>
<script> <script>
function checkIsEnd() { function checkIsEnd() {
console.log("checkIsEnd");
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=getGameEtat', true); xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=getGameEtat', true);
xhr.responseType = 'text'; xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () { xhr.onload = function () {
console.log(xhr.responseText);
if (xhr.responseText == "2") { if (xhr.responseText == "2") {
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame' window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame'
} }

@ -53,7 +53,7 @@ PRIMARY KEY(utilisateur, enigme, partie)
CREATE TABLE Contenir( CREATE TABLE Contenir(
partie int REFERENCES Partie(id), partie int REFERENCES Partie(id),
enigme int REFERENCES Enigme(id), enigme int REFERENCES Enigme(id),
indexEnigme numeric UNIQUE, indexEnigme numeric ,
PRIMARY KEY(partie, enigme) PRIMARY KEY(partie, enigme)
); );

Loading…
Cancel
Save