<!DOCTYPE html>
<html lang="vi">
<!--begin::Head-->
<head>
    <?php require $_SERVER['DOCUMENT_ROOT'].'/hethong/head2.php';?>
    <title>Cấp Bậc Khách Hàng | <?=$chinhapi['ten_web'];?></title>
    <?php require $_SERVER['DOCUMENT_ROOT'].'/hethong/nav.php';?>
</head>
<!--end::Head-->

<body id="kt_app_body" data-kt-app-layout="light-sidebar" data-kt-app-header-fixed="true"
    data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="true"
    data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true"
    data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default">
    
    <!--begin::Theme mode setup-->
    <script>var defaultThemeMode = "light"; var themeMode; if (document.documentElement) { if (document.documentElement.hasAttribute("data-bs-theme-mode")) { themeMode = document.documentElement.getAttribute("data-bs-theme-mode"); } else { if (localStorage.getItem("data-bs-theme") !== null) { themeMode = localStorage.getItem("data-bs-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-bs-theme", themeMode); }</script>
    <!--end::Theme mode setup-->

    <!--begin::App-->
    <div class="d-flex flex-column flex-root app-root" id="kt_app_root">
        <!--begin::Page-->
        <div class="app-page flex-column flex-column-fluid" id="kt_app_page">
            
            <!--begin::Wrapper-->
            <div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
                <!--begin::Sidebar-->
                <?php require $_SERVER['DOCUMENT_ROOT'].'/hethong/sider.php';?>
                <!--end::Sidebar-->

                <!--begin::Main-->
                <div class="app-main flex-column flex-row-fluid" id="kt_app_main">
                    <!--begin::Content wrapper-->
                    <div class="d-flex flex-column flex-column-fluid">
                        
                        <!--begin::Toolbar-->
                        <div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
                            <div id="kt_app_toolbar_container" class="app-container container-fluid d-flex flex-stack">
                                <div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
                                    <h1 class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0">Hệ Thống Cấp Bậc</h1>
                                    <ul class="breadcrumb breadcrumb-separatorless fw-semibold fs-7 my-0 pt-1">
                                        <li class="breadcrumb-item text-muted">
                                            <a href="/" class="text-muted text-hover-primary">Trang chủ</a>
                                        </li>
                                        <li class="breadcrumb-item"><span class="bullet bg-gray-400 w-5px h-2px"></span></li>
                                        <li class="breadcrumb-item text-muted">Đặc quyền VIP</li>
                                    </ul>
                                </div>
                                <div class="d-flex align-items-center gap-2 gap-lg-3">
                                    <span class="btn btn-sm fw-bold btn-light-primary px-4 cursor-default">Tích lũy nạp: <?=tien($user['tong_nap']);?>đ</span>
                                </div>
                            </div>
                        </div>
                        <!--end::Toolbar-->

                        <!--begin::Content-->
                        <div id="kt_app_content" class="app-content flex-column-fluid">
                            <div class="app-container container-fluid" id="kt_content_container">
                                
                                <div class="row g-5 g-xl-10" style="font-family: 'Plus Jakarta Sans', sans-serif;">
                                    
                                    <!-- ========================================== -->
                                    <!-- CỘT TRÁI: SIDEBAR THÔNG TIN TÀI KHOẢN      -->
                                    <!-- ========================================== -->
                                    <div class="col-12 col-lg-4 col-xl-3">
                                        <div class="card card-flush shadow-sm rounded-4 border-0 h-100 overflow-hidden">
                                            <!-- Cover Banner -->
                                            <div class="h-125px w-100" style="background: linear-gradient(112.14deg, #E100FF 0%, #7F00FF 100%);"></div>
                                            
                                            <div class="card-body d-flex flex-column pt-0 px-6 pb-6 mt-n12">
                                                <!-- Avatar và danh hiệu -->
                                                <div class="d-flex flex-column align-items-center mb-7">
                                                    <div class="symbol symbol-120px symbol-circle mb-4 position-relative bg-white p-1 shadow-sm">
                                                        <img src="https://i.imgur.com/IXvIW8G.png" alt="Avatar" class="border border-2 border-white" />
                                                        <div class="position-absolute translate-middle bottom-0 start-100 mb-2 bg-success rounded-circle border border-3 border-white h-20px w-20px shadow animate-blink"></div>
                                                    </div>
                                                    
                                                    <div class="text-center">
                                                        <h3 class="text-gray-900 fs-3 fw-boldest d-flex align-items-center justify-content-center gap-1 mb-1">
                                                            <?=$username;?>
                                                            <i class="ki-duotone ki-verify fs-2 text-primary"><span class="path1"></span><span class="path2"></span></i>
                                                        </h3>
                                                        <span class="badge badge-light-primary fw-bold px-3 py-1 mt-2 text-uppercase fs-9 tracking-wider rounded-pill"><?=capbac($user['level']);?></span>
                                                    </div>
                                                </div>

                                                <!-- Menu điều hướng Tab dọc -->
                                                <div class="d-flex flex-column gap-2 flex-grow-1">
                                                    <span class="text-gray-400 fs-9 fw-boldest text-uppercase tracking-widest px-3 mb-1">Cấu hình cá nhân</span>
                                                    
                                                    <a href="/profile" class="btn btn-sm btn-color-gray-600 btn-active-light-primary text-start w-100 py-3 px-4 d-flex align-items-center rounded-3 transition-all">
                                                        <i class="ki-duotone ki-user me-3 fs-3"><span class="path1"></span><span class="path2"></span></i>
                                                        <span class="fw-bold fs-7">Tổng quan hồ sơ</span>
                                                    </a>
                                                    
                                                    <a href="/password" class="btn btn-sm btn-color-gray-600 btn-active-light-primary text-start w-100 py-3 px-4 d-flex align-items-center rounded-3 transition-all">
                                                        <i class="ki-duotone ki-key me-3 fs-3"><span class="path1"></span><span class="path2"></span></i>
                                                        <span class="fw-bold fs-7">Bảo mật mật khẩu</span>
                                                    </a>
                                                    
                                                    <a href="/cap-bac" class="btn btn-sm btn-light-primary text-start w-100 py-3 px-4 d-flex align-items-center active rounded-3 transition-all">
                                                        <i class="ki-duotone ki-medal-star me-3 fs-3"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i>
                                                        <span class="fw-bold fs-7">Cấp bậc & Ưu đãi</span>
                                                    </a>

                                                    <div class="separator separator-dashed border-gray-200 my-4"></div>
                                                    
                                                    <span class="text-gray-400 fs-9 fw-boldest text-uppercase tracking-widest px-3 mb-1">Tiện ích tài chính</span>
                                                    
                                                    <a href="/nap-tien" class="btn btn-sm btn-color-gray-600 btn-active-light-success text-start w-100 py-3 px-4 d-flex align-items-center rounded-3 transition-all">
                                                        <i class="ki-duotone ki-wallet me-3 fs-3 text-success"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i>
                                                        <span class="fw-bold fs-7">Nạp tiền vào ví</span>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- KẾT THÚC CỘT TRÁI -->

                                    <!-- ========================================== -->
                                    <!-- CỘT PHẢI: BẢNG RANK ĐÁ QUÝ ULTRA PREMIUM     -->
                                    <!-- ========================================== -->
                                    <div class="col-12 col-lg-8 col-xl-9">
                                        
                                        <div class="card shadow-sm rounded-4 border-0 mb-5 mb-xl-10">
                                            <div class="card-header align-items-center py-5 px-7 border-0">
                                                <div class="card-title d-flex flex-column">
                                                    <h3 class="fw-boldest text-uppercase tracking-wider fs-5 m-0 text-gray-900">
                                                        <i class="ki-duotone ki-crown text-warning me-2 fs-3"><span class="path1"></span><span class="path2"></span></i>Hệ Thống Phân Cấp Đặc Quyền Thành Viên
                                                    </h3>
                                                    <span class="text-muted fs-8 mt-1">Gia tăng hạn mức tích lũy hoặc đăng ký gói để hưởng chiết khấu giảm giá trọn đời</span>
                                                </div>
                                            </div>
                                            
                                            <div class="card-body p-0">
                                                <div class="table-responsive">
                                                    <table class="table table-flush align-middle gs-7 gy-5 m-0">
                                                        <thead>
                                                            <tr class="fw-boldest text-muted text-uppercase fs-8 tracking-widest bg-light bg-opacity-70 border-bottom border-gray-200">
                                                                <th class="min-w-200px ps-9">Hạng Danh Hiệu</th>
                                                                <th class="min-w-180px">Điều Kiện Đạt Hạng</th>
                                                                <th class="min-w-150px text-center">Ưu Đãi Chiết Khấu</th>
                                                                <th class="min-w-120px text-end pe-9">Trạng Thái</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody>
                                                            <!-- Hạng 1: Thạch Anh -->
                                                            <tr class="border-bottom border-gray-100 <?=$user['level'] == 0 ? 'bg-light bg-opacity-60' : '';?>">
                                                                <td class="ps-9">
                                                                    <div class="d-flex align-items-center">
                                                                        <div class="symbol symbol-40px me-3">
                                                                            <span class="symbol-label bg-light-secondary text-gray-600"><i class="ki-duotone ki-shield-search fs-3"><span class="path1"></span><span class="path2"></span></i></span>
                                                                        </div>
                                                                        <span class="text-gray-800 fw-boldest fs-6">Thạch Anh</span>
                                                                    </div>
                                                                </td>
                                                                <td><span class="text-muted fw-semibold fs-7">Mặc định đăng ký</span></td>
                                                                <td class="text-center"><span class="badge badge-light-secondary text-gray-600 fw-boldest px-3 py-1 rounded-pill">Giá gốc hệ thống</span></td>
                                                                <td class="text-end pe-9">
                                                                    <?= ($user['level'] == 0) ? '<span class="badge badge-light-primary text-primary fw-bold fs-8 px-3 py-1">Đang áp dụng</span>' : '<i class="ki-duotone ki-check-circle fs-3 text-success"><span class="path1"></span><span class="path2"></span></i>'; ?>
                                                                </td>
                                                            </tr>

                                                            <!-- Hạng 2: Đồng -->
                                                            <tr class="border-bottom border-gray-100 <?=$user['level'] == 1 ? 'bg-light bg-opacity-60' : '';?>">
                                                                <td class="ps-9">
                                                                    <div class="d-flex align-items-center">
                                                                        <div class="symbol symbol-40px me-3">
                                                                            <span class="symbol-label" style="background-color: rgba(184, 115, 51, 0.1); color: #B87333;"><i class="ki-duotone ki-medal-star fs-2"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></i></span>
                                                                        </div>
                                                                        <span class="fw-boldest fs-6" style="color: #B87333;">Hạng Đồng (Bronze)</span>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div class="d-flex flex-column">
                                                                        <span class="text-gray-800 fw-bold fs-7">Nạp tích lũy từ</span>
                                                                        <span class="text-muted font-monospace fs-8 mt-0.5">50,000đ</span>
                                                                    </div>
                                                                </td>
                                                                <td class="text-center"><span class="badge fs-7 fw-boldest px-3 py-1 rounded-pill" style="color: #B87333; background-color: rgba(184, 115, 51, 0.1);">- 1% Hóa đơn</span></td>
                                                                <td class="text-end pe-9">
                                                                    <?php if($user['level'] == 1): ?>
                                                                        <span class="badge badge-light-primary text-primary fw-bold fs-8 px-3 py-1">Đang áp dụng</span>
                                                                    <?php else: ?>
                                                                        <?=($user['tong_nap'] >= 50000) ? '<span class="badge badge-light-success text-success fw-bold fs-8">Đã mở khóa</span>' : '<a href="/nap-tien" class="btn btn-xs btn-light fw-bold fs-9 py-1 px-3 rounded-pill">Nạp thêm</a>';?>
                                                                    <?php endif; ?>
                                                                </td>
                                                            </tr>

                                                            <!-- Hạng 3: Bạc -->
                                                            <tr class="border-bottom border-gray-100 <?=$user['level'] == 2 ? 'bg-light bg-opacity-60' : '';?>">
                                                                <td class="ps-9">
                                                                    <div class="d-flex align-items-center">
                                                                        <div class="symbol symbol-40px me-3">
                                                                            <span class="symbol-label" style="background-color: rgba(160, 160, 160, 0.1); color: #7E7E7E;"><i class="ki-duotone ki-brilliant fs-3"><span class="path1"></span><span class="path2"></span></i></span>
                                                                        </div>
                                                                        <span class="text-gray-700 fw-boldest fs-6">Hạng Bạc (Silver)</span>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div class="d-flex flex-column">
                                                                        <span class="text-gray-800 fw-bold fs-7">Nạp tích lũy từ</span>
                                                                        <span class="text-muted font-monospace fs-8 mt-0.5">200,000đ</span>
                                                                    </div>
                                                                </td>
                                                                <td class="text-center"><span class="badge badge-light-secondary text-gray-700 fs-7 fw-boldest px-3 py-1 rounded-pill">- 2% Hóa đơn</span></td>
                                                                <td class="text-end pe-9">
                                                                    <?php if($user['level'] == 2): ?>
                                                                        <span class="badge badge-light-primary text-primary fw-bold fs-8 px-3 py-1">Đang áp dụng</span>
                                                                    <?php else: ?>
                                                                        <?=($user['tong_nap'] >= 200000) ? '<span class="badge badge-light-success text-success fw-bold fs-8">Đã mở khóa</span>' : '<a href="/nap-tien" class="btn btn-xs btn-light fw-bold fs-9 py-1 px-3 rounded-pill">Nạp thêm</a>';?>
                                                                    <?php endif; ?>
                                                                </td>
                                                            </tr>

                                                            <!-- Hạng 4: Vàng -->
                                                            <tr class="border-bottom border-gray-100 <?=$user['level'] == 3 ? 'bg-light-warning bg-opacity-30' : '';?>">
                                                                <td class="ps-9">
                                                                    <div class="d-flex align-items-center">
                                                                        <div class="symbol symbol-40px me-3">
                                                                            <span class="symbol-label bg-light-warning text-warning"><i class="ki-duotone ki-star fs-3"><span class="path1"></span><span class="path2"></span></i></span>
                                                                        </div>
                                                                        <span class="text-warning fw-boldest fs-6">Hạng Vàng (Gold)</span>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div class="d-flex flex-column">
                                                                        <span class="text-gray-800 fw-bold fs-7">Nạp tích lũy từ</span>
                                                                        <span class="text-muted font-monospace fs-8 mt-0.5">500,000đ</span>
                                                                    </div>
                                                                </td>
                                                                <td class="text-center"><span class="badge badge-light-warning text-warning fs-6 fw-boldest px-3 py-1 rounded-pill">- 4% Toàn shop</span></td>
                                                                <td class="text-end pe-9">
                                                                    <?php if($user['level'] == 3): ?>
                                                                        <span class="badge badge-light-primary text-primary fw-bold fs-8 px-3 py-1">Đang áp dụng</span>
                                                                    <?php else: ?>
                                                                        <?=($user['tong_nap'] >= 500000) ? '<span class="badge badge-light-success text-success fw-bold fs-8">Đã mở khóa</span>' : '<a href="/nap-tien" class="btn btn-xs btn-light-warning fw-bold fs-9 py-1 px-3 rounded-pill">Nạp thêm</a>';?>
                                                                    <?php endif; ?>
                                                                </td>
                                                            </tr>

                                                            <!-- Hạng 5: Bạch Kim -->
                                                            <tr class="border-bottom border-gray-100 <?=$user['level'] == 4 ? 'bg-light-primary bg-opacity-40' : '';?>">
                                                                <td class="ps-9">
                                                                    <div class="d-flex align-items-center">
                                                                        <div class="symbol symbol-40px me-3">
                                                                            <span class="symbol-label bg-light-primary text-primary"><i class="ki-duotone ki-award fs-3"><span class="path1"></span><span class="path2"></span><span class="path3"></span></i></span>
                                                                        </div>
                                                                        <span class="text-primary fw-boldest fs-6">Bạch Kim (Platinum)</span>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div class="d-flex flex-column">
                                                                        <span class="text-gray-800 fw-bold fs-7">Nạp tích lũy từ</span>
                                                                        <span class="text-muted font-monospace fs-8 mt-0.5">1,000,000đ</span>
                                                                    </div>
                                                                </td>
                                                                <td class="text-center"><span class="badge badge-light-primary text-primary fs-6 fw-boldest px-3 py-1 rounded-pill">- 6% Toàn shop</span></td>
                                                                <td class="text-end pe-9">
                                                                    <?php if($user['level'] == 4): ?>
                                                                        <span class="badge badge-light-primary text-primary fw-bold fs-8 px-3 py-1">Đang áp dụng</span>
                                                                    <?php else: ?>
                                                                        <?=($user['tong_nap'] >= 1000000) ? '<span class="badge badge-light-success text-success fw-bold fs-8">Đã mở khóa</span>' : '<a href="/nap-tien" class="btn btn-xs btn-light-primary fw-bold fs-9 py-1 px-3 rounded-pill">Nạp thêm</a>';?>
                                                                    <?php endif; ?>
                                                                </td>
                                                            </tr>

                                                            <!-- Hạng 6: Lục Bảo -->
                                                            <tr class="border-bottom border-gray-100 <?=$user['level'] == 5 ? 'bg-light-success bg-opacity-40' : '';?>">
                                                                <td class="ps-9">
                                                                    <div class="d-flex align-items-center">
                                                                        <div class="symbol symbol-40px me-3">
                                                                            <span class="symbol-label bg-light-success text-success"><i class="ki-duotone ki-gem fs-3"><span class="path1"></span><span class="path2"></span></i></span>
                                                                        </div>
                                                                        <div class="d-flex flex-column">
                                                                            <span class="text-success fw-boldest fs-6">Lục Bảo (Emerald)</span>
                                                                            <span class="text-muted fs-9 text-uppercase tracking-wider fw-bold">Gói dịch vụ</span>
                                                                        </div>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div class="d-flex flex-column">
                                                                        <span class="text-gray-800 fw-bold fs-7">Thuê bao duy trì</span>
                                                                        <span class="text-muted font-monospace fs-8 mt-0.5">50,000đ / 30 ngày</span>
                                                                    </div>
                                                                </td>
                                                                <td class="text-center"><span class="badge badge-light-success text-success fs-6 fw-boldest px-3 py-1 rounded-pill">- 8% Toàn shop</span></td>
                                                                <td class="text-end pe-9">
                                                                    <?php if($user['level'] == 5): ?>
                                                                        <span class="badge badge-light-primary text-primary fw-bold fs-8 px-3 py-1">Đang áp dụng</span>
                                                                    <?php else: ?>
                                                                        <button class="btn btn-sm btn-light-success fw-bold py-1 px-4 fs-8 rounded-pill hover-elevate-up" onclick="thueRank('emerald')">Thuê ngay</button>
                                                                    <?php endif; ?>
                                                                </td>
                                                            </tr>

                                                            <!-- Hạng 7: Kim Cương -->
                                                            <tr class="<?=$user['level'] == 6 ? 'bg-light-info bg-opacity-40' : '';?>">
                                                                <td class="ps-9">
                                                                    <div class="d-flex align-items-center">
                                                                        <div class="symbol symbol-40px me-3">
                                                                            <span class="symbol-label bg-light-info text-info"><i class="ki-duotone ki-diamond fs-3"><span class="path1"></span><span class="path2"></span></i></span>
                                                                        </div>
                                                                        <div class="d-flex flex-column">
                                                                            <span class="text-info fw-boldest fs-6">Kim Cương (Diamond)</span>
                                                                            <span class="text-muted fs-9 text-uppercase tracking-wider fw-bold">Đại lý tối cao</span>
                                                                        </div>
                                                                    </div>
                                                                </td>
                                                                <td>
                                                                    <div class="d-flex flex-column">
                                                                        <span class="text-gray-800 fw-bold fs-7">Thuê gói đại lý</span>
                                                                        <span class="text-muted font-monospace fs-8 mt-0.5">150,000đ / 30 ngày</span>
                                                                    </div>
                                                                </td>
                                                                <td class="text-center"><span class="badge badge-light-info text-info fs-6 fw-boldest px-3 py-1 rounded-pill">- 12% Toàn shop</span></td>
                                                                <td class="text-end pe-9">
                                                                    <?php if($user['level'] == 6): ?>
                                                                        <span class="badge badge-light-primary text-primary fw-bold fs-8 px-3 py-1">Đang áp dụng</span>
                                                                    <?php else: ?>
                                                                        <button class="btn btn-sm btn-info text-white fw-bold py-1 px-4 fs-8 rounded-pill hover-elevate-up" onclick="thueRank('diamond')">Kích hoạt</button>
                                                                    <?php endif; ?>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>

                                        <!-- KHỐI CHỨC NĂNG BẢO VỆ TÀI KHOẢN (COMING SOON) -->
                                        <div class="card shadow-sm rounded-4 border-0 position-relative overflow-hidden" style="border: 1px dashed var(--bs-primary-border-subtle) !important;">
                                            <div class="position-absolute w-100 h-100 d-flex flex-column align-items-center justify-content-center" style="background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(4px); z-index: 5; top: 0; start: 0;">
                                                <span class="badge badge-dark text-uppercase tracking-widest px-3 py-2 fs-8 fw-boldest mb-2 shadow-sm">Coming Soon</span>
                                                <p class="text-gray-600 fs-7 fw-bold m-0 px-5 text-center">Hệ thống bảo vệ két sắt số dư nâng cao dành riêng cho cấp bậc cao cấp đang được thiết lập.</p>
                                            </div>

                                            <div class="card-header py-4 px-7 border-0">
                                                <div class="card-title m-0">
                                                    <h3 class="fw-boldest text-uppercase tracking-wider fs-6 m-0 text-gray-400">
                                                        <i class="ki-duotone ki-security-user me-2 fs-4 text-gray-400"><span class="path1"></span><span class="path2"></span></i>Hệ thống bảo an danh hiệu cao cấp
                                                    </h3>
                                                </div>
                                            </div>
                                            <div class="card-body p-7">
                                                <div class="d-flex align-items-center justify-content-between mb-5 opacity-25">
                                                    <div>
                                                        <h4 class="fs-6 fw-bolder mb-1">Xác thực OTP API khi mua tài khoản</h4>
                                                        <span class="text-muted fs-7">Tự động khóa bảo mật khi tài khoản phát hiện IP lạ đăng nhập mua hàng loạt.</span>
                                                    </div>
                                                    <div class="form-check form-switch form-check-custom form-check-solid">
                                                        <input class="form-check-input h-25px w-45px" type="checkbox" disabled />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                    <!-- KẾT THÚC CỘT PHẢI -->

                                </div>
                                
                            </div>
                        </div>
                        <!--end::Content-->
                        
                    </div>
                    <!--end::Content wrapper-->
                    
                    <?php require $_SERVER['DOCUMENT_ROOT'].'/hethong/foot.php';?>
                </div>
            </div>
        </div>
    </div>

    <!-- SCRIPT XỬ LÝ MOCKUP THUÊ RANK -->
    <script>
    function thueRank(type) {
        Swal.fire({
            title: 'Xác nhận kích hoạt hạng danh hiệu?',
            text: "Hệ thống sẽ trừ tiền ví điện tử để cấp thời hạn duy trì Rank này trong 30 ngày!",
            icon: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Đồng ý nâng cấp',
            cancelButtonText: 'Hủy bỏ',
            customClass: {
                confirmButton: "btn btn-primary rounded-pill",
                cancelButton: "btn btn-active-light rounded-pill"
            }
        }).then((result) => {
            if (result.isConfirmed) {
                Swal.fire({
                    title: 'Lỗi số dư!',
                    text: 'Ví tài khoản của bạn không đủ tiền hoặc chức năng đang được đồng bộ cơ sở dữ liệu.',
                    icon: 'error',
                    customClass: {
                        confirmButton: "btn btn-danger rounded-pill"
                    }
                })
            }
        })
    }
    </script>
</body>
</html>
