<?php $__env->startSection('content'); ?>

    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />

    <link href="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/dataTables.bootstrap4.css" rel="stylesheet"

        type="text/css" />

    <link href="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/datatables.mark.css" rel="stylesheet"

        type="text/css" />

    <link href="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/buttons.bootstrap4.css" rel="stylesheet"

        type="text/css" />

    <link href="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/responsive.bootstrap4.css" rel="stylesheet"

        type="text/css" />

    <link href="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/select.bootstrap4.css" rel="stylesheet"

        type="text/css" />

    <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />

     

    <!--page-content-wrapper-->

<!-- ============================================================== -->
<!-- Start Page Content here -->
<!-- ============================================================== -->

<div class="content-page">
<div class="content">

<!-- Start Content-->
<div class="container-fluid">

<div class="row">
    <div class="col-12">
        <div class="bg-flower">
            <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/flowers/img-3.png">
        </div>

        <div class="bg-flower-2">
            <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/flowers/img-1.png">
        </div>

        <div class="page-title-box">                                    
            <div class="page-title-right">
                <!--Date Range -->
                        <form class="d-flex">
                            <div id="reportrange" class="form-control" data-toggle="date-picker-range"
                                data-target-display="#selectedValue" data-cancel-class="btn-light">
                                <i class="ri-calendar-2-line"></i>&nbsp;
                                <span id="selectedValue"></span> <i class="ri-arrow-down-s-line"></i>
                                </span>
                            </div>
                            <a href="javascript: void(0);" id="datesb" class="btn btn-primary ms-2">
                                <i class="ri-refresh-line"></i>
                            </a>
                        </form>
            </div>
            <h4 class="page-title">Dashboard</h4>
        </div>
    </div>
</div>

<div class="row">

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="Publisher Earnings">Publisher Earnings</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'> <?php echo e(round($total_publisher_earnings, 2)); ?> $</h3>
                        <p class="mb-0 text-muted">
                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                            <div id="campaign-sent-chart" data-colors="#6da09c"></div>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="Admin Earnings">Admin Earnings</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'> <?php echo e(round($total_admin_earnings, 2)); ?> $</h3>
                        <p class="mb-0 text-muted">
                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                            <div id="new-leads-chart" data-colors="#87bf8a"></div>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="Manager Earnings">Manager Earnings</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'> <?php echo e(round($total_affliate_earning, 2)); ?> $</h3>
                        <p class="mb-0 text-muted">
                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                            <div id="deals-chart" data-colors="#e7607b"></div>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card text-bg-primary border-primary">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-white text-opacity-75 fw-normal mt-0 text-truncate" title="Conversion">Conversion</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'><?php echo e($total_leads); ?></h3>
                        <p class="mb-0 text-muted">
                            <span class="text-white text-opacity-75 me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                            <div id="booked-revenue-chart" data-colors="#d89e70"></div>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->
</div>
<!-- end row -->

<div class="row">

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="Unique Clicks">Unique Clicks</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'> <?php echo e($total_unique_clicks); ?></h3>
                        <p class="mb-0 text-muted">
                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                            <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/admin_dashboard/unique.png" height="80"><span class="align-middle" data-colors="#6da09c"></img>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="Clicks">Clicks</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'><?php echo e($total_clicks); ?></h3>
                        <p class="mb-0 text-muted">
                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                           <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/admin_dashboard/click.png" height="50"><span class="align-middle" data-colors="#6da09c"></img>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="New Publishers">New Publishers</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'><?php echo e($total_pub); ?></h3>
                        <p class="mb-0 text-muted">
                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                            <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/admin_dashboard/new_pub.png" height="50"><span class="align-middle" data-colors="#6da09c"></img>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="New Offers">New Offers</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'><?php echo e($total_offers); ?></h3>
                        <p class="mb-0 text-muted">
                                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                                        </p>
                                    </div>
                                    <div class="col-6">
                                        <div class="text-end">
                                         <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/admin_dashboard/offers.png" height="50"><span class="align-middle" data-colors="#6da09c"></img>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->
</div>
<!-- end row -->

