Skip to content

AH tournament app #546

@arnabhaque276-cmyk

Description

@arnabhaque276-cmyk

CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50),
email VARCHAR(100),
password VARCHAR(255),
wallet_balance DECIMAL(10,2) DEFAULT 0.00,
referral_code VARCHAR(20) UNIQUE,
referred_by VARCHAR(20) NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE tournaments (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100),
entry_fee DECIMAL(10,2),
prize_pool DECIMAL(10,2),
per_kill DECIMAL(10,2) DEFAULT 0.00,
match_time DATETIME,
status ENUM('Upcoming', 'Live', 'Completed') DEFAULT 'Upcoming'
);

CREATE TABLE deposit_requests (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
amount DECIMAL(10,2),
method VARCHAR(50),
trxid VARCHAR(100),
status ENUM('Pending', 'Approved', 'Rejected') DEFAULT 'Pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

AH TOURNAMENT

Play Like a Pro, Win Like a Boss!

<h3 class="font-bold mb-4">Upcoming Matches</h3>
<?php
$res = $conn->query("SELECT * FROM tournaments WHERE status = 'Upcoming'");
while($row = $res->fetch_assoc()):
?>
<div class="bg-slate-900 rounded-[2rem] border border-slate-800 p-2 mb-6 shadow-xl">
    <div class="relative">
        <img src="assets/bg.jpg" class="w-full h-40 rounded-[1.8rem] object-cover">
        <div class="absolute bottom-4 right-4 bg-blue-600 px-4 py-1 rounded-2xl font-bold italic">৳<?php echo $row['entry_fee']; ?></div>
    </div>
    <div class="p-4">
        <h4 class="text-lg font-bold mb-3"><?php echo $row['title']; ?></h4>
        <div class="grid grid-cols-3 gap-2 border-y border-slate-800 py-3 mb-4 text-center">
            <div><p class="text-[10px] text-gray-500 uppercase">Prize</p><p class="text-green-400 font-bold">৳<?php echo $row['prize_pool']; ?></p></div>
            <div class="border-x border-slate-800"><p class="text-[10px] text-gray-500 uppercase">Per Kill</p><p class="font-bold">৳<?php echo $row['per_kill']; ?></p></div>
            <div><p class="text-[10px] text-gray-500 uppercase">Time</p><p class="text-blue-400 font-bold"><?php echo date('h:i A', strtotime($row['match_time'])); ?></p></div>
        </div>
        <form method="POST" action="join_logic.php">
            <input type="hidden" name="t_id" value="<?php echo $row['id']; ?>">
            <button name="join" class="w-full bg-blue-600 py-3 rounded-2xl font-black italic shadow-lg active:scale-95 transition-all">JOIN NOW</button>
        </form>
    </div>
</div>
<?php endwhile; ?>

Total Balance

ADD MONEY WITHDRAW
<div id="depModal" class="fixed inset-0 bg-black/90 hidden z-[100] flex items-end">
    <div class="bg-slate-900 w-full rounded-t-[3rem] p-8 border-t border-white/10">
        <h2 class="text-xl font-bold mb-4 italic">Add Money (bKash/Rocket)</h2>
        <form action="process_deposit.php" method="POST" class="space-y-4">
            <select name="method" class="w-full bg-slate-800 p-4 rounded-2xl outline-none">
                <option value="bKash">bKash (Send Money)</option>
                <option value="Rocket">Rocket (Send Money)</option>
            </select>
            <input type="number" name="amount" placeholder="Amount (৳)" class="w-full bg-slate-800 p-4 rounded-2xl outline-none" required>
            <input type="text" name="trxid" placeholder="Transaction ID (TrxID)" class="w-full bg-slate-800 p-4 rounded-2xl outline-none uppercase" required>
            <button class="w-full bg-blue-600 py-4 rounded-2xl font-black">SUBMIT REQUEST</button>
            <button type="button" onclick="openModal()" class="w-full py-2 text-gray-500">Close</button>
        </form>
    </div>
</div>
<script>function openModal(){ document.getElementById('depModal').classList.toggle('hidden'); }</script>

Refer & Earn

আপনার বন্ধুকে রেফার করলে আপনি পেয়ে যাবেন ১০টাকা বোনাস!

<div class="bg-slate-900 border border-slate-800 p-8 rounded-[2.5rem] shadow-2xl">
    <p class="text-[10px] text-gray-500 uppercase mb-2">Your Code</p>
    <div class="bg-slate-800 border-2 border-dashed border-blue-500/50 p-4 rounded-2xl mb-6 text-2xl font-black text-blue-400">
        <?php echo $user['referral_code']; ?>
    </div>
    <button class="w-full bg-blue-600 py-4 rounded-2xl font-black italic shadow-lg">SHARE ON WHATSAPP</button>
</div>

আপনার ব্যালেন্স নাই!

টাকা ডিপোজিট করে তারপর ম্যাচে জয়েন করুন।

ডিপোজিট করুন
$user_id = $_SESSION['user_id'];
$res = $conn->query("SELECT * FROM users WHERE id = $user_id");
$user = $res->fetch_assoc();

include 'common/header.php';
?>

<div class="bg-gradient-to-b from-blue-600 to-indigo-900 rounded-[2.5rem] p-8 text-center shadow-2xl mb-8 relative overflow-hidden">
    <div class="relative z-10">
        <div class="w-24 h-24 bg-white/20 rounded-full flex items-center justify-center mx-auto mb-4 border-4 border-white/10 shadow-xl">
            <i class="fas fa-user text-4xl text-white"></i>
        </div>
        <h2 class="text-2xl font-black italic uppercase tracking-wider"><?php echo $user['username']; ?></h2>
        <p class="text-blue-200 text-xs mb-4"><?php echo $user['email']; ?></p>
        
        <div class="inline-block bg-black/30 backdrop-blur-md px-6 py-2 rounded-full border border-white/10">
            <p class="text-[10px] text-gray-400 uppercase font-bold tracking-widest">Available Balance</p>
            <p class="text-green-400 font-black italic">৳<?php echo number_format($user['wallet_balance'], 0); ?></p>
        </div>
    </div>
    <i class="fas fa-shield-alt absolute -right-6 -top-6 text-9xl text-white/5 rotate-12"></i>
</div>

<div class="grid grid-cols-2 gap-4 mb-8">
    <div class="bg-slate-900 border border-slate-800 p-5 rounded-3xl text-center">
        <p class="text-blue-500 font-black text-xl">12</p>
        <p class="text-gray-500 text-[10px] uppercase font-bold">Matches Played</p>
    </div>
    <div class="bg-slate-900 border border-slate-800 p-5 rounded-3xl text-center">
        <p class="text-green-500 font-black text-xl">05</p>
        <p class="text-gray-500 text-[10px] uppercase font-bold">Total Wins</p>
    </div>
</div>

<div class="bg-slate-900 border border-slate-800 rounded-[2rem] overflow-hidden mb-8 shadow-xl">
    <div class="p-4 border-b border-slate-800 hover:bg-slate-800 transition-all cursor-pointer flex items-center justify-between">
        <div class="flex items-center">
            <div class="w-10 h-10 bg-blue-500/10 rounded-xl flex items-center justify-center mr-4">
                <i class="fas fa-user-edit text-blue-500"></i>
            </div>
            <span class="font-bold text-sm">Edit Profile</span>
        </div>
        <i class="fas fa-chevron-right text-gray-600 text-xs"></i>
    </div>

    <div class="p-4 border-b border-slate-800 hover:bg-slate-800 transition-all cursor-pointer flex items-center justify-between">
        <div class="flex items-center">
            <div class="w-10 h-10 bg-purple-500/10 rounded-xl flex items-center justify-center mr-4">
                <i class="fas fa-key text-purple-500"></i>
            </div>
            <span class="font-bold text-sm">Change Password</span>
        </div>
        <i class="fas fa-chevron-right text-gray-600 text-xs"></i>
    </div>

    <div class="p-4 border-b border-slate-800 hover:bg-slate-800 transition-all cursor-pointer flex items-center justify-between">
        <div class="flex items-center">
            <div class="w-10 h-10 bg-orange-500/10 rounded-xl flex items-center justify-center mr-4">
                <i class="fas fa-headset text-orange-500"></i>
            </div>
            <span class="font-bold text-sm">Support Center</span>
        </div>
        <i class="fas fa-chevron-right text-gray-600 text-xs"></i>
    </div>

    <a href="logout.php" class="p-4 hover:bg-red-500/10 transition-all cursor-pointer flex items-center justify-between group">
        <div class="flex items-center">
            <div class="w-10 h-10 bg-red-500/10 rounded-xl flex items-center justify-center mr-4 group-hover:bg-red-500">
                <i class="fas fa-sign-out-alt text-red-500 group-hover:text-white"></i>
            </div>
            <span class="font-bold text-sm text-red-500">Logout Account</span>
        </div>
        <i class="fas fa-chevron-right text-gray-600 text-xs"></i>
    </a>
</div>

<p class="text-center text-gray-600 text-[10px] uppercase font-bold tracking-widest">App Version 2.0.1 (Pro)</p>
session_start();
include 'common/config.php';
if(!isset($_SESSION['user_id'])) { header("Location: login.php"); exit(); }

$user_id = $_SESSION['user_id'];
$t_id = $_GET['id']; // ইউআরএল থেকে টুর্নামেন্ট আইডি

// টুর্নামেন্ট এবং ইউজারের জয়েনিং স্ট্যাটাস চেক
$res = $conn->query("SELECT * FROM tournaments WHERE id = $t_id");
$t = $res->fetch_assoc();

$join_check = $conn->query("SELECT * FROM participants WHERE user_id = $user_id AND tournament_id = $t_id");
$is_joined = ($join_check->num_rows > 0);

include 'common/header.php';
?>

<?php if($is_joined): ?>
<div class="bg-gradient-to-r from-blue-900/40 to-indigo-900/40 border border-blue-500/30 rounded-[2rem] p-6 mb-8 backdrop-blur-md shadow-[0_0_30px_rgba(59,130,246,0.1)]">
    <h3 class="text-center text-blue-400 font-black text-xs uppercase tracking-[0.3em] mb-4">Room Details</h3>
    
    <?php if(!empty($t['room_id'])): ?>
    <div class="grid grid-cols-2 gap-4">
        <div class="bg-slate-800/50 p-4 rounded-2xl border border-white/5 text-center">
            <p class="text-[10px] text-gray-500 uppercase font-bold mb-1">Room ID</p>
            <p class="text-xl font-black text-white select-text cursor-pointer" onclick="copyText('<?php echo $t['room_id']; ?>')"><?php echo $t['room_id']; ?></p>
        </div>
        <div class="bg-slate-800/50 p-4 rounded-2xl border border-white/5 text-center">
            <p class="text-[10px] text-gray-500 uppercase font-bold mb-1">Password</p>
            <p class="text-xl font-black text-white select-text cursor-pointer" onclick="copyText('<?php echo $t['room_password']; ?>')"><?php echo $t['room_password']; ?></p>
        </div>
    </div>
    <p class="text-center text-[10px] text-blue-300 mt-4 animate-pulse italic">আইডি বা পাসওয়ার্ডে ক্লিক করে কপি করুন</p>
    <?php else: ?>
    <div class="text-center py-4">
        <i class="fas fa-lock text-gray-600 text-3xl mb-3"></i>
        <p class="text-gray-500 text-sm italic">ম্যাচ শুরু হওয়ার ১৫ মিনিট আগে রুম আইডি দেওয়া হবে।</p>
    </div>
    <?php endif; ?>
</div>
<?php endif; ?>

<div class="bg-slate-900 border border-slate-800 rounded-[2rem] p-6 shadow-xl mb-6">
    <h3 class="font-bold text-lg mb-4 flex items-center">
        <i class="fas fa-list-ul text-blue-500 mr-3"></i> Match Rules
    </h3>
    <ul class="space-y-4">
        <li class="flex items-start text-sm text-gray-400">
            <span class="text-blue-500 mr-3">•</span> হ্যাকিং বা অন্য কোনো অনৈতিক উপায় ব্যবহার করলে আইডি ব্যান করা হবে।
        </li>
        <li class="flex items-start text-sm text-gray-400">
            <span class="text-blue-500 mr-3">•</span> গেমের ভেতর টিম আপ করা সম্পূর্ণ নিষেধ।
        </li>
        <li class="flex items-start text-sm text-gray-400">
            <span class="text-blue-500 mr-3">•</span> ম্যাচ শুরুর ৫ মিনিট আগে রুমে জয়েন করতে হবে।
        </li>
    </ul>
</div>

<div class="flex items-center justify-between px-2 text-sm">
    <span class="text-gray-500">Total Joined:</span>
    <span class="font-bold text-white">
        <?php 
        $count = $conn->query("SELECT id FROM participants WHERE tournament_id = $t_id")->num_rows;
        echo $count; 
        ?> / 48
    </span>
</div>
<div class="w-full bg-slate-800 h-2 rounded-full mt-2 overflow-hidden">
    <div class="bg-blue-600 h-full" style="width: <?php echo ($count/48)*100; ?>%"></div>
</div>
<script> function copyText(text) { navigator.clipboard.writeText(text); alert('Copied to clipboard!'); } </script> session_start();
include '../common/config.php';
// অ্যাডমিন লগইন চেক এখানে হবে

$t_id = $_GET['id'];
$msg = "";

// ১. রুম আইডি এবং পাসওয়ার্ড আপডেট লজিক
if(isset($_POST['update_room'])){
$rid = $_POST['room_id'];
$rpass = $_POST['room_pass'];
$conn->query("UPDATE tournaments SET room_id='$rid', room_password='$rpass' WHERE id=$t_id");
$msg = "Room details updated!";
}

// ২. উইনার ঘোষণা এবং টাকা ডিস্ট্রিবিউশন লজিক
if(isset($_POST['declare_winner'])){
$winner_id = $_POST['winner_user_id'];
$t_res = $conn->query("SELECT prize_pool FROM tournaments WHERE id = $t_id")->fetch_assoc();
$prize = $t_res['prize_pool'];

// উইনারের অ্যাকাউন্টে টাকা যোগ করা
$conn->query("UPDATE users SET wallet_balance = wallet_balance + $prize WHERE id = $winner_id");

// টুর্নামেন্ট কমপ্লিট করা
$conn->query("UPDATE tournaments SET status = 'Completed' WHERE id = $t_id");

// ট্রানজেকশন রেকর্ড
$conn->query("INSERT INTO transactions (user_id, amount, type, description) VALUES ($winner_id, $prize, 'credit', 'Won Tournament #$t_id')");

$msg = "Winner declared and prize distributed!";

}

$t = $conn->query("SELECT * FROM tournaments WHERE id = $t_id")->fetch_assoc();
include 'common/header.php';
?>

MANAGE MATCH

<?php if($msg) echo "<p class='bg-green-600/20 text-green-400 p-4 rounded-2xl mb-6 border border-green-600/30 text-center font-bold'>$msg</p>"; ?>

<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
    
    <div class="bg-slate-900 border border-slate-800 p-8 rounded-[2.5rem] shadow-xl">
        <h3 class="text-lg font-bold mb-6 flex items-center"><i class="fas fa-key mr-3 text-blue-500"></i> Room Details</h3>
        <form method="POST" class="space-y-4">
            <input type="text" name="room_id" value="<?php echo $t['room_id']; ?>" placeholder="Room ID" class="w-full bg-slate-800 p-4 rounded-2xl outline-none border border-transparent focus:border-blue-500">
            <input type="text" name="room_pass" value="<?php echo $t['room_password']; ?>" placeholder="Room Password" class="w-full bg-slate-800 p-4 rounded-2xl outline-none border border-transparent focus:border-blue-500">
            <button name="update_room" class="w-full bg-blue-600 py-4 rounded-2xl font-black italic shadow-lg active:scale-95 transition-all">UPDATE ROOM</button>
        </form>
    </div>

    <div class="bg-slate-900 border border-slate-800 p-8 rounded-[2.5rem] shadow-xl">
        <h3 class="text-lg font-bold mb-6 flex items-center"><i class="fas fa-trophy mr-3 text-yellow-500"></i> Declare Winner</h3>
        <form method="POST" class="space-y-4">
            <select name="winner_user_id" class="w-full bg-slate-800 p-4 rounded-2xl outline-none border border-transparent focus:border-yellow-500 appearance-none">
                <option value="">Select Winner Player</option>
                <?php
                $players = $conn->query("SELECT u.id, u.username FROM users u JOIN participants p ON u.id = p.user_id WHERE p.tournament_id = $t_id");
                while($p = $players->fetch_assoc()):
                ?>
                <option value="<?php echo $p['id']; ?>"><?php echo $p['username']; ?> (ID: <?php echo $p['id']; ?>)</option>
                <?php endwhile; ?>
            </select>
            <button name="declare_winner" onclick="return confirm('আপনি কি নিশ্চিত? এটি টাকা অটোমেটিক ইউজারের অ্যাকাউন্টে পাঠিয়ে দিবে।')" class="w-full bg-yellow-600 py-4 rounded-2xl font-black italic shadow-lg active:scale-95 transition-all text-black">DISTRIBUTE PRIZE</button>
        </form>
    </div>

</div>

<div class="mt-8 bg-slate-900 border border-slate-800 rounded-[2.5rem] p-8">
    <h3 class="text-lg font-bold mb-6">Joined Players List</h3>
    <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
        <?php
        $players = $conn->query("SELECT u.username FROM users u JOIN participants p ON u.id = p.user_id WHERE p.tournament_id = $t_id");
        while($p = $players->fetch_assoc()):
        ?>
        <div class="bg-slate-800 p-3 rounded-xl text-center text-sm font-medium border border-white/5">
            <?php echo $p['username']; ?>
        </div>
        <?php endwhile; ?>
    </div>
</div>
include 'common/config.php';

// ১. ইউজার টেবিল
$sql1 = "CREATE TABLE IF NOT EXISTS users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
wallet_balance DECIMAL(10,2) DEFAULT 0.00,
referral_code VARCHAR(20) UNIQUE,
referred_by VARCHAR(20) NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";

// ২. টুর্নামেন্ট টেবিল
$sql2 = "CREATE TABLE IF NOT EXISTS tournaments (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(100) NOT NULL,
entry_fee DECIMAL(10,2) NOT NULL,
prize_pool DECIMAL(10,2) NOT NULL,
per_kill DECIMAL(10,2) DEFAULT 0.00,
match_time DATETIME,
room_id VARCHAR(50),
room_password VARCHAR(50),
status ENUM('Upcoming', 'Live', 'Completed') DEFAULT 'Upcoming',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";

// ৩. পার্টিসিপেন্ট টেবিল
$sql3 = "CREATE TABLE IF NOT EXISTS participants (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
tournament_id INT,
FOREIGN KEY (user_id) REFERENCES users(id),
FOREIGN KEY (tournament_id) REFERENCES tournaments(id)
)";

