<!DOCTYPE html>
<html lang="zxx">

    <head>
        <meta charset="utf-8" />
        <meta http-equiv="x-ua-compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta name="description" content="" />
        <meta name="keyword" content="" />
        <meta name="author" content="flexilecode" />
        <!--! The above 6 meta tags *must* come first in the head; any other head content must come *after* these tags !-->
        <!--! BEGIN: Apps Title-->
        <title>Admin || Dashboard</title>
        <!--! END:  Apps Title-->
        <!--! BEGIN: Favicon-->
        <link rel="shortcut icon" type="image/x-icon" href="<?= base_url(); ?>/assets/images/favicon.ico" />
        <!--! END: Favicon-->
        <!--! BEGIN: Bootstrap CSS-->
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>/assets/css/bootstrap.min.css" />
        <!--! END: Bootstrap CSS-->
        <!--! BEGIN: Vendors CSS-->
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>/assets/vendors/css/vendors.min.css" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>/assets/vendors/css/daterangepicker.min.css" />
        <!--! END: Vendors CSS-->
        <!--! BEGIN: Custom CSS-->
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>/assets/css/theme.min.css" />
        <!--! END: Custom CSS-->
        <!--! HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries !-->
        <!--! WARNING: Respond.js doesn"t work if you view the page via file: !-->
        <!--[if lt IE 9]>
                            <script src="https:oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
                            <script src="https:oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
                    <![endif]-->
    </head>

    <body>
        <?= $this->include('layouts/header') ?>
        <?= $this->include('layouts/sidebar') ?>
        <!--! ================================================================ !-->
        <!--! [Start] Main Content !-->
        <!--! ================================================================ !-->
        <main class="nxl-container">
            <div class="nxl-content">
                <!-- [ page-header ] start -->
                <div class="page-header">
                    <div class="page-header-left d-flex align-items-center">
                        <div class="page-header-title">
                            <h5 class="m-b-10">Dashboard</h5>
                        </div>
                        <ul class="breadcrumb">
                            <li class="breadcrumb-item"><a href="<?= base_url(); ?>dashboard">Home</a></li>
                            <li class="breadcrumb-item">Dashboard</li>
                        </ul>
                    </div>
                    <div class="page-header-right ms-auto">
                        <div class="page-header-right-items">
                            <div class="d-flex d-md-none">
                                <a href="javascript:void(0)" class="page-header-right-close-toggle">
                                    <i class="feather-arrow-left me-2"></i>
                                    <span>Back</span>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- [ page-header ] end -->
                <!-- [ Main Content ] start -->
                <div class="main-content">
                    <div class="row">
                        <!-- [Invoices Awaiting Payment] start -->
                        <div class="col-xxl-3 col-md-6">
                            <div class="card stretch stretch-full">
                                <div class="card-body">
                                    <div class="d-flex align-items-start justify-content-between mb-4">
                                        <div class="d-flex gap-4 align-items-center">
                                            <div class="avatar-text avatar-lg bg-gray-200">
                                                 <i class="feather-users"></i>
                                            </div>
                                            <div>
                                                <div class="fs-4 fw-bold text-dark"><span class="counter"><?= count($agent_list); ?></span></div>
                                                <h3 class="fs-13 fw-semibold text-truncate-1-line">Total Agents</h3>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-xxl-3 col-md-6">
                            <div class="card stretch stretch-full">
                                <div class="card-body">
                                    <div class="d-flex align-items-start justify-content-between mb-4">
                                        <div class="d-flex gap-4 align-items-center">
                                            <div class="avatar-text avatar-lg bg-gray-200">
                                                 <i class="feather-users"></i>
                                            </div>
                                            <div>
                                                <div class="fs-4 fw-bold text-dark"><span class="counter"><?= count($offer); ?></span></div>
                                                <h3 class="fs-13 fw-semibold text-truncate-1-line">Total Offer Letter send</h3>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- [Invoices Awaiting Payment] end -->
                        <!-- [Converted Leads] start -->
                        <!--                        <div class="col-xxl-3 col-md-6">
                                                    <div class="card stretch stretch-full">
                                                        <div class="card-body">
                                                            <div class="d-flex align-items-start justify-content-between mb-4">
                                                                <div class="d-flex gap-4 align-items-center">
                                                                    <div class="avatar-text avatar-lg bg-gray-200">
                                                                        <i class="feather-dollar-sign"></i>
                                                                    </div>
                                                                    <div>
                                                                        <div class="fs-4 fw-bold text-dark"<span class="counter">76</span></div>
                                                                        <h3 class="fs-13 fw-semibold text-truncate-1-line">Today Customers</h3>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                 [Converted Leads] end 
                                                 [Projects In Progress] start 
                                                <div class="col-xxl-3 col-md-6">
                                                    <div class="card stretch stretch-full">
                                                        <div class="card-body">
                                                            <div class="d-flex align-items-start justify-content-between mb-4">
                                                                <div class="d-flex gap-4 align-items-center">
                                                                    <div class="avatar-text avatar-lg bg-gray-200">
                                                                        <i class="feather-dollar-sign"></i>
                                                                    </div>
                                                                    <div>
                                                                        <div class="fs-4 fw-bold text-dark"<span class="counter">76</span></div>
                                                                        <h3 class="fs-13 fw-semibold text-truncate-1-line">Today Customers</h3>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                 [Projects In Progress] end 
                                                 [Conversion Rate] start 
                                                <div class="col-xxl-3 col-md-6">
                                                    <div class="card stretch stretch-full">
                                                        <div class="card-body">
                                                            <div class="d-flex align-items-start justify-content-between mb-4">
                                                                <div class="d-flex gap-4 align-items-center">
                                                                    <div class="avatar-text avatar-lg bg-gray-200">
                                                                        <i class="feather-dollar-sign"></i>
                                                                    </div>
                                                                    <div>
                                                                        <div class="fs-4 fw-bold text-dark"<span class="counter">76</span></div>
                                                                        <h3 class="fs-13 fw-semibold text-truncate-1-line">Today Customers</h3>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>-->
                        <!-- [Conversion Rate] end -->
                        <!-- [Latest Leads] start -->
                        <div class="col-xxl-12">
                            <div class="card stretch stretch-full">
                                <div class="card-header">
                                    <h5 class="card-title">Latest 5 Agent</h5>
                                    <div class="card-header-action">
                                        <div class="card-header-btn">
                                            <div data-bs-toggle="tooltip" title="Delete">
                                                <a href="javascript:void(0);" class="avatar-text avatar-xs bg-danger" data-bs-toggle="remove"> </a>
                                            </div>
                                            <div data-bs-toggle="tooltip" title="Refresh">
                                                <a href="javascript:void(0);" class="avatar-text avatar-xs bg-warning" data-bs-toggle="refresh"> </a>
                                            </div>
                                            <div data-bs-toggle="tooltip" title="Maximize/Minimize">
                                                <a href="javascript:void(0);" class="avatar-text avatar-xs bg-success" data-bs-toggle="expand"> </a>
                                            </div>
                                        </div>
                                        <div class="dropdown">
                                            <a href="javascript:void(0);" class="avatar-text avatar-sm" data-bs-toggle="dropdown" data-bs-offset="25, 25">
                                                <div data-bs-toggle="tooltip" title="Options">
                                                    <i class="feather-more-vertical"></i>
                                                </div>
                                            </a>
                                            <div class="dropdown-menu dropdown-menu-end">
                                                <a href="javascript:void(0);" class="dropdown-item"><i class="feather-at-sign"></i>New</a>
                                                <a href="javascript:void(0);" class="dropdown-item"><i class="feather-calendar"></i>Event</a>
                                                <a href="javascript:void(0);" class="dropdown-item"><i class="feather-bell"></i>Snoozed</a>
                                                <a href="javascript:void(0);" class="dropdown-item"><i class="feather-trash-2"></i>Deleted</a>
                                                <div class="dropdown-divider"></div>
                                                <a href="javascript:void(0);" class="dropdown-item"><i class="feather-settings"></i>Settings</a>
                                                <a href="javascript:void(0);" class="dropdown-item"><i class="feather-life-buoy"></i>Tips & Tricks</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="card-body custom-card-action p-0">
                                    <div class="table-responsive">
                                        <table class="table table-hover mb-0">
                                            <thead>
                                                <tr class="border-b">
                                                    <th scope="row">Name</th>
                                                    <th>Email</th>
                                                    <th>Signup Date</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <?php
                                                if (!empty($agent_list)) :
                                                  $newArray = array_slice($agent_list, 0, 5, true);

                                                  foreach ($newArray as $key => $c) :
                                                    ?>
                                                    <tr class="single-item">
                                                        <td>
                                                            <div>
                                                                <span class="text-truncate-1-line"><?= $c['name']; ?></span>
                                                            </div>
                                                        </td>
                                                        <td><?= $c['email']; ?></td>
                                                        <td><?= date("d/m/Y", strtotime($c['created_at'])) ?></td>
                                                    </tr>

                                                    <?php
                                                  endforeach;

                                                endif;
                                                ?>

                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- [Latest Leads] end -->
                    </div>
                </div>
                <!-- [ Main Content ] end -->
            </div>
            <?= $this->include('layouts/footer') ?>