<?php
// Users
$users = $db_con->prepare("SELECT * FROM users");
$users->execute();

// Deposits
$deposits = $db_con->prepare("SELECT transaction_id FROM user_transactions WHERE type='Deposit' AND status='Pending'");
$deposits->execute();

// Withdrawal
$withdrawal = $db_con->prepare("SELECT transaction_id FROM user_transactions WHERE type='Withdrawal' AND status='Pending'");
$withdrawal->execute();

// Verifications
$verifications = $db_con->prepare("SELECT id FROM users WHERE status='Pending Verification' AND submitted='Yes'");
$verifications->execute();

// Upgrade Requests
$upreqs = $db_con->prepare("SELECT up_id FROM user_upgrade_plans_feerequest WHERE status='Pending'");
$upreqs->execute();

?>

<div class="iq-sidebar">
    <div class="iq-sidebar-logo d-flex justify-content-between">
        <a href="#" class="header-logo">
            <img src="../img/Transparrant-alert-nation.png" class="img-fluid rounded-normal" alt="">
        </a>
        <div class="iq-menu-bt-sidebar">
            <div class="iq-menu-bt align-self-center">
                <div class="wrapper-menu">
                    <div class="main-circle"><i class="ri-arrow-left-s-line"></i></div>
                    <div class="hover-circle"><i class="ri-arrow-right-s-line"></i></div>
                </div>
            </div>
        </div>
    </div>
    <div id="sidebar-scrollbar">
        <nav class="iq-sidebar-menu">
            <ul id="iq-sidebar-toggle" class="iq-menu">
                <li>
                    <a href="dashboard" class="iq-waves-effect"><i class="las la-home iq-arrow-left"></i><span>Dashboard</span></a>
                </li>
                <li>
                    <a href="updatepas.php" class="iq-waves-effect"><i class="las la-cog iq-arrow-left"></i><span>Update Password</span></a>
                </li>
                <li>
                    <a href="users" class="iq-waves-effect"><i class="las la-user iq-arrow-left"></i><span>Users (<?= $users->rowCount(); ?>)</span></a>
                </li>
                <li>
                    <a href="pending-deposits" class="iq-waves-effect"><i class="las la-archive iq-arrow-left"></i><span>Pending Deposits (<?= $deposits->rowCount(); ?>)</span></a>
                </li>
                <li>
                    <a href="withdrawal-requests" class="iq-waves-effect"><i class="las la-exchange-alt iq-arrow-left"></i><span>Withdrawal Requests (<?= $withdrawal->rowCount(); ?>)</span></a>
                </li>
                <li>
                    <a href="pending-verifications" class="iq-waves-effect"><i class="las la-user-check iq-arrow-left"></i><span>Pending Verifications (<?= $verifications->rowCount(); ?>)</span></a>
                </li>
                <li>
                    <a href="release-funds" class="iq-waves-effect"><i class="las la-hand-holding-usd iq-arrow-left"></i><span>Release Funds<!-- (<?= $users->rowCount(); ?>)--></span></a>
                </li>
                <li>
                    <a href="update-wallet" class="iq-waves-effect"><i class="las la-wallet iq-arrow-left"></i><span>Update Wallet</span></a>
                </li>
                <li>
                    <a href="live-chat-whatsapp" class="iq-waves-effect"><i class="las la-wallet iq-arrow-left"></i><span>live-chat-whatsapp</span></a>
                </li>
                <li>
                    <a href="home-sliders" class="iq-waves-effect"><i class="las la-cog iq-arrow-left"></i><span>Home Sliders</span></a>
                </li>
                <li>
                    <a href="home-testimonials" class="iq-waves-effect"><i class="las la-cog iq-arrow-left"></i><span>Home Testimonials</span></a>
                </li>
                <li>
                    <a href="home-packages" class="iq-waves-effect"><i class="las la-cog iq-arrow-left"></i><span>Home Packages</span></a>
                </li>
                <li>
                    <a href="about-professionals" class="iq-waves-effect"><i class="las la-cog iq-arrow-left"></i><span>About Professionals</span></a>
                </li>
                <li>
                    <a href="faqs" class="iq-waves-effect"><i class="las la-cog iq-arrow-left"></i><span>FAQs</span></a>
                </li>
                <li>
                    <a href="upgrade-plans" class="iq-waves-effect"><i class="las la-level-up-alt iq-arrow-left"></i><span>Upgrade Plans</span></a>
                </li>
                <li>
                    <a href="upgrade-requests" class="iq-waves-effect"><i class="las la-exchange-alt iq-arrow-left"></i><span>Upgrade Requests (<?= $upreqs->rowCount(); ?>)</span></a>
                </li> 
                <li>
                    <a href="recover" class="iq-waves-effect"><i class="las la-exchange-alt iq-arrow-left"></i><span>recover deleted account</span></a>
                </li>
                <li>
                    <a href="tax" class="iq-waves-effect"><i class="las la-exchange-alt iq-arrow-left"></i><span>generate tax code</span></a>
                </li>
                <br>
        <br>
        <br>
        <br>
        <br>
        <br><br>
        <br>
        <br>
            </ul>
        </nav>
       
    </div>