<div class="row">

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="Pending Offer Request">Pending Offer Request</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'> <?php echo e($total_pending_offer_request); ?></h3>
                        <p class="mb-0 text-muted">
                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                           <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/admin_dashboard/pending.png" height="50"><span class="align-middle" data-colors="#6da09c"></img>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="Pending Withdraw">Pending Withdraw</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'><?php echo e(round($total_pending_withdraw, 3)); ?></h3>
                        <p class="mb-0 text-muted">
                           <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                           <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/admin_dashboard/pending_with.png" height="60"><span class="align-middle" data-colors="#6da09c"></img>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="Paid Money">Paid Money</h5>
                        <h3 class="my-1 py-1" data-countup='{"endValue":58.386,"decimalPlaces":2,"suffix":"k"}'> <?php echo e(round($total_paid_amount, 2)); ?> $</h3>
                        <p class="mb-0 text-muted">
                            <span class="text-success me-2"><i class="ri-arrow-up-line"></i> 0.00%</span>
                        </p>
                    </div>
                    <div class="col-6">
                        <div class="text-end">
                            <img src="<?php echo e(config('app.url')); ?>/public/public/assets/assets/images/admin_dashboard/paid.png" height="50"><span class="align-middle" data-colors="#6da09c"></img>
                        </div>
                    </div>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->

    <div class="col-sm-6 col-xxl-3">
        <div class="card">
            <div class="card-body">
                <div class="row align-items-center">
                <?php $count = 0; ?>
            <?php $__currentLoopData = $top_devices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $device): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php $__currentLoopData = $top_browsers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $browser): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="col-6">
                        <h5 class="text-muted fw-normal mt-0 text-truncate" title="New Offers">Devices & Browsers</h5>
                        <h3 class="my-1 py-1" <?php echo e($device->ua_target); ?> (<?php echo e($device->count); ?>) <?php echo e($browser->browser); ?> & (<?php echo e($browser->count); ?>)</h3>
                        
                                    </div>
                                    <div class="col-6">
                                        <div class="text-end">
                                            <div id="booked-revenue-chart" data-colors="#d89e70"></div>
                                            
                        </div>
                    </div>
                    <hr />
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div> <!-- end row-->
            </div> <!-- end card-body -->
        </div> <!-- end card -->
    </div> <!-- end col -->
</div>
<!-- end row -->
<div class="page-content-wrapper">

<div class="page-content">



    <div class="row">

        <div class="col-md-4 col-xl-4 col-md-6 col-xs-12 my-2">

            <div class="card radius-10">

                <div class="card-body">

                    <div class="d-flex align-items-center">

                        <div>

                            <h5 class="font-weight-bold mb-0">Global Top Members</h5>

                        </div>



                    </div>

                    <div class="product-list mt-3">

                        <?php $count = 0; ?>

                        <?php $__currentLoopData = $top_10_members; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                            <?php $count++; ?>

                            <?php if($count < 10): ?>

                                <div class="media  d-flex">

                                    <div class="mt-2">

                                        <img src="<?php echo e($t->photourl); ?>" width="40" height="40"

                                            class="rounded-circle" alt="" />

                                    </div>

                                    <div class="media-body pl-2 m-2 w-100">

                                        <h6 class="mb-1 font-weight-bold"><?php echo e($t->name); ?> <span

                                                class="text-primary float-right font-13 float-end">Rank :

                                                <?php echo e($count); ?></span></h6>

                                        <p class="mb-0 font-13 text-secondary ">Earnings :

                                            $<?php echo e(round($t->earnings, 3)); ?>


                                        </p>

                                    </div>

                                </div>

                                <hr />

                            <?php endif; ?>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>





                    </div>

                </div>

            </div>

        </div>

        <div class="col-md-4 col-xl-4 col-md-6 col-xs-12 my-2">

            <div class="card radius-10">

                <div class="card-body">

                    <div class="d-flex align-items-center">

                        <div>

                        <h5 class="font-weight-bold mb-0">Top Offers</h5>

</div>



</div>

<div class="product-list mt-3">

<?php $count = 0; ?>

<?php $__currentLoopData = $top_10_offers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

    <?php $count++; ?>

    <div class="media align-items-center-2 d-flex ">

        <div class="m-2">

            <img src="<?php echo e(asset('uploads')); ?>/<?php echo e($t->icon_url); ?>"

                width="40" alt="" class="rounded-circle" />

        </div>

        <div class="media-body pl-3 m-2 w-100">

            <h6 class="mb-0 font-weight-bold"><?php echo e($t->offer_name); ?>


                (<?php echo e($count); ?>)

            </h6>

            <p class="mb-0 text-secondary">Leads : <?php echo e($t->leads); ?></p>



        </div>

        <p class="mb-0 text-purple float-end">

            $<?php echo e(round(($t->payout * $site->affliate_manager_salary_percentage) / 100, 3)); ?>


        </p>



    </div>

    <hr />