// ৪. ডিপোজিট রিকোয়েস্ট টেবিল
$sql4 = "CREATE TABLE IF NOT EXISTS deposit_requests (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
amount DECIMAL(10,2),
method VARCHAR(50),
trxid VARCHAR(100) UNIQUE,
status ENUM('Pending', 'Approved', 'Rejected') DEFAULT 'Pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";

// ৫. ট্রানজেকশন টেবিল
$sql5 = "CREATE TABLE IF NOT EXISTS transactions (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
amount DECIMAL(10,2),
type ENUM('credit', 'debit'),
description VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)";

// ৬. অ্যাডমিন টেবিল
$sql6 = "CREATE TABLE IF NOT EXISTS admin (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
password VARCHAR(255) NOT NULL
)";

// টেবিলগুলো তৈরি করা
$conn->query($sql1);
$conn->query($sql2);
$conn->query($sql3);
$conn->query($sql4);
$conn->query($sql5);
$conn->query($sql6);

// ডিফল্ট অ্যাডমিন তৈরি (ইউজার: admin, পাসওয়ার্ড: 1234)
$admin_pass = password_hash("1234", PASSWORD_DEFAULT);
$conn->query("INSERT IGNORE INTO admin (id, username, password) VALUES (1, 'admin', '$admin_pass')");