</div>
<!-- TOP Nav Bar -->
<div class="iq-top-navbar">
    <div class="iq-navbar-custom">
        <nav class="navbar navbar-expand-lg navbar-light p-0">
            <div class="iq-menu-bt d-flex align-items-center">
                <div class="wrapper-menu">
                    <div class="main-circle"><i class="ri-arrow-left-s-line"></i></div>
                    <div class="hover-circle"><i class="ri-arrow-right-s-line"></i></div>
                </div>
                <div class="iq-navbar-logo d-flex justify-content-between">
                    <a href="#" class="header-logo">
                        <img src="../img/Signals-Alert-3.png" class="img-fluid rounded-normal" alt="">
                    </a>
                </div>
            </div>
            <div class="navbar-breadcrumb">
                <h4 class="mb-0 text-dark" style="font-family: 'Roboto'!important;">Dashboard</h4>
                <p class="mb-0"><span class="text-danger">Hi there,</span> Great to see you again</p>
            </div>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-label="Toggle navigation">
                <i class="ri-menu-3-line"></i>
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav ml-auto navbar-list">
                    <li class="nav-item nav-icon">
                        <div class="iq-search-bar">
                            <form action="#" class="searchbox">
                                <input type="text" class="text search-input" placeholder="Type here to search...">
                                <a class="search-link" href="#"><i class="ri-search-line"></i></a>
                            </form>
                        </div>
                    </li>
                    <li class="nav-item nav-icon">
                        <a href="#" class="search-toggle iq-waves-effect text-primary rounded">
                            <i class="ri-notification-line block"></i>
                            <span class="bg-danger dots"></span>
                        </a>
                        <div class="iq-sub-dropdown">
                            <div class="iq-card shadow-none m-0">
                                <div class="iq-card-body p-0">
                                    <div class="bg-primary p-3">
                                        <h5 class="mb-0 text-white">All Notifications<small class="badge  badge-light float-right pt-1">4</small></h5>
                                    </div>
                                    <a href="#" class="iq-sub-card">
                                        <div class="media align-items-center">
                                            <div class="">
                                                <img class="avatar-40 rounded" src="images/user/01.jpg" alt="">
                                            </div>
                                            <div class="media-body ml-3">
                                                <h6 class="mb-0 ">Emma Watson Barry</h6>
                                                <small class="float-right">Just Now</small>
                                                <p class="mb-0">95 MB</p>
                                            </div>
                                        </div>
                                    </a>
                                    <a href="#" class="iq-sub-card">
                                        <div class="media align-items-center">
                                            <div class="">
                                                <img class="avatar-40 rounded" src="images/user/02.jpg" alt="">
                                            </div>
                                            <div class="media-body ml-3">
                                                <h6 class="mb-0 ">New customer is join</h6>
                                                <small class="float-right">5 days ago</small>
                                                <p class="mb-0">Cyst Barry</p>
                                            </div>
                                        </div>
                                    </a>
                                    <a href="#" class="iq-sub-card">
                                        <div class="media align-items-center">
                                            <div class="">
                                                <img class="avatar-40 rounded" src="images/user/03.jpg" alt="">
                                            </div>
                                            <div class="media-body ml-3">
                                                <h6 class="mb-0 ">Two customer is left</h6>
                                                <small class="float-right">2 days ago</small>
                                                <p class="mb-0">Cyst Barry</p>
                                            </div>
                                        </div>
                                    </a>
                                    <a href="#" class="iq-sub-card">
                                        <div class="media align-items-center">
                                            <div class="">
                                                <img class="avatar-40 rounded" src="images/user/04.jpg" alt="">
                                            </div>
                                            <div class="media-body ml-3">
                                                <h6 class="mb-0 ">New Mail from Fenny</h6>
                                                <small class="float-right">3 days ago</small>
                                                <p class="mb-0">Cyst Barry</p>
                                            </div>
                                        </div>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
            <ul class="navbar-list">
                <li class="line-height">
                    <a href="#" class="search-toggle iq-waves-effect d-flex align-items-center">
                        <img src="images/user/user.png" class="img-fluid rounded-circle" alt="user">
                    </a>
                    <div class="iq-sub-dropdown iq-user-dropdown">
                        <div class="iq-card shadow-none m-0">
                            <div class="iq-card-body p-0 ">
                                <div class="bg-primary p-3">
                                    <h5 class="mb-0 text-white line-height">Hello Barry Tech</h5>
                                    <span class="text-white font-size-12">Available</span>
                                </div>
                                <a href="profile.html" class="iq-sub-card iq-bg-primary-hover">
                                    <div class="media align-items-center">
                                        <div class="rounded iq-card-icon iq-bg-primary">
                                            <i class="ri-file-user-line"></i>
                                        </div>
                                        <div class="media-body ml-3">
                                            <h6 class="mb-0 ">My Profile</h6>
                                            <p class="mb-0 font-size-12">View personal profile details.</p>
                                        </div>
                                    </div>
                                </a>
                                <a href="profile-edit.html" class="iq-sub-card iq-bg-primary-hover">
                                    <div class="media align-items-center">
                                        <div class="rounded iq-card-icon iq-bg-primary">
                                            <i class="ri-profile-line"></i>
                                        </div>
                                        <div class="media-body ml-3">
                                            <h6 class="mb-0 ">Edit Profile</h6>
                                            <p class="mb-0 font-size-12">Modify your personal details.</p>
                                        </div>
                                    </div>
                                </a>
                                <a href="account-setting.html" class="iq-sub-card iq-bg-primary-hover">
                                    <div class="media align-items-center">
                                        <div class="rounded iq-card-icon iq-bg-primary">
                                            <i class="ri-account-box-line"></i>
                                        </div>
                                        <div class="media-body ml-3">
                                            <h6 class="mb-0 ">Account settings</h6>
                                            <p class="mb-0 font-size-12">Manage your account parameters.</p>
                                        </div>
                                    </div>
                                </a>
                                <a href="privacy-setting.html" class="iq-sub-card iq-bg-primary-hover">
                                    <div class="media align-items-center">
                                        <div class="rounded iq-card-icon iq-bg-primary">
                                            <i class="ri-lock-line"></i>
                                        </div>
                                        <div class="media-body ml-3">
                                            <h6 class="mb-0 ">Privacy Settings</h6>
                                            <p class="mb-0 font-size-12">Control your privacy parameters.</p>
                                        </div>
                                    </div>
                                </a>
                                <div class="d-inline-block w-100 text-center p-3">
                                    <a class="bg-primary iq-sign-btn" href="logout" role="button">Sign Out<i class="ri-login-box-line ml-2"></i></a>
                                </div>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </nav>
    </div>
</div>