tfgyifunydrigdrhgerhgiuhgudriughdriuh diu h iuehiurhgiushbuguheiug hdiubh debh dxhbdeh kuse
This commit is contained in:
@@ -10,6 +10,10 @@ header('Content-Type: application/json');
|
|||||||
if ($game_id) {
|
if ($game_id) {
|
||||||
$stmt = $db->prepare("DELETE FROM games WHERE id = ?");
|
$stmt = $db->prepare("DELETE FROM games WHERE id = ?");
|
||||||
$stmt->execute([$game_id]);
|
$stmt->execute([$game_id]);
|
||||||
|
|
||||||
|
// Supprimer les joueurs associés à la partie
|
||||||
|
$stmt = $db->prepare("DELETE FROM players WHERE game_id = ?");
|
||||||
|
$stmt->execute([$game_id]);
|
||||||
} else {
|
} else {
|
||||||
echo "Aucune partie à supprimer.";
|
echo "Aucune partie à supprimer.";
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
+4
-4
@@ -59,7 +59,7 @@ foreach ($players as $p) {
|
|||||||
<div class="stats-bar">
|
<div class="stats-bar">
|
||||||
<div class="stat-item">POT TOTAL: <strong id="main-pot"><?php echo $game['pot'] ?? 0; ?></strong> 🪙</div>
|
<div class="stat-item">POT TOTAL: <strong id="main-pot"><?php echo $game['pot'] ?? 0; ?></strong> 🪙</div>
|
||||||
<div class="stat-item">MISE ACTUELLE: <strong id="current-bet"><?php echo $game['last_bet'] ?? 0; ?></strong></div>
|
<div class="stat-item">MISE ACTUELLE: <strong id="current-bet"><?php echo $game['last_bet'] ?? 0; ?></strong></div>
|
||||||
<button onclick="deleteGame(<?php echo $game_id; ?>)" class="btn-back">Fermer la table</button>
|
<button onclick="deleteGame()" class="btn-back">Fermer la table</button>
|
||||||
<button onclick="changePlayer()" class="btn-back">Joueur suivant</button>
|
<button onclick="changePlayer()" class="btn-back">Joueur suivant</button>
|
||||||
<a href="index.php" class="btn-back">⬅ Quitter</a>
|
<a href="index.php" class="btn-back">⬅ Quitter</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -305,11 +305,11 @@ foreach ($players as $p) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteGame(idPartie) {
|
function deleteGame() {
|
||||||
if (confirm("Supprimer la partie ?")) {
|
if (confirm("Supprimer la partie ?")) {
|
||||||
let formData = new FormData();
|
let formData = new FormData();
|
||||||
formData.append('game_id', idPartie);
|
formData.append('game_id', actualGameID);
|
||||||
console.log("Suppression de la partie ID:", idPartie);
|
console.log("Suppression de la partie ID:", actualGameID);
|
||||||
|
|
||||||
fetch('delete_game.php', { method: 'POST', body: formData })
|
fetch('delete_game.php', { method: 'POST', body: formData })
|
||||||
.then(() => window.location.href = 'index.php');
|
.then(() => window.location.href = 'index.php');
|
||||||
|
|||||||
Reference in New Issue
Block a user