echo "

";
echo "

✅ Installation Successful!

";
echo "

আপনার ডাটাবেস টেবিলগুলো তৈরি হয়েছে।

";
echo "

অ্যাডমিন পাসওয়ার্ড সেট করা হয়েছে: 1234

";
echo "Login Now";
echo "
";
?><?php
session_start();
include 'common/config.php';

// লগইন লজিক (সংক্ষেপে)
if(isset($_POST['login_btn'])) {
$email = $_POST['email'];
$pass = $_POST['password'];
// ডাটাবেস চেক এবং সেশন সেট করার লজিক এখানে হবে...
}

// সাইন আপ লজিক
if(isset($_POST['signup_btn'])) {
$username = $_POST['username'];
$email = $_POST['email'];
$pass = $_POST['password'];
$ref_by = $_POST['ref_by']; // রেফার কোড

// নতুন ইউজার ডাটাবেসে সেভ করার লজিক...

}
?>

<title>AH Tournament - Login</title> <script src="https://cdn.tailwindcss.com"></script> <style> body { background-color: #0f172a; font-family: 'Inter', sans-serif; overflow: hidden; } .glass { background: rgba(30, 41, 59, 0.7); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); } .tab-active { color: #3b82f6; border-bottom: 3px solid #3b82f6; } input::placeholder { color: #64748b; } </style>
<div class="w-full max-w-md">
    <div class="text-center mb-8">
        <div class="inline-block bg-blue-600 p-4 rounded-3xl shadow-lg mb-4 shadow-blue-600/20">
            <i class="fas fa-gamepad text-4xl text-white"></i>
        </div>
        <h2 class="text-3xl font-black text-white italic">AH TOURNAMENT</h2>
        <p class="text-gray-500 text-sm">Join the Elite Gaming Arena</p>
    </div>

    <div class="glass rounded-[2.5rem] p-8 shadow-2xl">
        <div class="flex mb-8 border-b border-slate-700">
            <button onclick="switchTab('login')" id="loginTab" class="flex-1 pb-3 font-bold transition-all tab-active">LOGIN</button>
            <button onclick="switchTab('signup')" id="signupTab" class="flex-1 pb-3 font-bold text-gray-500 transition-all">SIGN UP</button>
        </div>

        <form id="loginForm" action="login.php" method="POST" class="space-y-4">
            <div class="relative">
                <i class="fas fa-envelope absolute left-4 top-4 text-gray-500"></i>
                <input type="email" name="email" placeholder="Email Address" class="w-full bg-slate-800/50 p-4 pl-12 rounded-2xl outline-none text-white border border-transparent focus:border-blue-500 transition-all" required>
            </div>
            <div class="relative">
                <i class="fas fa-lock absolute left-4 top-4 text-gray-500"></i>
                <input type="password" name="password" placeholder="Password" class="w-full bg-slate-800/50 p-4 pl-12 rounded-2xl outline-none text-white border border-transparent focus:border-blue-500 transition-all" required>
            </div>
            <button name="login_btn" class="w-full bg-blue-600 py-4 rounded-2xl font-black text-white shadow-lg shadow-blue-600/20 active:scale-95 transition-all">LOGIN NOW</button>
        </form>

        <form id="signupForm" action="login.php" method="POST" class="space-y-4 hidden">
            <div class="relative">
                <i class="fas fa-user absolute left-4 top-4 text-gray-500"></i>
                <input type="text" name="username" placeholder="Full Name" class="w-full bg-slate-800/50 p-4 pl-12 rounded-2xl outline-none text-white border border-transparent focus:border-blue-500 transition-all" required>
            </div>
            <div class="relative">
                <i class="fas fa-envelope absolute left-4 top-4 text-gray-500"></i>
                <input type="email" name="email" placeholder="Email Address" class="w-full bg-slate-800/50 p-4 pl-12 rounded-2xl outline-none text-white border border-transparent focus:border-blue-500 transition-all" required>
            </div>
            <div class="relative">
                <i class="fas fa-lock absolute left-4 top-4 text-gray-500"></i>
                <input type="password" name="password" placeholder="Password" class="w-full bg-slate-800/50 p-4 pl-12 rounded-2xl outline-none text-white border border-transparent focus:border-blue-500 transition-all" required>
            </div>
            <div class="relative">
                <i class="fas fa-gift absolute left-4 top-4 text-gray-500"></i>
                <input type="text" name="ref_by" placeholder="Refer Code (Optional)" class="w-full bg-slate-800/50 p-4 pl-12 rounded-2xl outline-none text-white border border-transparent focus:border-blue-500 transition-all">
            </div>
            <button name="signup_btn" class="w-full bg-gradient-to-r from-blue-600 to-indigo-600 py-4 rounded-2xl font-black text-white shadow-lg shadow-blue-600/20 active:scale-95 transition-all">CREATE ACCOUNT</button>
        </form>

        <p class="text-center text-gray-500 text-xs mt-6">By continuing, you agree to our <span class="text-blue-500">Terms & Conditions</span></p>
    </div>
</div>

<script>
    function switchTab(type) {
        const loginForm = document.getElementById('loginForm');
        const signupForm = document.getElementById('signupForm');
        const loginTab = document.getElementById('loginTab');
        const signupTab = document.getElementById('signupTab');

        if(type === 'login') {
            loginForm.classList.remove('hidden');
            signupForm.classList.add('hidden');
            loginTab.classList.add('tab-active');
            signupTab.classList.remove('tab-active');
            signupTab.classList.add('text-gray-500');
        } else {
            loginForm.classList.add('hidden');
            signupForm.classList.remove('hidden');
            signupTab.classList.add('tab-active');
            loginTab.classList.remove('tab-active');
            loginTab.classList.add('text-gray-500');
        }
    }

    // Disable right-click, text selection, and zoom
    document.addEventListener('contextmenu', event => event.preventDefault());
    document.addEventListener('gesturestart', (e) => e.preventDefault());
</script>
// ইউজার লগইন না থাকলে লগইন পেজে পাঠিয়ে দিবে
if(!isset($_SESSION['user_id'])) {
header("Location: login.php");
exit();
}

$user_id = $_SESSION['user_id'];
// ইউজারের বর্তমান ব্যালেন্স নিয়ে আসা
$u_res = $conn->query("SELECT wallet_balance FROM users WHERE id = $user_id");
$user_data = $u_res->fetch_assoc();
$user_balance = $user_data['wallet_balance'];

include 'common/header.php';
?>

<div class="w-full h-44 bg-gradient-to-r from-blue-700 via-indigo-800 to-purple-900 rounded-[2.5rem] p-6 mb-8 relative overflow-hidden shadow-[0_20px_50px_rgba(31,38,135,0.3)] border border-white/10">
    <div class="relative z-10">
        <h2 class="text-2xl font-black italic text-white leading-tight">CHAMPIONS<br>ARE BORN HERE!</h2>
        <p class="text-blue-200 text-[10px] mt-2 font-bold tracking-widest uppercase">Win up to ৳৫০০০ Daily</p>
        <div class="mt-4 flex space-x-2">
            <a href="refer.php" class="bg-white text-blue-900 px-4 py-1.5 rounded-full text-[10px] font-black shadow-lg">REFER & EARN</a>
        </div>
    </div>
    <i class="fas fa-trophy absolute -right-4 -bottom-4 text-9xl text-white/10 rotate-12"></i>
</div>

<div class="flex space-x-4 mb-6 overflow-x-auto scrollbar-hide pb-2">
    <button class="bg-blue-600 px-6 py-2 rounded-2xl text-xs font-bold shadow-lg shadow-blue-600/20">All Games</button>
    <button class="bg-slate-900 border border-slate-800 px-6 py-2 rounded-2xl text-xs font-bold text-gray-400">Free Fire</button>
    <button class="bg-slate-900 border border-slate-800 px-6 py-2 rounded-2xl text-xs font-bold text-gray-400">PUBG</button>
</div>

<div class="flex justify-between items-center mb-6">
    <h3 class="font-black italic text-lg tracking-wide uppercase">Upcoming Matches</h3>
    <div class="h-1 flex-1 bg-slate-800 mx-4 rounded-full"></div>
</div>

<?php
$res = $conn->query("SELECT * FROM tournaments WHERE status = 'Upcoming' ORDER BY id DESC");
if($res->num_rows > 0):
    while($row = $res->fetch_assoc()):
?>
<div class="bg-slate-900/50 backdrop-blur-md rounded-[2.5rem] border border-slate-800 p-2 mb-8 shadow-2xl group transition-all active:scale-[0.98]">
    <div class="relative">
        <img src="https://img.freepik.com/premium-photo/gaming-background-concept_705424-406.jpg" class="w-full h-48 rounded-[2.2rem] object-cover opacity-80 group-hover:opacity-100 transition-all">
        
        <div class="absolute bottom-4 right-4 bg-blue-600 px-5 py-2 rounded-2xl font-black italic shadow-xl border border-white/20">
            ৳<?php echo number_format($row['entry_fee'], 0); ?>
        </div>
        
        <div class="absolute top-4 left-4 bg-red-600/80 backdrop-blur-md px-3 py-1 rounded-full text-[10px] font-black flex items-center">
            <span class="w-2 h-2 bg-white rounded-full mr-2 animate-pulse"></span> REGISTRATION OPEN
        </div>
    </div>

    <div class="p-5">
        <h4 class="text-xl font-black italic mb-4 text-white uppercase tracking-tight"><?php echo $row['title']; ?></h4>
        
        <div class="grid grid-cols-3 gap-0 border border-slate-800 rounded-2xl mb-6 overflow-hidden">
            <div class="bg-slate-800/30 p-3 text-center">
                <p class="text-[9px] text-gray-500 uppercase font-bold">Prize Pool</p>
                <p class="text-green-400 font-black italic">৳<?php echo $row['prize_pool']; ?></p>
            </div>
            <div class="bg-slate-800/50 p-3 text-center border-x border-slate-700">
                <p class="text-[9px] text-gray-500 uppercase font-bold">Per Kill</p>
                <p class="text-white font-black italic">৳<?php echo $row['per_kill']; ?></p>
            </div>
            <div class="bg-slate-800/30 p-3 text-center">
                <p class="text-[9px] text-gray-500 uppercase font-bold">Match Time</p>
                <p class="text-blue-400 font-black italic"><?php echo date('h:i A', strtotime($row['match_time'])); ?></p>
            </div>
        </div>

        <a href="match_details.php?id=<?php echo $row['id']; ?>" class="block w-full text-center bg-gradient-to-r from-blue-600 to-indigo-700 py-4 rounded-[1.5rem] font-black italic tracking-widest shadow-lg shadow-blue-600/20">
            JOIN TOURNAMENT
        </a>
    </div>
</div>
<?php endwhile; else: ?>
    <div class="text-center py-20">
        <i class="fas fa-ghost text-5xl text-slate-800 mb-4"></i>
        <p class="text-gray-600 italic">এখনো কোনো ম্যাচ নেই। অপেক্ষা করুন!</p>
    </div>
<?php endif; ?>
<style> .scrollbar-hide::-webkit-scrollbar { display: none; } .scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; } </style> 📁 ah_tournament (Root)

