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

<div class="row">
    <?php for($i = 1; $i < 13 ; $i++): ?>
        <?php if(array_key_exists($i, $monthVisitCounts)): ?>
            <?php continue; ?>
        <?php endif; ?>
        <?php $monthVisitCounts[$i] = 0; ?>
    <?php endfor; ?>

    <?php ksort($monthVisitCounts); ?>



    <?php $__currentLoopData = $monthVisitCounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $month => $count): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <input type="hidden" name="<?php echo e($month); ?>" value="<?php echo e($count); ?>" class="monthVisitCounts">
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
 
<?php if(\Auth::user()->role_id == '1'): ?>
    <!-- ------------ line chart ------------- -->
    <input type="hidden" value="<?php echo e($allVisitorCounts); ?>" class="allVisitorCounts">
    <div class="col-lg-12">
        <h5 class="text-uppercase font-weight-bold">Website Views in this year</h5>
        <canvas class="border-item lineChart" width="400" height="150"></canvas>
    </div>

 <!--  <div class="col-lg-6">
        <div class="new-users border-item">
            <div class="datatitle">
                <h6>The proportion of new users</h6>
                <p>2019-06-13 ~ 2019-06-19 | Last 7 days</p>
            </div>
            <div class="chartjs-wrapper"><iframe class="chartjs-hidden-iframe" tabindex="-1" style="display: block; overflow: hidden; border: 0px; margin: 0px; top: 0px; left: 0px; bottom: 0px; right: 0px; height: 100%; width: 100%; position: absolute; pointer-events: none; z-index: -1;"></iframe>
                <canvas id="chartjs-4" class="chartjs" width="962" height="550" style="display: block; height: 500px; width: 770px;"></canvas>
            </div>
        </div>
    </div>
    -->


    <div class="col-lg-6 mb-3">
        <div class="new-users border-item">
            <div class="datatitle">
                <h6 class="text-uppercase font-weight-bold">Patients</h6>
               
            </div>

            <div class="items">
                <span class="number text-primary">
                   
                    <?php echo e($patients); ?>

                </span>
               
            </div>
        </div>
    </div>
     <div class="col-lg-6 mb-3">
        <div class="new-users border-item">
            <div class="datatitle">
                <h6 class="text-uppercase font-weight-bold">Employee</h6>
               
            </div>

            <div class="items">
                <span class="number text-primary">
                   
                    <?php echo e($members); ?>

                </span>
               
            </div>
        </div>
    </div>
    
     <div class="col-lg-6 mb-3">
        <div class="new-users border-item">
            <div class="datatitle">
                <h6 class="text-uppercase font-weight-bold">Admin</h6>
               
            </div>

            <div class="items">
                <span class="number text-primary">
                   
                    <?php echo e($admins); ?>

                </span>
               
            </div>
        </div>
    </div>
    
    
     <div class="col-lg-6 mb-3">
        <div class="new-users border-item">
            <div class="datatitle">
                <h6 class="text-uppercase font-weight-bold">Doctor</h6>
               
            </div>

            <div class="items">
                <span class="number text-primary">
                   
                    <?php echo e($doctors); ?>

                </span>
               
            </div>
        </div>
    </div>
    
      <div class="col-lg-6 mb-3">
        <div class="new-users border-item">
            <div class="datatitle">
                <h6 class="text-uppercase font-weight-bold">Trainner</h6>
               
            </div>

            <div class="items">
                <span class="number text-primary">
                   
                    <?php echo e($trainners); ?>

                </span>
               
            </div>
        </div>
    </div>
    
      <div class="col-lg-6 mb-3">
        <div class="new-users border-item">
            <div class="datatitle">
                <h6 class="text-uppercase font-weight-bold">Reservation</h6>
               
            </div>

            <div class="items">
                <span class="number text-primary">
                   
                    <?php echo e($reservations); ?>

                </span>
               
            </div>
        </div>
    </div>
       <div class="col-lg-6 mb-3">
        <div class="new-users border-item">
            <div class="datatitle">
                <h6 class="text-uppercase font-weight-bold">Employee Under Trainner</h6>
               
            </div>

            <div class="items">
                <span class="number text-primary">
                   
                    <?php echo e($employeetrain); ?>

                </span>
               
            </div>
        </div>
    </div>
    

<div class="col-lg-12 mb-3" style="margin-top:40px">
     <h5 class="text-uppercase font-weight-bold">Activity</h5>
        <div class="new-users border-item  table-responsive no-padding">
        <table class="table table-bordered table-hover" style="text-align:center">
            <thead>
                
                <th>#</th>
                <th>Branch</th>
                <th>Employees</th>
                <th>Doctors</th>
                <th>Clinics</th>
                <th>Trainners</th>
                <th>Reservations</th>
                <th>Sessions</th>
            </thead>
            
            <tbody>
                <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $keybranch=>$branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($keybranch+1); ?></td>
                    <td><?php echo e($branch->name); ?></td>
                    <td><?php echo e(empolyeebranch($branch->id)); ?></td>
                    <td><?php echo e(doctorbranch($branch->id)); ?></td>
                    <td><?php echo e(trainnerbranch($branch->id)); ?></td>
                    <td><?php echo e(clinicsbranch($branch->id)); ?></td>
                    <td><?php echo e(reservationbranch($branch->id)); ?></td>
                    <td><?php echo e(sessionbranch($branch->id)); ?></td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
               
            </tbody>
        </table>
  
    </div>
    </div>


</div>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('inner_js'); ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>
<script src="<?php echo e(asset('assets/admin/js/lib/Chart.min.js')); ?>"></script>
<script>
    $(document).ready(function () {
        let months = [],
            month_visits = [],
            allVisitorCounts = $('.allVisitorCounts').val(),
            ChartHtml = $('.lineChart').html('2d');

        $('.monthVisitCounts').each(function () {
            months.push($(this).attr('name'));
            month_visits.push($(this).val());
        });

        month_visits.push(allVisitorCounts);

        new Chart(ChartHtml, {
            type: 'line',
            data: {
                labels: months,
                datasets: [{
                    label: ' people',
                    data: month_visits,
                    backgroundColor: [
                        'rgba(255, 99, 132, 0.2)',
                        'rgba(54, 162, 235, 0.2)',
                        'rgba(255, 206, 86, 0.2)',
                        'rgba(75, 192, 192, 0.2)',
                        'rgba(153, 102, 255, 0.2)',
                        'rgba(255, 159, 64, 0.2)'
                    ],
                    borderColor: [
                        'rgba(255, 99, 132, 1)',
                        'rgba(54, 162, 235, 1)',
                        'rgba(255, 206, 86, 1)',
                        'rgba(75, 192, 192, 1)',
                        'rgba(153, 102, 255, 1)',
                        'rgba(255, 159, 64, 1)'
                    ],
                    borderWidth: 1
                }]
            },
            options: {
                scales: {
                    yAxes: [{
                        ticks: {
                            beginAtZero: true
                        }
                    }]
                }
            }
        });
    })
</script>


<script>
    new Chart(document.getElementById("chartjs-4"), {
        "type": "doughnut",
        "data": {
            "labels": ["completed Profiles", "uncompleted Profiles", "waiting Approval"],
            "datasets": [{
                "label": "My First Dataset",
                "data": [180, 90, 120],
                "backgroundColor": ["rgb(33, 255, 13)", "rgb(220, 53, 69)", "rgb(21, 97, 203)"]
            }]
        }
    });
</script>

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

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