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

    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('dashboard')): ?>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['today_expense'])): ?>
            
            <div class="card col-12 containing-card ">
                <div class="card-header ">
                    <h3 class="card-title ">Today Summary</h3>
                </div>
                <div class="card-body">
                    <div class="grid-of-4">
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('today_loan')): ?>
                            <div class="card card-body card-dark">
                                <h6 class="text-white text-uppercase">
                                    <span>Today Loan Collections</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳  <?php echo e(number_format($todayLoanCollection ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?> 
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('today_dps')): ?>
                            <div class="card card-body card-pink">
                                <h6 class="text-white text-uppercase">
                                    <span>Today DPS Collections</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳ <?php echo e(number_format($todayDpsCollection ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>


                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('today_balance')): ?>
                            <div class="card card-body card-success">
                                <h6 class="text-white text-uppercase">
                                    <span>Today Admission Fee</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳  
                                <?php echo e(number_format($todayadFee, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                        <?php
                        $todayTotalCollection = ($todayDpsCollection ?? 0) + ($todayLoanCollection ?? 0) + ($todayadFee ?? 0);
                    ?>
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('today_balance')): ?>
                             <div class="card card-body card-info">
                                <h6 class="text-white text-uppercase">
                                    <span>Today Collection</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white"><?php echo e(number_format($todayTotalCollection, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            
        <?php endif; ?>


        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['monthly_loan','monthly_dps','monthly_Balance'])): ?>
            
            <div class="card containing-card col-12">
                <div class="card-header ">
                    <h3 class="card-title ">Current Month Summary</h3>
                </div>
                <div class="card-body">
                    <div class="grid-of-4">
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('monthly_loan')): ?>
                            <div class="card card-body card-danger">
                                <h6 class="text-white text-uppercase">
                                    <span>Loan Collections in <?php echo e(date('M Y')); ?></span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳
                              <?php echo e(number_format($monthlyLoanCollection ?? 0, 2)); ?>

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

                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('monthly_dps')): ?>
                            <div class="card card-body card-purple">
                                <h6 class="text-white text-uppercase">
                                    <span>DPS Collections in <?php echo e(date('M Y')); ?></span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳
                                  <?php echo e(number_format($monthlyDpsCollection ?? 0, 2)); ?>

                                 </p>
                            </div>
                        <?php endif; ?>
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('monthly_dps')): ?>
                            <div class="card card-body card-purple">
                                <h6 class="text-white text-uppercase">
                                    <span>Admission Fee in <?php echo e(date('M Y')); ?></span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳
                                  <?php echo e(number_format($monthlyadFee ?? 0, 2)); ?>

                                 </p>
                            </div>
                        <?php endif; ?>
                                    
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('monthly_Balance')): ?>
                            <div class="card card-body card-yellow">
                                <h6 class="text-white text-uppercase">
                                    <span>Balance in <?php echo e(date('M Y')); ?></span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳ <?php echo e(number_format($monthlyBalance ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            
        <?php endif; ?>

        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['total_expense','total_income','total_profit','total_user'])): ?>
            
            <div class="card col-12 containing-card ">
                <div class="card-header ">
                    <h3 class="card-title ">Loan Total</h3>
                </div>
                <div class="card-body">
                    <div class="grid-of-4">
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('total_loan_amount')): ?>
                            <div class="card card-body card-cyan">
                                <h6 class="text-white text-uppercase">
                                    <span>Total Loan Amount</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳  <?php echo e(number_format($totalLoanAmount ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>

                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('total_loan_paid')): ?>
                            <div class="card card-body card-dark">
                                <h6 class="text-white text-uppercase">
                                    <span>Total Loan Paid</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳ <?php echo e(number_format($totalLoanPaid ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                        
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('total_loan_due')): ?>
                            <div class="card card-body card-brown">
                                <h6 class="text-white text-uppercase">
                                    <span>Total Loan Due</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳ <?php echo e(number_format($totalLoanDue ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                        
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('total_profit')): ?>
                            <div class="card card-body card-pink">
                                <h6 class="text-white text-uppercase">
                                    <span>Profit</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white"><?php echo e(number_format($totalLoanProfit ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            
        <?php endif; ?>

        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['total_expense','total_income','total_profit','total_user'])): ?>
            
            <div class="card col-12 containing-card ">
                <div class="card-header ">
                    <h3 class="card-title ">DPS Total</h3>
                </div>
                <div class="card-body">
                    <div class="grid-of-4">
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('total_dps_amount')): ?>
                            <div class="card card-body card-info">
                                <h6 class="text-white text-uppercase">
                                    <span>Total DPS Amount</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳  <?php echo e(number_format($totalDpsAmount ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>

                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('total_dps_paid')): ?>
                            <div class="card card-body card-success">
                                <h6 class="text-white text-uppercase">
                                    <span>Total DPS Paid</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳ <?php echo e(number_format($totalDpsPaid ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                        
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('total_dps_due')): ?>
                            <div class="card card-body card-brown">
                                <h6 class="text-white text-uppercase">
                                    <span>Total DPS Due</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white">৳ <?php echo e(number_format($totalDpsDue ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                        
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('total_Balance')): ?>
                            <div class="card card-body card-dark">
                                <h6 class="text-white text-uppercase">
                                    <span>Total Balance</span>
                                </h6>
                                <p class="fs-18 fw-700 text-white"><?php echo e(number_format($totalBalance ?? 0, 2)); ?></p>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            
        <?php endif; ?>


    <?php endif; ?>

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

<?php $__env->startSection('styles'); ?>
    <style>
        .main-content {
            padding-top: 25px;
        }

        @media (min-width: 250px) {
            .grid-of-5 {
                width: 100%;
                display: grid;
                grid-template-columns: repeat(2, minmax(100px, auto));
                grid-column-gap: 1.5%;
            }

            .grid-of-4 {
                width: 100%;
                display: grid;
                grid-template-columns: repeat(2, minmax(100px, auto));
                grid-column-gap: 1.5%;
            }
        }

        @media (min-width: 768px) {
            .grid-of-5 {
                width: 100%;
                display: grid;
                grid-template-columns: repeat(4, minmax(100px, 1fr));
                grid-column-gap: 1.5%;
            }

            .grid-of-4 {
                width: 100%;
                display: grid;
                grid-template-columns: repeat(4, minmax(100px, 1fr));
                grid-column-gap: 1.5%;
            }
        }

        @media (min-width: 992px) {
            .grid-of-5 {
                width: 100%;
                display: grid;
                grid-template-columns: repeat(5, minmax(100px, 1fr));
                grid-column-gap: 1.5%;
            }
        }

        .grid-of-2 {
            width: 100%;
            display: grid;
            grid-template-columns: repeat(2, minmax(100px, 1fr));
            grid-column-gap: 1.5%;
        }

        .grid-of-3 {
            width: 100%;
            display: grid;
            grid-template-columns: repeat(3, minmax(100px, 1fr));
            grid-column-gap: 1.5%;
        }

        .card .card {
            margin-bottom: 10px;
        }

        .containing-card>.card-body {
            padding: 10px;
        }

        .card-header {
            padding: 5px;
        }
    </style>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('scripts'); ?>
    <script>
        localStorage.removeItem('pos-items');
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/demosoftghor/sm.demo.softghor.com/resources/views/dashboard.blade.php ENDPATH**/ ?>