<?php $__env->startSection('title'); ?>
    VICTORS PREDICT | Admin Home
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <?php
    if(Auth::check()){
        $admin = Auth::user();
    }
    ?>
    <div class="col">
        <!-- top tiles -->
        <div class="row tile_count">
            <div class="col-md-2 col-sm-3 col-xs-6 tile_stats_count">
                <span class="count_top"><i class="fa fa-random"></i> Free Tips</span>
                <div class="count" id="predictHolder"><i class="fa fa-spin fa-spinner"></i></div>
                <?php if($admin->category=='Super' || $admin->category=='Predictor'): ?>
                    <a href="<?php echo e(url('/predictions')); ?>">View/Manage</a>
                <?php endif; ?>
            </div>
            <div class="col-md-2 col-sm-3 col-xs-6 tile_stats_count">
                <span class="count_top"><i class="fa fa-share-alt"></i> VIP Tips</span>
                <div class="count red" id="blogHolder"><i class="fa fa-spin fa-spinner"></i></div>
                <?php if($admin->category=='Super' || $admin->category=='Predictor'): ?>
                    <a href="<?php echo e(route('/VIPpredictions')); ?>">View/Manage</a>
                <?php endif; ?>
            </div>
            <div class="col-md-2 col-sm-3 col-xs-6 tile_stats_count">
                <span class="count_top"><i class="fa fa-calendar-check-o"></i> Testimonials</span>
                <div class="count red" id="testimonialHolder"><i class="fa fa-spin fa-spinner"></i></div>
                <?php if($admin->category=='Super' || $admin->category=='Predictor'): ?>
                    <a href="<?php echo e(url('/testimonials')); ?>">View/Manage</a>
                <?php endif; ?>
            </div>
            <div class="col-md-2 col-sm-3 col-xs-6 tile_stats_count">
                <span class="count_top"><i class="fa fa-users"></i> Members</span>
                <div class="count" id="userHolder"><i class="fa fa-spin fa-spinner"></i></div>
                <?php if($admin->category=='Super' || $admin->category=='General'): ?>
                    <a href="<?php echo e(url('/allmembers')); ?>">View/Manage</a>
                <?php endif; ?>
            </div>
            <div class="col-md-2 col-sm-3 col-xs-6 tile_stats_count">
                <span class="count_top"><i class="fa fa-user-plus"></i> Subscribers</span>
                <div class="count" id="adsHolder"><i class="fa fa-spin fa-spinner"></i></div>
                <?php if($admin->category=='Super' || $admin->category=='General'): ?>
                    <a href="<?php echo e(url('/subscribed')); ?>">View/Manage</a>
                <?php endif; ?>
            </div>

            <div class="col-md-2 col-sm-3 col-xs-6 tile_stats_count">
                <span class="count_top"><i class="fa fa-user-times"></i> Expired Subscribers</span>
                <div class="count" id="leagueHolder"><i class="fa fa-spin fa-spinner"></i></div>
                <?php if($admin->category=='Super' || $admin->category=='General'): ?>
                    <a href="<?php echo e(route('/expired')); ?>">View/Manage</a>
                <?php endif; ?>
            </div>
        </div>
        <!-- /top tiles -->
        <br><br>
        <?php
        $date = new dateTime();
        $d = $date->format('D j F, Y');


        ?>
        <?php
        if(Auth::check()){
            $admin = Auth::user();
        }
        ?>

        <?php if(isset($mail)): ?>
            <script>
                alert(<?php echo e($mail); ?>);
            </script>
        <?php endif; ?>
        <center><h2 style="margin-bottom: -10px;"><?php echo e($d); ?></h2>
            <blockquote><h1>Welcome, <?php echo e($admin->name); ?></h1></blockquote>

            <button class="btn btn-lg btn-danger" style="white-space: normal!important; padding: 40px 30px; border-radius: 100px;" id="refresher">REFRESH <br>SYSTEM</button><br>
            <span id="refreshStatus" class="text-danger"></span>
            <br>
        </center>
        <?php if(isset($success)): ?>
            <script>alert('<?php echo e($success); ?>');</script>
        <?php endif; ?>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('levelJS'); ?>
    <script>
        $(document).ready(function () {
            countPredictions();

            function countPredictions() {
                boilerCounter('predictions', 'predictHolder');
                countTestimonial();
            }

            function countTestimonial() {
                boilerCounter('testimonials', 'testimonialHolder');
                countBlog();
            }

            function countBlog() {
                boilerCounter('blogs', 'blogHolder');
                countAds();
            }

            function countAds() {
                boilerCounter('ads', 'adsHolder');
                countLeague();
            }

            function countLeague() {
                boilerCounter('leagues', 'leagueHolder');
                countMember();
            }

            function countMember() {
                boilerCounter('members', 'userHolder');
            }

            function boilerCounter(key, holder) {
                $.ajax({
                    type: "GET",
                    url: "counter/"+key,
                    success: function (data) {
                        $('#'+holder).html(data);
                    }
                });
            }
        });
    </script>
<?php $__env->stopSection(); ?>



<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>