┣ 📁 assets (এখানে ছবি থাকবে)
┃ ┗ 📜 game_banner.jpg
┣ 📁 common (কমন ফাইলসমূহ)
┃ ┣ 📜 config.php
┃ ┣ 📜 header.php
┃ ┗ 📜 bottom.php
┣ 📁 admin (অ্যাডমিন প্যানেল)
┃ ┣ 📜 login.php
┃ ┣ 📜 index.php
┃ ┣ 📜 manage_tournament.php
┃ ┗ 📜 deposits.php
┣ 📜 install.php (ডাটাবেস তৈরির জন্য)
┣ 📜 login.php (ইউজার লগইন/সাইনআপ)
┣ 📜 index.php (টুর্নামেন্ট লিস্ট)
┣ 📜 wallet.php (টাকা ডিপোজিট/উইথড্র)
┣ 📜 process_deposit.php (পেমেন্ট প্রসেসিং)
┣ 📜 refer.php (রেফার সিস্টেম)
┣ 📜 profile.php (ইউজার প্রোফাইল)
┣ 📜 match_details.php (রুম আইডি ও পাসওয়ার্ড)
┣ 📜 join_logic.php (জয়েনিং লজিক)
┗ 📜 logout.php (লগআউট)

<a href="index.php" class="flex flex-col items-center group">
    <div class="w-12 h-12 rounded-2xl flex items-center justify-center transition-all <?php echo basename($_SERVER['PHP_SELF']) == 'index.php' ? 'bg-blue-600 shadow-lg shadow-blue-600/40 text-white' : 'text-gray-500'; ?>">
        <i class="fas fa-home text-lg"></i>
    </div>
    <span class="text-[10px] font-bold mt-1 <?php echo basename($_SERVER['PHP_SELF']) == 'index.php' ? 'text-blue-500' : 'text-gray-500'; ?>">HOME</span>
