diff --git a/Model/UserModel.php b/Model/UserModel.php index fa458819..6c1c8bab 100644 --- a/Model/UserModel.php +++ b/Model/UserModel.php @@ -130,9 +130,12 @@ class UserModel if ($leClassement[0] == 0){ $classement = 1; } - else{ + else if ($leClassement[$playerNumberPerGame] != null){ $classement = 3; } + else { + $classement = 2; + } // if ($result == 0){ // $classement = 1; // } diff --git a/View/src/JS/base.js b/View/src/JS/base.js index 7727aaef..c6f4ca18 100644 --- a/View/src/JS/base.js +++ b/View/src/JS/base.js @@ -132,7 +132,7 @@ function displayHelp() { function saveCode() { var xhr = new XMLHttpRequest(); // xhr.open('POST', 'http://localhost/Scripted/WEB/index.php?action=saveCode', true); - xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=saveCode', true); + xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=saveCode', true); xhr.responseType = 'text'; xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onload = function () { diff --git a/View/src/JS/baseTest.js b/View/src/JS/baseTest.js index c22e23b6..8143d46a 100644 --- a/View/src/JS/baseTest.js +++ b/View/src/JS/baseTest.js @@ -132,7 +132,7 @@ function run() { function saveCode() { var xhr = new XMLHttpRequest(); // xhr.open('POST', 'http://localhost/Scripted/WEB/index.php?action=saveCodeInCookie', true); - xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=saveCodeInCookie', true); + xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=saveCodeInCookie', true); xhr.responseType = 'text'; xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onload = function () { diff --git a/View/src/pages/Multijoueur/FileAttente.php b/View/src/pages/Multijoueur/FileAttente.php index 6a86005b..7bacf342 100644 --- a/View/src/pages/Multijoueur/FileAttente.php +++ b/View/src/pages/Multijoueur/FileAttente.php @@ -70,13 +70,13 @@ function checkIsReady() { console.log("checkIsReady"); var xhr = new XMLHttpRequest(); - xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=waiting', true); + xhr.open('POST', 'http://82.165.180.114/Scripted/index.php?action=waiting', true); xhr.responseType = 'text'; xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onload = function () { console.log(xhr.responseText); if (xhr.responseText == "1") { - window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=goToGame&idPartie=' + + '&index=1' + window.location.href = 'http://82.165.180.114/Scripted/index.php?action=goToGame&idPartie=' + + '&index=1' } }; xhr.send(null); diff --git a/View/src/pages/Multijoueur/LobbyEnd.php b/View/src/pages/Multijoueur/LobbyEnd.php index cd90528b..dc72b002 100644 --- a/View/src/pages/Multijoueur/LobbyEnd.php +++ b/View/src/pages/Multijoueur/LobbyEnd.php @@ -34,12 +34,12 @@