@ -1,4 +1,8 @@
<!DOCTYPE html>
<?php
session_start();
require("ConnexionBDD.php");
?>
<!DOCTYPE html>
< html >
< head lang = "fr" >
< meta charset = "utf-8" >
@ -13,11 +17,11 @@
< link rel = "stylesheet" href = "css/formes.css" >
< link rel = "stylesheet" href = "css/Resp3.css" >
< script type = "text/javascript" src = "js/main .js"> < / script >
< script type = "text/javascript" src = "js/main 2 .js"> < / script >
< script type = "text/javascript" src = "js/menu.js" > < / script >
< script type = "text/javascript" src = "js/jquery.js" > < / script >
< script src = "https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.min.js" > < / script >
< link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css" / >
< link rel = "stylesheet" href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css" / >
< / head >
@ -695,26 +699,18 @@
< div id = "multiParams" >
< div id = "buttonMulti" >
< div class = "bouttonvalider2 violet" >
< h1 id = "textmulti "> Créer< / h1 >
< h1 id = "textmulti creer "> Créer< / h1 >
< / div >
< / div >
< div id = "conteneurCreate" >
< / div >
< div id = "conteneurCreate" >
< input type = "input" class = "form__field" placeholder = "ID Partie" name = "name" id = 'name' / >
< / div >
< div id = "buttonMulti2" >
< div class = "bouttonvalider2 violet" >
< h1 id = "textmulti "> Rejoindre< / h1 >
< h1 id = "textmultirejoindre" > Rejoindre< / h1 >
< / div >
< / div >
< div id = "conteneurJoin" >
< input type = "input" class = "form__field" placeholder = "ID Partie" name = "name" id = ' name '/ >
< input type = "input" class = "form__field" placeholder = "ID Partie" name = "name" id = 'idinput_multi' / >
< / div >
< / div >
@ -981,6 +977,99 @@
< p id = "affSolution" > < / p >
< / div >
< / div >
< div id = "idGameMulti" >
< div id = "ActualiserID" >
< p > C< / p >
< / div >
< script >
$(document).ready(function(){
setInterval(function(){
$("#ActualiserID").load('ActualiserIDPartie.php');
}, 500);
});
< / script >
< / div >
< script type = "text/javascript" >
function Actualisation(){
//lecture dans la base
tabcomplet=[];
var jar = [];
const xhr = new XMLHttpRequest();
xhr.open("POST","test.php");
xhr.onload=function (){
jar=this.response;
var chainetable=jar;
var j=0;
for (let i = 0; i < 16 ; i + + ) {
var v = chainetable.substr(j, 23);
//console.log(v);
tabcomplet.push(v.replaceAll(',',''));
j=j+24;
}
tab2=tabcomplet;
/*
if(tabcomplet[0].length!=0){
if(tabcomplet[1].length!=0){
ConvertInttoCarte(tabcomplet)
}
}
console.log("Tableau :"+tabcomplet);
//ConvertInttoCarte(tabcomplet);*/
};
xhr.send();
//console.log("Longeur tabcomplet : "+tabcomplet.length);
if(tab2[0].length!=0){
if(tab2[1].length!=0){
listeactuelle=[];
for (var i = 0; i < deckPartie.length ; i + + ) {
var ajt = deckPartie[i].getMatrice[0] + deckPartie[i].getMatrice[1]+deckPartie[i].getMatrice[2];
listeactuelle.push(ajt.replaceAll(',',''));
}
//if(TableauPareil(tab2,listeactuelle)==false){
//console.log(tab2);
//console.log(listeactuelle);
ConvertInttoCarte(tab2);
//}
}
}
}
t = setInterval(Actualisation,550);
< / script >
< script >
$(document).ready(function(){
$(document).on('click','#textmulticreer',function() {
$("#ActualiserID").load('SupprimerEtCreerPartie.php')
console.log("appel SuppEtCreerPartie")
lancerGameMulti();
});
});
< / script >
< script >
$(document).ready(function(){
$(document).on('click','#textmultirejoindre',function() {
lancerpartie();
var input = document.getElementById("idinput_multi").value;
$(document).ready(function(){
var idpartie = input;
$.ajax({
data: {
idpartie:idpartie
},
type: "post",
url: "envoyeridpartie.php",
success: function(data){
console.log("Id partie : "+idpartie);
}
});
});
rejoindreGameMulti();
});
});
< / script >
< / body >
< / html >