</a>

<a href="wallet.php" class="flex flex-col items-center group">
    <div class="w-12 h-12 rounded-2xl flex items-center justify-center transition-all <?php echo basename($_SERVER['PHP_SELF']) == 'wallet.php' ? 'bg-blue-600 shadow-lg shadow-blue-600/40 text-white' : 'text-gray-500'; ?>">
        <i class="fas fa-wallet text-lg"></i>
    </div>
    <span class="text-[10px] font-bold mt-1 <?php echo basename($_SERVER['PHP_SELF']) == 'wallet.php' ? 'text-blue-500' : 'text-gray-500'; ?>">WALLET</span>
</a>

<a href="refer.php" class="flex flex-col items-center group">
    <div class="w-12 h-12 rounded-2xl flex items-center justify-center transition-all <?php echo basename($_SERVER['PHP_SELF']) == 'refer.php' ? 'bg-blue-600 shadow-lg shadow-blue-600/40 text-white' : 'text-gray-500'; ?>">
        <i class="fas fa-gift text-lg"></i>
    </div>
    <span class="text-[10px] font-bold mt-1 <?php echo basename($_SERVER['PHP_SELF']) == 'refer.php' ? 'text-blue-500' : 'text-gray-500'; ?>">REFER</span>
</a>

<a href="profile.php" class="flex flex-col items-center group">
    <div class="w-12 h-12 rounded-2xl flex items-center justify-center transition-all <?php echo basename($_SERVER['PHP_SELF']) == 'profile.php' ? 'bg-blue-600 shadow-lg shadow-blue-600/40 text-white' : 'text-gray-500'; ?>">
        <i class="fas fa-user text-lg"></i>
    </div>
    <span class="text-[10px] font-bold mt-1 <?php echo basename($_SERVER['PHP_SELF']) == 'profile.php' ? 'text-blue-500' : 'text-gray-500'; ?>">PROFILE</span>
