|
|
@ -32,8 +32,25 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
function checkIsEnd() {
|
|
|
|
|
|
|
|
console.log("checkIsEnd");
|
|
|
|
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
|
|
|
|
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame', true);
|
|
|
|
|
|
|
|
xhr.responseType = 'text';
|
|
|
|
|
|
|
|
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
|
|
|
|
|
|
xhr.onload = function () {
|
|
|
|
|
|
|
|
if (xhr.status === 200) {
|
|
|
|
|
|
|
|
console.log(xhr.responseText);
|
|
|
|
|
|
|
|
if (xhr.responseText == "2") {
|
|
|
|
|
|
|
|
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=getGameEtat'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
xhr.send(null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
var seconds = <?php echo $remaining_seconds; ?>;
|
|
|
|
var seconds = <?php echo $remaining_seconds; ?>;
|
|
|
|
function countdown() {
|
|
|
|
function countdown() {
|
|
|
|
|
|
|
|
checkIsEnd();
|
|
|
|
var days = Math.floor(seconds/24/60/60);
|
|
|
|
var days = Math.floor(seconds/24/60/60);
|
|
|
|
var hoursLeft = Math.floor((seconds) - (days*86400));
|
|
|
|
var hoursLeft = Math.floor((seconds) - (days*86400));
|
|
|
|
var hours = Math.floor(hoursLeft/3600);
|
|
|
|
var hours = Math.floor(hoursLeft/3600);
|
|
|
@ -52,24 +69,6 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var countdownTimer = setInterval('countdown()', 1000);
|
|
|
|
var countdownTimer = setInterval('countdown()', 1000);
|
|
|
|
|
|
|
|
|
|
|
|
function checkIsEnd() {
|
|
|
|
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
|
|
|
|
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=endGame', true);
|
|
|
|
|
|
|
|
xhr.responseType = 'text';
|
|
|
|
|
|
|
|
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
|
|
|
|
|
|
|
xhr.onload = function () {
|
|
|
|
|
|
|
|
if (xhr.status === 200) {
|
|
|
|
|
|
|
|
if (xhr.responseText == "2") {
|
|
|
|
|
|
|
|
window.location.href = 'http://82.165.180.114/Scripted/WEB/index.php?action=getGameEtat'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
xhr.send(null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
while (1){
|
|
|
|
|
|
|
|
checkIsEnd();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<!-- Bootstrap JavaScript Libraries -->
|
|
|
|
<!-- Bootstrap JavaScript Libraries -->
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"
|
|
|
|