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



<?php $__env->startSection('content'); ?>
    
    
    <?php echo $__env->make('dashboard.new.barchart', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php echo $__env->make('dashboard.new.counter', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php if(auth()->check() && auth()->user()->hasRole('Admin')): ?>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('dashboardLastPaymentReport')): ?>
            <div id="paymentReport">

            </div>
        <?php endif; ?>
    <?php endif; ?>

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

    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('token-dashboard')): ?>
        <div id="tokenSection" class="col-md-12 text-center bg-white mb-2">
            <h2 class="text-center d-block mt-5">Token Summary</h2>
            <img src="<?php echo e(asset('/loader.gif')); ?>" width="100" alt="">
        </div>
    <?php endif; ?>
<?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/banet/radius-circle/resources/views/dashboard/new/index.blade.php ENDPATH**/ ?>