</a>
<title>AH TOURNAMENT</title> <script src="https://cdn.tailwindcss.com"></script> <style> @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap'); body { font-family: 'Inter', sans-serif; background-color: #0f172a; -webkit-tap-highlight-color: transparent; } .scrollbar-hide::-webkit-scrollbar { display: none; } </style>

AH

Tournament

    <a href="wallet.php" class="bg-slate-900 border border-slate-800 rounded-full pl-3 pr-1 py-1 flex items-center space-x-2 active:scale-95 transition-all">
        <span class="text-[10px] font-bold text-gray-400">Balance:</span>
        <span class="text-xs font-black text-green-400">৳<?php echo number_format($user_balance, 0); ?></span>
        <div class="bg-blue-600 w-6 h-6 rounded-full flex items-center justify-center">
            <i class="fas fa-plus text-[10px] text-white"></i>
        </div>
    </a>
</div>
$user_id = $_SESSION['user_id'];
$msg = "";

// নাম আপডেট লজিক
if(isset($_POST['update_profile'])) {
$new_name = mysqli_real_escape_string($conn, $_POST['username']);
$conn->query("UPDATE users SET username = '$new_name' WHERE id = $user_id");
$msg = "Profile updated successfully!";
}

// পাসওয়ার্ড আপডেট লজিক
if(isset($_POST['update_pass'])) {
$new_pass = password_hash($_POST['new_password'], PASSWORD_DEFAULT);
$conn->query("UPDATE users SET password = '$new_pass' WHERE id = $user_id");
$msg = "Password changed successfully!";
}

