MULTI ajout cartes

master
theo 4 years ago
parent 4d1b94d6c4
commit 6180a234f7

@ -9,15 +9,12 @@ $cartes=$_POST['cartestables'];
$_SESSION['cartestables']=$cartes;
$idpartie = $_SESSION['idpartie'];
$tableau = $cartes;
for ($i = 0; $i <= 15; $i++) {
$valcol1= substr($tableau[$i],-25,7);
$valcol2= substr($tableau[$i],-14,7);
$valcol3= substr($tableau[$i],-7);
for ($i = 1; $i <= 16; $i++) {
$valcol1= substr($cartes[i],7);
$valcol2= substr($cartes[i],7,14);
$valcol3= substr($cartes[i],-7);
$update = $db->query('UPDATE partieCartes SET "colUn" = "Salut","colDeux"="je veux","colTrois"="'.$valcol3.'" where Id="'.$idpartie.'" ');
$update = $db->query('UPDATE partieCartes SET "colUn" = "'.$valcol1.'","colDeux"="'.$valcol2.'","colTrois"="'.$valcol3.'" where IdPartie="'.$idpartie.'" AND IdCarte="'.($i+1).'" ');
}

@ -40,7 +40,7 @@ session_start();
if(isset($_POST['rejoindre'])){
$_SESSION['idpartie']=$_POST['rejoindre'];
}
if(!isset($idpartie)){
if(isset($idpartie)){
$idpartie = $_SESSION['idpartie'];
}
echo "<h2 id='ids'>Identifiant partie : <strong>$idpartie</strong></h2>";
@ -51,9 +51,8 @@ echo "<h2 id='ids'>Identifiant partie : <strong>$idpartie</strong></h2>";
<script>
$(document).ready(function(){
$(document).on('click','#buttons',function() {
alert("Création des lignes tables")
$("#div1").load('SupprimerEtCreerPartie.php')
});
});
</script>
@ -603,7 +602,15 @@ echo "<h2 id='ids'>Identifiant partie : <strong>$idpartie</strong></h2>";
if(isset($_SESSION['cartestables'])){
$cartestable = $_SESSION['cartestables'];
print_r($cartestable);
}
for ($i = 0; $i <= 15; $i++) {
$valcol1= substr($cartestable[$i],-25,7);
$valcol2= substr($cartestable[$i],-14,7);
$valcol3= substr($cartestable[$i],-7);
echo ".<br>"."tab: ".$valcol1." ".$valcol2." ".$valcol3;
}
?>

@ -341,7 +341,7 @@ function redistribuer() {
deckPartie.push(copieCarte(TasDuJEU[index]));
}
passageData();
passageData(deckPartie);
afficherCartes(deckPartie);
}
@ -397,12 +397,12 @@ function genererTouteslesCartes3_4Possibles() {
return deckPartie;
}
function passageData() {
function passageData(deck) {
listecartes2=deck;
$(document).ready(function(){
var cartestables =listecartes;
var cartestables =listecartes2;
$.ajax({
data: {
cartestables:cartestables
@ -410,7 +410,8 @@ function passageData() {
type: "post",
url: "envoyercartes.php",
success: function(data){
alert("Je suis passe")
alert("Je suis passe(passage data)");
alert(data);
}
});
});
@ -468,9 +469,8 @@ function creePartieClassique() {
var ajt = deckPartie[i].getMatrice[0]+deckPartie[i].getMatrice[1]+deckPartie[i].getMatrice[2]
listecartes.push(ajt)
console.log(i)
}
console.log(listecartes);
console.log("Coucou")
@ -486,7 +486,7 @@ function creePartieClassique() {
type: "post",
url: "envoyercartes.php",
success: function(data){
alert("Je suis passe")
alert("Je suis passe (Partie classique)")
}
});
});

Loading…
Cancel
Save