diff --git a/View/src/pages/Multijoueur/LobbyEnd.php b/View/src/pages/Multijoueur/LobbyEnd.php index 3feebc93..1aaa9881 100644 --- a/View/src/pages/Multijoueur/LobbyEnd.php +++ b/View/src/pages/Multijoueur/LobbyEnd.php @@ -57,7 +57,15 @@ if (remainingSeconds < 10) { remainingSeconds = "0" + remainingSeconds; } - document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes"; + if (hours == 0){ + document.getElementById('countdown').innerHTML = minutes + " minutes " + remainingSeconds + " secondes"; + } + else if (minutes == 0){ + document.getElementById('countdown').innerHTML = "Il reste moins d'une minute."; + } + else { + document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes"; + } if (seconds == 0) { clearInterval(countdown); window.location.href = 'http://82.165.180.114/Scripted/index.php?action=endGame' diff --git a/View/src/pages/Multijoueur/Partie.php b/View/src/pages/Multijoueur/Partie.php index 246fa4f3..79216713 100644 --- a/View/src/pages/Multijoueur/Partie.php +++ b/View/src/pages/Multijoueur/Partie.php @@ -200,7 +200,15 @@ if (remainingSeconds < 10) { remainingSeconds = "0" + remainingSeconds; } - document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes"; + if (hours == 0){ + document.getElementById('countdown').innerHTML = minutes + " minutes " + remainingSeconds + " secondes"; + } + else if (minutes == 0){ + document.getElementById('countdown').innerHTML = "Il reste moins d'une minute."; + } + else { + document.getElementById('countdown').innerHTML = hours + " heures " + minutes + " minutes " + remainingSeconds + " secondes"; + } if (seconds == 0) { clearInterval(countdown); window.location.href = 'http://82.165.180.114/Scripted/index.php?action=endGame'