$user = $conn->query("SELECT * FROM users WHERE id = $user_id")->fetch_assoc();
include 'common/header.php';
?>

Account Settings

<?php if($msg): ?>
    <div class="bg-green-500/10 border border-green-500/20 text-green-400 p-4 rounded-2xl mb-6 text-sm font-bold text-center">
        <?php echo $msg; ?>
    </div>
<?php endif; ?>

<div class="bg-slate-900 border border-slate-800 rounded-[2rem] p-6 mb-8 shadow-xl">
    <h3 class="text-gray-500 text-[10px] font-bold uppercase tracking-widest mb-4">Personal Info</h3>
    <form method="POST" class="space-y-4">
        <div>
            <label class="text-xs text-gray-400 ml-1">Full Name</label>
            <input type="text" name="username" value="<?php echo $user['username']; ?>" class="w-full bg-slate-800/50 p-4 rounded-2xl outline-none border border-transparent focus:border-blue-500 transition-all text-sm font-bold">
        </div>
        <div>
            <label class="text-xs text-gray-400 ml-1">Email (Cannot be changed)</label>
            <input type="text" value="<?php echo $user['email']; ?>" class="w-full bg-slate-700/30 p-4 rounded-2xl text-gray-500 text-sm font-bold" disabled>
        </div>
        <button name="update_profile" class="w-full bg-blue-600 py-4 rounded-2xl font-black italic shadow-lg shadow-blue-600/20 active:scale-95 transition-all uppercase text-sm">Save Profile</button>
    </form>
</div>

<div class="bg-slate-900 border border-slate-800 rounded-[2rem] p-6 shadow-xl">
    <h3 class="text-gray-500 text-[10px] font-bold uppercase tracking-widest mb-4">Security</h3>
    <form method="POST" class="space-y-4">
        <div>
            <label class="text-xs text-gray-400 ml-1">New Password</label>
            <input type="password" name="new_password" placeholder="••••••••" class="w-full bg-slate-800/50 p-4 rounded-2xl outline-none border border-transparent focus:border-blue-500 transition-all text-sm font-bold">
        </div>
        <button name="update_pass" class="w-full bg-slate-800 border border-slate-700 py-4 rounded-2xl font-black italic active:scale-95 transition-all uppercase text-sm">Update Password</button>
    </form>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions