<?php $__env->startPush('title', get_phrase('Dashboard')); ?>
<?php $__env->startPush('meta'); ?><?php $__env->stopPush(); ?>
<?php $__env->startPush('css'); ?>
<?php $__env->stopPush(); ?>
<?php $__env->startSection('content'); ?>
    <div class="ol-card radius-8px">
        <div class="ol-card-body my-3 py-4 px-20px">
            <div class="d-flex align-items-center justify-content-between gap-3 flex-wrap flex-md-nowrap">
                <h4 class="title fs-16px">
                    <i class="fi-rr-settings-sliders me-2"></i>
                    <?php echo e(get_phrase('Dashboard')); ?>

                </h4>
            </div>
        </div>
    </div>

    <div class="row g-2 g-sm-3 my-3 row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-5">
        <div class="col">
            <div class="ol-card card-hover bg-blue-1">
                <div class="ol-card-body px-20px py-3">
                    <p class="title card-title-hover fs-18px my-2"><?php echo e(App\Models\Course::count()); ?></p>
                    <p class="sub-title fs-14px"><?php echo e(get_phrase('Number of Courses')); ?></p>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="ol-card card-hover bg-blue-2">
                <div class="ol-card-body px-20px py-3">
                    <p class="title card-title-hover fs-18px my-2"><?php echo e(App\Models\Lesson::count()); ?></p>
                    <p class="sub-title fs-14px"><?php echo e(get_phrase('Number of Lessons')); ?></p>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="ol-card card-hover bg-blue-3">
                <div class="ol-card-body px-20px py-3">
                    <p class="title card-title-hover fs-18px my-2"><?php echo e(App\Models\Enrollment::count()); ?></p>
                    <p class="sub-title fs-14px"><?php echo e(get_phrase('Number of Enrollment')); ?></p>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="ol-card card-hover bg-blue-4">
                <div class="ol-card-body px-20px py-3">
                    <p class="title card-title-hover fs-18px my-2"><?php echo e(App\Models\User::where('role', 'student')->count()); ?></p>
                    <p class="sub-title fs-14px"><?php echo e(get_phrase('Number of Students')); ?></p>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="ol-card card-hover bg-blue-5">
                <div class="ol-card-body px-20px py-3">
                    <p class="title card-title-hover fs-18px my-2"><?php echo e(App\Models\User::where('role', 'instructor')->count()); ?></p>
                    <p class="sub-title fs-14px"><?php echo e(get_phrase('Number of Instructor')); ?></p>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-xl-12">
            <div class="ol-card p-3">
                <div class="row">
                    <div class="col-md-6">
                        <h2 class="title fs-14px"><?php echo e(get_phrase('Admin Revenue This Year')); ?></h2>
                    </div>
                    <div class="col-md-6 text-end">
                        <a class="btn-link" href="<?php echo e(route('admin.revenue')); ?>" data-bs-toggle="tooltip"
                        data-bs-placement="bottom" title="<?php echo e(get_phrase('Admin Revenue')); ?>"><i class="fi-rr-arrow-alt-right"></i></a>
                    </div>
                </div>
                <div class="ol-card-body">
                    <canvas id="myChart" class="mw-100 w-100" height="320px"></canvas>
                </div> <!-- end card body-->
            </div> <!-- end card -->
        </div><!-- end col-->
    </div>


    

    <?php
        $courses = App\Models\Course::get()->groupBy('status');
        $active = isset($courses['active']) ? $courses['active']->count():0;
        $upcoming = isset($courses['upcoming']) ? $courses['upcoming']->count():0;
        $pending = isset($courses['pending']) ? $courses['pending']->count():0;
        $private = isset($courses['private']) ? $courses['private']->count():0;
        $draft = isset($courses['draft']) ? $courses['draft']->count():0;
        $inactive = isset($courses['inactive']) ? $courses['inactive']->count():0;

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

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

    
    <script src="<?php echo e(asset('assets/backend/vendors/apexcharts/apexcharts.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/backend/vendors/chart-js/chart.js')); ?>"></script>
    


    <script>
        "use strict";

        const xValues = [0, "January", "February", "March", "April", "May", "June", "July", "August", "September",
            "October", "November", "December"
        ];
        new Chart("myChart", {
            type: "line",
            data: {
                labels: xValues,
                datasets: [{
                    label: "<?php echo e(get_phrase('Admin revenue')); ?>",
                    fill: false,
                    lineTension: 0,
                    backgroundColor: "rgba(0,0,255,1.0)",
                    borderColor: "rgba(0,0,255,0.1)",
                    data: <?php print_r(json_encode($monthly_amount)); ?>
                }]
            },
            options: {
                legend: {
                    display: true
                },
            }
        });


        // Pie Chart 2
        const project_progress2 = document.getElementById('pie2');
        const progressData2 = {
            labels: ['Active', 'Upcoming', 'Pending', 'Private', 'Draft', 'Inactive'],
            data: [<?php echo e($active); ?>, <?php echo e($upcoming); ?>, <?php echo e($pending); ?>, <?php echo e($private); ?>, <?php echo e($draft); ?>, <?php echo e($inactive); ?>],
        };
        var barColors = [
            "#12c093",
            "#1b84ff",
            "#ff2583",
            "#000",
            "#878d97",
            "#dadada",
        ];
        new Chart(project_progress2, {
            type: 'doughnut',
            data: {
                labels: progressData2.labels,
                datasets: [{
                    backgroundColor: barColors,
                    label: ' <?php echo e(get_phrase("Courses")); ?>',
                    data: progressData2.data,
                }, ],
            },
            options: {
                responsive: true,
                borderWidth: 5,
                hoverBorderColor: '#fff',
                plugins: {
                    legend: {
                        display: false,
                    },
                },
            },
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/payraty/lms_main/resources/views/admin/dashboard/index.blade.php ENDPATH**/ ?>