
<?php $__env->startSection('breadcrumb-first', 'Dasbor'); ?>
<?php $__env->startSection('breadcrumb-second', website_config('main')->website_name); ?>
<?php $__env->startSection('content'); ?>
<?php
if (website_config('template')->number == 'first-template') {
    $card_title_class = 'card-title';
} elseif (website_config('template')->number == 'second-template') {
    $card_title_class = 'header-title';
} elseif (website_config('template')->number == 'third-template') {
    $card_title_class = 'header-title';
} elseif (website_config('template')->number == 'custom-template') {
    $card_title_class = 'header-title';
} else {
    $card_title_class = 'card-title';
}
?>
<?php if(Auth::guard('admin')->check() == true): ?>
<div class="row">
    <div class="col-lg-4">
        <div class="card stats-widget card m-b-30">
            <div class="card-body">
                <div class="float-left">
                    <span class="label label-warning mb-3">Saldo</span>
                    <h5 class=" mt-2">Rp <?php echo e(number_format(\App\Models\User::sum('balance'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\User::count('*'),0,',','.')); ?>)</h5>
                </div>
                <div class="float-right">
                    <div class="avatar-xs">
                        <span class="avatar-title rounded-circle bg-custom">
                            <i class="mdi mdi-account-cash-outline"></i>
                        </span>
                    </div>
                </div>
                <div class="clearfix"></div>
                <p class="mb-1 text-muted text-truncate">Total Saldo Pengguna</p>
            </div>
        </div>
        <p class="">
            <a class="btn btn-custom btn-sm" data-toggle="collapse" href="#user-info" aria-expanded="false" aria-controls="user-info">
                Informasi Pengguna
            </a>
        </p>
        <div class="collapse" id="user-info">
            <div class="card card-body">
                <div class="table-responsive">
                    <table class="table table-bordered">
                        <tr>
                            <th>Aktif</th>
                            <td>Rp <?php echo e(number_format(\App\Models\User::where('status', '1')->sum('balance'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\User::where('status', '1')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                        <tr>
                            <th>Nonaktif</th>
                            <td>Rp <?php echo e(number_format(\App\Models\User::where('status', '0')->sum('balance'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\User::where('status', '0')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-4">
        <div class="card stats-widget card m-b-30">
            <div class="card-body">
                <div class="float-left">
                    <span class="label label-warning mb-3">Pesanan</span>
                    <h5 class=" mt-2">Rp <?php echo e(number_format(\App\Models\Order::sum('price'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Order::count('*'),0,',','.')); ?>)</h5>
                </div>
                <div class="float-right">
                    <div class="avatar-xs">
                        <span class="avatar-title rounded-circle bg-custom">
                            <i class="mdi mdi-cart-outline"></i>
                        </span>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="">
                    <p class="mb-1 text-muted text-truncate">Total Pesanan Pengguna</p>
                </div>
            </div>
        </div>
        <p class="">
            <a class="btn btn-custom btn-sm" data-toggle="collapse" href="#order-info" aria-expanded="false" aria-controls="order-info">
                Informasi Pesanan
            </a>
        </p>
        <div class="collapse" id="order-info">
            <div class="card card-body">
                <div class="table-responsive">
                    <table class="table table-bordered">
                        <tr>
                            <th>Pending</th>
                            <td>Rp <?php echo e(number_format(\App\Models\Order::where('status', 'Pending')->sum('price'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Order::where('status', 'Pending')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                        <tr>
                            <th>Processing</th>
                            <td>Rp <?php echo e(number_format(\App\Models\Order::where('status', 'Processing')->sum('price'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Order::where('status', 'Processing')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                        <tr>
                            <th>Success</th>
                            <td>Rp <?php echo e(number_format(\App\Models\Order::where('status', 'Success')->sum('price'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Order::where('status', 'Success')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                        <tr>
                            <th>Error</th>
                            <td>Rp <?php echo e(number_format(\App\Models\Order::where('status', 'Error')->sum('price'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Order::where('status', 'Error')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                        <tr>
                            <th>Partial</th>
                            <td>Rp <?php echo e(number_format(\App\Models\Order::where('status', 'Partial')->sum('price'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Order::where('status', 'Partial')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-4">
        <div class="card stats-widget card m-b-30">
            <div class="card-body">
                <div class="float-left">
                    <span class="label label-primary mb-3">Deposit</span>
                    <h5 class=" mt-2">Rp <?php echo e(number_format(\App\Models\Deposit::sum('amount'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Deposit::count('*'),0,',','.')); ?>)</h5>
                </div>
                <div class="float-right">
                    <div class="avatar-xs">
                        <span class="avatar-title rounded-circle bg-custom">
                            <i class="mdi mdi-credit-card-outline"></i>
                        </span>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="">
                    <p class="mb-1 text-muted text-truncate">Total Deposit Pengguna</p>
                </div>
            </div>
        </div>
        <p class="">
            <a class="btn btn-custom btn-sm" data-toggle="collapse" href="#deposit-info" aria-expanded="false" aria-controls="deposit-info">
                Informasi Deposit
            </a>
        </p>
        <div class="collapse" id="deposit-info">
            <div class="card card-body">
                <div class="table-responsive">
                    <table class="table table-bordered">
                        <tr>
                            <th>Pending</th>
                            <td>Rp <?php echo e(number_format(\App\Models\Deposit::where('status', 'Pending')->sum('amount'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Deposit::where('status', 'Pending')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                        <tr>
                            <th>Success</th>
                            <td>Rp <?php echo e(number_format(\App\Models\Deposit::where('status', 'Success')->sum('amount'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Deposit::where('status', 'Success')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                        <tr>
                            <th>Canceled</th>
                            <td>Rp <?php echo e(number_format(\App\Models\Deposit::where('status', 'Canceled')->sum('amount'),0,',','.')); ?> (<?php echo e(number_format(\App\Models\Deposit::where('status', 'Canceled')->count('*'),0,',','.')); ?>)</td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="col-lg-12">
        <div class="card m-b-30">
			<div class="card-body">
				<h4 class="header-title">
					<i class="fa fa-chart-area"></i> Grafik Pesanan & Deposit Bulan Ini
				</h4>
                <div id="chart" style="height: 250px;"></div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var chart_data = <?php echo e(Illuminate\Support\Js::from($chart)); ?>;
    $(function() {
        new Morris.Area({
            element: 'chart',
            data: chart_data,
            xkey: 'date',
            ykeys: ['order', 'deposit'],
            labels: ['Pesanan', 'Deposit'],
            lineColors: ['#508aeb', '#fcc24c'],
            gridLineColor: '#eef0f2',
            pointSize:3,
            lineWidth:2,
            resize: true,
            barSizeRatio:.4,
            hideHover:"auto",
            parseTime: false,
        });
    });
</script> 
<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/glor5228/public_html/resources/views/admin/auth/home.blade.php ENDPATH**/ ?>