<?php $__env->startPush('styles'); ?>
    <link href="<?php echo e(asset('css/dashboard.css')); ?>" rel="stylesheet">
<?php $__env->stopPush(); ?>



<?php $__env->startSection('content'); ?>
    <div class="dashboard-page">
        <div class="dashboard-grid">
            
            <section class="dashboard-section">
                <?php echo $__env->make('dashboard.new.barchart', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            </section>

            
            <section class="dashboard-section">
                <?php echo $__env->make('dashboard.new.counter', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                <?php echo $__env->make('dashboard.new.resellerCounter', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            </section>

            
            <?php if(auth()->check() && auth()->user()->hasRole('Admin')): ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('dashboardLastPaymentReport')): ?>
                    <section class="dashboard-section">
                        <div id="paymentReport"></div>
                    </section>
                <?php endif; ?>
            <?php endif; ?>

            
            <section class="dashboard-section">
                <?php echo $__env->make('dashboard.new.resellerWiseReport', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            </section>

            <section class="dashboard-section">
                <?php echo $__env->make('dashboard.new.popWiseReport', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            </section>

            
            <section class="dashboard-section">
                <?php echo $__env->make('dashboard.new.resellerRchargeReportNew', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
            </section>

            
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('token-dashboard')): ?>
                <section class="dashboard-section">
                    <div id="tokenSection" class="token-section-placeholder text-center">
                        <h2 class="text-center d-block mb-3">Token Summary</h2>
                        <img src="<?php echo e(asset('/loader.gif')); ?>" width="80" alt="Loading token summary">
                    </div>
                </section>
            <?php endif; ?>
        </div>
    </div>
<?php $__env->stopSection(); ?>




<?php $__env->startSection('ajax'); ?>
    <style>
        .tokenLink {
            cursor: pointer;
        }
    </style>
    <script>
        $(document).ready(function() {

            setTimeout(function() {
                $.ajax({
                    url: "<?php echo e(route('getOnlineUser')); ?>",
                    type: "GET",
                    success: function(data) {
                        // console.log(data);
                        $('#onlineUser').text(data.online);
                    }
                });
            }, 1000);




            setInterval(function() {
                $.ajax({
                    url: "<?php echo e(route('getOnlineUser')); ?>",
                    type: "GET",
                    success: function(data) {
                        $('#onlineUser').text(data.online);
                    }
                });
            }, 30000);


            // get token report after 2 second
            setTimeout(function() {
                $.ajax({
                    url: "<?php echo e(route('getTokenReport')); ?>",
                    type: "GET",
                    success: function(data) {
                        $('#tokenSection').html(data);
                    }
                });
            }, 1000);

            $(document).on('click', '.tokenLink', function() {
                window.location.href = "<?php echo e(route('searchToken')); ?>";
            });
            $(document).on('click', '#tokenSummary', function() {
                window.location.href = "<?php echo e(route('token-report-summary')); ?>";
            });
            setTimeout(function() {
                $.ajax({
                    url: "<?php echo e(route('getPaymentReport')); ?>",
                    type: "GET",
                    success: function(data) {
                        console.log(data);
                        $('#paymentReport').html(data);
                    }
                });
            }, 1000);


        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layout.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/mondol/radius-circle/resources/views/dashboard/new/index.blade.php ENDPATH**/ ?>