<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>





                    </div>

                </div>

            </div>

        </div>

        <div class="col-md-4 col-xl-4 col-md-6 col-xs-12 my-2">

            <div class="card radius-10">

                <div class="card-body">

                    <div class="d-flex align-items-center">

                        <div>

                            <h5 class="font-weight-bold mb-0">Global Top Advertisers</h5>

                        </div>



                    </div>

                    <div class="product-list mt-3">

                        <?php $count = 0; ?>

                        <?php $__currentLoopData = $top_10_advertiser; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                            <?php $count++; ?>

                            <?php if($count < 10): ?>

                                <div class="media  d-flex">

                                    <div class="mt-2">

                                        <img src="<?php echo e($t->photourl); ?>" width="40" height="40"

                                            class="rounded-circle" alt="" />

                                    </div>

                                    <div class="media-body pl-2 m-2 w-100">

                                        <h6 class="mb-1 font-weight-bold"><?php echo e($t->advertiser_name); ?>


                                            <span class="text-primary float-right font-13 float-end">Rank :

                                                <?php echo e($count); ?></span>

                                        </h6>

                                        <p class="mb-0 font-13 text-secondary ">Total Leads :

                                            <?php echo e($t->total_leads); ?>


                                        </p>

                                    </div>

                                </div>

                                <hr />

                            <?php endif; ?>

                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    </div>

                </div>

            </div>

        </div>






            <div class="card-body">
                <div class="row">
                    <div class="col-12">
                        <div id="world-map-markers" class="mt-3 mb-3" style="height: 298px">
                        </div>
                    </div>
                </div>
            </div>
        </div> <!-- end card-->
    </div> <!-- end col -->
</div>
<!-- end row -->



                            </div>

                        </div>

                    </div>

                </div>



            </div>





        </div>

    </div>





    <div class="overlay toggle-btn-mobile"></div>

    <a href="javaScript:;" class="back-to-top"><i class='bx bxs-up-arrow-alt'></i></a>





<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>

    <script src="https://code.jquery.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="

        crossorigin="anonymous"></script>

    <script type="text/javascript" src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/jquery.mark.min.js">

    </script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/jquery.dataTables.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/dataTables.bootstrap4.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/dataTables.buttons.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/buttons.bootstrap4.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/dataTables.keyTable.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/dataTables.select.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/buttons.html5.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/buttons.print.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/dataTables.responsive.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/responsive.bootstrap4.min.js"></script>

    <script src="<?php echo e(config('app.url')); ?>/public/public/vendors/datatables/datatables.mark.js"></script>
    



    <script type="text/javascript">

        $(function() {

            <?php if(Session::has('success')): ?>

                Swal.fire({
                    title: '<?php echo e(Session::get('success')); ?>',
                    confirmButtonText: 'Ok'
                })
            <?php endif; ?>
        });
    </script>

    <!-- Include jQuery as mentioned earlier -->

<script>

    // Retrieve the previousDate from localStorage or use the current date as a fallback
    let previousDate = localStorage.getItem('previousDate');

    function sendRequestIfDateChanged() {
        // Get the current date
        const currentDate = new Date().toISOString().split('T')[0];

        console.log(currentDate);

        if (currentDate !== previousDate) {
            $.ajax({
                url: "<?php echo e(route('admin.auto-update-rejection')); ?>",
                method: 'POST',
                data: { currentDate: currentDate },
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                success: function(data) {
                    // Handle the response from the server
                    console.log(data);
                },
                error: function(xhr, status, error) {
                    console.error('Error updating rejection value:', error);
                }
            });

            // Update the previousDate with the new date and store it in localStorage
            previousDate = currentDate;
            localStorage.setItem('previousDate', currentDate);
        }
    }

    // Set an interval to periodically check for date changes (every hour)
    setInterval(sendRequestIfDateChanged, 1000); // 1000 milliseconds = 1 second


</script>
    

<?php $__env->stopSection(); ?>


<?php echo $__env->make('admin.layout.admin-dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/fiverrbdbse/public_html/backend/resources/views/admin/dashboard.blade.php ENDPATH**/ ?>