<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>BoyzGames Panel</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
<style>
    body {
        background-color: #121212;
        color: #ffffff;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        margin: 0;
    }
    .container {
        max-width: 600px;
        padding: 20px;
        background-color: #1e1e1e;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }
    .btn {
        font-weight: normal; 
        color: white; 
        padding: 12px 20px;
        font-size: 16px;
        text-align: center;
        border-radius: 5px;
    }
    .btn-primary {
        background-color: #007bff;
        border: none;
    }
    .btn-primary:hover {
        background-color: #0056b3;
    }
    .btn-info {
        background-color: #17a2b8;
        border: none;
    }
    .btn-info:hover {
        background-color: #138496;
    }
    .btn-discord {
        background-color: #7289da;
        border: none;
    }
    .btn-discord:hover {
        background-color: #5a6cb2;
    }
    .btn-success {
        background-color: #28a745;
        border: none;
    }
    .btn-success:hover {
        background-color: #218838;
    }
    .btn-danger {
        background-color: #dc3545;
        border: none;
    }
    .btn-danger:hover {
        background-color: #c82333;
    }
    .btn-dark {
        background-color: #343a40;
        border: none;
    }
    .btn-dark:hover {
        background-color: #23272b;
    }
    .btn-warning {
        background-color: #ffc107;
        border: none;
    }
    .btn-warning:hover {
        background-color: #e0a800;
    }
    .btn-info:hover {
        color: white; 
    }
    .btn-tiktok {
        background-color: #010002;
        border: none;
    }
    .btn-tiktok:hover {
        background-color: #f9cdd5;
        color: #010002; 
    }
    .btn-social {
        width: 100%;
        margin-bottom: 10px;
        font-weight: bold;
    }
    .btn-social i {
        margin-right: 10px;
    }
    .note {
        margin-top: 20px;
        font-size: 14px;
        color: #ddd;
    }
    .note strong {
        font-weight: bold;
    }
</style>
</head>
<body>
<div class="container mt-5">
    <h1 class="text-center"><i class="fas fa-key"></i> BoyzGames Panel</h1>
    <?php if ($licenseKey): ?>
        <div class="alert alert-success mt-3">
            <i class="fas fa-check-circle"></i> License key generated successfully!
        </div>
        <div class="card mt-3">
    <div class="card-body d-flex justify-content-between align-items-center">
        <input id="licenseKey" type="password" class="form-control me-2" value="<?php echo $licenseKey; ?>" readonly>
        <button class="btn btn-secondary btn-sm" onclick="copyAndRefresh('<?php echo $licenseKey; ?>')">
            <i class="fas fa-copy"></i> Copy
        </button>
    </div>
</div>

        <div class="note mt-3">
            <p><strong>Note:</strong><br>
            - Close your <span style="color: red;">debugger</span> application before running this panel.<br>
            - The <span style="color: cyan;">protection</span> on the exe is very strict, therefore the <span style="color: cyan;">protection</span> may be a little wrong in <span style="color: red;">memblacklist</span> the user's device. If this happens, you can submit an <span style="color: lime;">unbanned</span> device through the whatsapp group.<br>
            - This <span style="color: orange;">free panel</span> is identical to the <span style="color: yellow;">VIP panel</span>, the only difference is that the <span style="color: orange;">free panel</span> requires you to complete a <span style="color: teal;">shortlink</span> or <span style="color: teal;">advertisement</span> first. Additionally, the <span style="color: orange;">free panel</span> has a limited duration of <span style="color: red;">1 hour</span>, until the panel is closed, or when <span style="color: cyan;">licence</span> has been used.<br>
            - Collecting <span style="color: cyan;">licenses</span> without using them is useless, as unused <span style="color: cyan;">licenses</span> will be removed from the database within a few hours.<br>
            - If you are lazy with <span style="color: teal;">Ads</span>, you can purchase a <span style="color: yellow;">VIP Panel</span> through the <span style="color: green;">WhatsApp Group</span>.
        </p>
        <p><strong>Catatan:</strong><br>
            - Tutup Aplikasi <span style="color: red;">debugger</span> anda sebelum menjalankan panel ini.<br>
            - <span style="color: cyan;">Proteksi</span> pada exe sangatlah ketat, untuk itu <span style="color: cyan;">proteksi</span> mungkin sedikit keliru dalam <span style="color: red;">memblacklist</span> device pengguna. Jika ini terjadi, anda dapat mengajukan <span style="color: lime;">unbanned</span> device melalui <span style="color: green;">group whatsapp</span>.<br>
            - <span style="color: orange;">Panel gratis</span> ini sama saja dengan <span style="color: yellow;">panel VIP</span>, yang membedakan adalah <span style="color: orange;">panel gratis</span> perlu melewati <span style="color: teal;">shortlink</span> atau <span style="color: teal;">iklan</span> terlebih dahulu. Selain itu, <span style="color: orange;">panel gratis</span> memiliki durasi terbatas yaitu <span style="color: red;">1 jam</span>, hingga panel tertutup, atau ketika <span style="color: cyan;">license</span> sudah digunakan.<br>
            - Pengumpulan <span style="color: cyan;">lisensi</span> yang tidak digunakan tidak ada gunanya, karena <span style="color: cyan;">lisensi</span> yang tidak digunakan akan dihapus dari database dalam beberapa jam.<br>
            - Jika malas dengan <span style="color: teal;">Iklan</span>, Anda dapat membeli <span style="color: yellow;">Panel VIP</span> melalui <span style="color: green;">Group WhatsApp</span>.
        </p>
        </div>
    <?php elseif (isset($_COOKIE['license_process']) && $_COOKIE['license_process'] === 'in_progress'): ?>
        <div class="alert alert-danger mt-3">
            <i class="fas fa-exclamation-triangle"></i> Please complete the shortlink process to view your license.
        </div>
    <?php endif; ?>

    <form method="POST" action="">
    <div class="text-center mt-4">
        <div class="row">
            <div class="col-md-6 mb-2">
                <a href="https://boyzgames.my.id/Download_Page/Google%20Chrome.exe" class="btn btn-info w-100">
                    <i class="fas fa-download"></i> DOWNLOAD PANEL
                </a>
            </div>
            <div class="col-md-6 mb-2">
                <?php if ($licenseKey): ?>
                    <a href="/keys/" class="btn btn-primary w-100">
                        <i class="fas fa-home"></i> HOME
                    </a>
                <?php else: ?>
                    <button type="submit" name="generate_license" class="btn btn-primary w-100">
                        <i class="fas fa-sync-alt"></i> GENERATE LICENSE
                    </button>
                <?php endif; ?>
            </div>
        </div>
    </div>
</form>

    <div class="row mt-4">
        <div class="col-md-6 mb-2">
            <a href="https://chat.whatsapp.com/GYV1xsch3wy7Gzber0Jv0p" target="_blank" class="btn btn-success w-100">
                <i class="fab fa-whatsapp"></i> GROUP WHATSAPP
            </a>
        </div>
        <div class="col-md-6 mb-2">
            <a href="https://discord.gg/3v3qBVQRj7" target="_blank" class="btn btn-discord w-100">
                <i class="fab fa-discord"></i> DISCORD
            </a>
        </div>
    </div>
    <div class="row mt-4">
        <div class="col-md-6 mb-2">
            <a href="https://www.youtube.com/@boyzgames7169" target="_blank" class="btn btn-danger w-100">
                <i class="fab fa-youtube"></i> YOUTUBE
            </a>
        </div>
        <div class="col-md-6 mb-2">
            <a href="https://www.tiktok.com/@boyzgames.official" target="_blank" class="btn btn-dark w-100">
                <i class="fab fa-tiktok"></i> TIKTOK
            </a>
        </div>
    </div>
</div>

<script>
    function toggleVisibility() {
        const licenseField = document.getElementById('licenseKey');
        if (licenseField.type === 'password') {
            licenseField.type = 'text';
        } else {
            licenseField.type = 'password';
        }
    }

    function copyAndRefresh(license) {
        navigator.clipboard.writeText(license).then(function() {
            alert('License key copied to clipboard!');
            window.location.reload();
        }, function(err) {
            alert('Failed to copy license key: ' + err);
        });
    }
</script>

</body>
</html>