<?php $__env->startSection('content'); ?>
    <div class="col-md-12 content-header" >
        <h1><i class="fa fa-dashboard"></i> <?php echo e(trans('application.dashboard')); ?></h1>
    </div>
    <section class="content">
        <div class="row">
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <i class="fa fa-file-pdf-o bg-green"></i>
                    <span class="info-box-text"><?php echo e(trans('application.invoices')); ?></span>
                    <span class="info-box-number"><?php echo e($invoices); ?></span>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <i class="fa fa-list-alt bg-yellow"></i>
                    <span class="info-box-text"><?php echo e(trans('application.estimates')); ?></span>
                    <span class="info-box-number"><?php echo e($estimates); ?></span>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <i class="fa fa-usd bg-aqua"></i>
                    <span class="info-box-text"><?php echo e(trans('application.payments')); ?></span>
                    <span class="info-box-number" style="color: #00a65a;"><?php echo e($total_payments); ?></span>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <i class="fa fa-credit-card bg-red"></i>
                    <span class="info-box-text"><?php echo e(trans('application.outstanding_amount')); ?></span>
                    <span class="info-box-number" style="color: #dd4b39;"><?php echo e($total_outstanding); ?></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="panel panel-primary dashboard_stats">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fa fa-usd fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <p class="info-box-number"><?php echo e($invoice_stats['partiallyPaid']); ?></p>
                                <p class="info-box-text"><?php echo e(trans('application.invoices_partially_paid')); ?></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="panel bg-yellow dashboard_stats">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fa fa-money fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <p class="info-box-number"><?php echo e($invoice_stats['unpaid']); ?></p>
                                <p class="info-box-text"><?php echo e(trans('application.unpaid_invoices')); ?></p>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="panel bg-red dashboard_stats">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fa fa-times fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <p class="info-box-number"><?php echo e($invoice_stats['overdue']); ?></p>
                                <p class="info-box-text"><?php echo e(trans('application.invoices_overdue')); ?> </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="panel bg-green dashboard_stats">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-xs-3">
                                <i class="fa fa-check fa-3x"></i>
                            </div>
                            <div class="col-xs-9 text-right">
                                <p class="info-box-number"><?php echo e($invoice_stats['paid']); ?></p>
                                <p class="info-box-text"><?php echo e(trans('application.paid_invoices')); ?></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"> <?php echo e(trans('application.recent_invoices')); ?></h3>
                    </div>
                    <div class="box-body">
                        <table class="table table-bordered table-striped table-hover datatable">
                            <thead>
                            <tr>
                                <th></th>
                                <th><?php echo e(trans('application.invoice_number')); ?></th>
                                <th><?php echo e(trans('application.invoice_status')); ?></th>
                                <th><?php echo e(trans('application.client')); ?></th>
                                <th><?php echo e(trans('application.date')); ?></th>
                                <th><?php echo e(trans('application.due_date')); ?></th>
                                <th><?php echo e(trans('application.amount')); ?></th>
                                <th width="20%"><?php echo e(trans('application.action')); ?> </th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $__currentLoopData = $recentInvoices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $count=>$invoice): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                                <tr>
                                    <td><?php echo e($count+1); ?></td>
                                    <td><a href="<?php echo e(route('cinvoices.show', $invoice->uuid)); ?>"><?php echo e($invoice->number); ?></a></td>
                                    <td><span class="label <?php echo e(statuses()[$invoice->status]['class']); ?>"><?php echo e(ucwords(statuses()[$invoice->status]['label'])); ?></span></td>
                                    <td><?php echo e($invoice->client->name); ?></td>
                                    <td><?php echo e($invoice->invoice_date); ?></td>
                                    <td><?php echo e($invoice->due_date); ?> </td>
                                    <td><?php echo '<span style="display:inline-block">'.$invoice->currency.'</span><span style="display:inline-block"> '.format_amount($invoice->totals['grandTotal']).'</span>'; ?></td>
                                    <td>
                                        <a href="<?php echo e(route('cinvoices.show',$invoice->uuid)); ?>" class="btn btn-xs btn-info"><i class="fa fa-eye"></i> <?php echo e(trans('application.view')); ?></a>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"> <?php echo e(trans('application.recent_estimates')); ?></h3>
                    </div>
                    <div class="box-body">
                        <table class="table table-bordered table-striped table-hover datatable">
                            <thead>
                            <tr>
                                <th></th>
                                <th><?php echo e(trans('application.estimate_number')); ?></th>
                                <th><?php echo e(trans('application.client')); ?></th>
                                <th><?php echo e(trans('application.date')); ?></th>
                                <th><?php echo e(trans('application.amount')); ?></th>
                                <th width="20%"><?php echo e(trans('application.action')); ?> </th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $__currentLoopData = $recentEstimates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $count=>$estimate): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                                <tr>
                                    <td><?php echo e($count+1); ?></td>
                                    <td><a href="<?php echo e(route('cestimates.show', $estimate->uuid)); ?>"><?php echo e($estimate->estimate_no); ?></a></td>
                                    <td><?php echo e($estimate->client->name); ?></td>
                                    <td><?php echo e($estimate->estimate_date); ?></td>
                                    <td><?php echo '<span style="display:inline-block">'.$estimate->currency.'</span><span style="display:inline-block"> '.format_amount($estimate->totals['grandTotal']).'</span>'; ?></td>
                                    <td>
                                        <a href="<?php echo e(route('cestimates.show',$estimate->uuid)); ?>" class="btn btn-xs btn-info"><i class="fa fa-eye"></i> <?php echo e(trans('application.view')); ?> </a>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('clientarea.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>