if(strpos($text, "/win_india_") !== false) { $match_id = str_replace("/win_india_", "", $text); // Sabhi India betters ko dhundho $bets = mysqli_query($conn, "SELECT * FROM bets WHERE match_id = '$match_id' AND team = 'India' AND status = 'pending'"); while($row = mysqli_fetch_assoc($bets)) { $win_amt = $row['amount'] * $row['odds']; $uid = $row['user_id']; mysqli_query($conn, "UPDATE users SET balance = balance + $win_amt WHERE id = '$uid'"); mysqli_query($conn, "UPDATE bets SET status = 'won' WHERE id = '".$row['id']."'"); } // Baaki ko lost mark karo mysqli_query($conn, "UPDATE bets SET status = 'lost' WHERE match_id = '$match_id' AND team != 'India' AND status = 'pending'"); $msg = "🏆 India Wins! All bets settled."; }