@extends('canteen.layouts.container')

@section('content')

    <div class="dashbord_home">
        <div class="row">
            @if($access ?? false)
                <div class="row col-12  mb-5">

                    <div class="col-lg-6">
                        <div class="new-users border-item">
                            <div class="datatitle">
                                <h6 class="text-uppercase font-weight-bold">{{__('dashboard.all_orders')}}</h6>
                            </div>

                            <div class="items">
                                <span class="number text-primary">
                                    {{$allOrdersCounts}}
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="new-users border-item">
                            <div class="datatitle">
                                <h6 class="text-uppercase font-weight-bold">{{__('dashboard.orders_this_year')}} ({{date('Y')}})</h6>
                            </div>

                            <div class="items">
                                <span class="number text-primary">
                                    {{$yearOrders}}
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="new-users border-item">
                            <div class="datatitle">
                                <h6 class="text-uppercase font-weight-bold"> {{__('dashboard.month_orders')}} ({{ __('web.'.date('F')) }}) </h6>
                            </div>

                            <div class="items">
                                <span class="number text-primary">
                                    {{$monthOrders}}
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="new-users border-item">
                            <div class="datatitle">
                                <h6 class="text-uppercase font-weight-bold"> {{__('dashboard.week_orders')}} </h6>
                            </div>

                            <div class="items">
                                <span class="number text-primary">
                                    {{$weekOrders}}
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="new-users border-item">
                            <div class="datatitle">
                                <h6 class="text-uppercase font-weight-bold">{{__('dashboard.day_orders')}} ({{ __('web.'.date('l')) }}) </h6>
                            </div>

                            <div class="items">
                                <span class="number text-primary">
                                    {{!empty($dayOrders) ? $dayOrders : 0}}
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="new-users border-item">
                            <div class="datatitle">
                                <h6 class="text-uppercase font-weight-bold">{{__('dashboard.product_valid')}} </h6>
                            </div>

                            <div class="items">
                                <span class="number text-primary">
                                    {{!empty($products) ? $products : 0}}
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-6">
                        <div class="new-users border-item">
                            <div class="datatitle">
                                <h6 class="text-uppercase font-weight-bold">{{__('dashboard.payment')}} </h6>
                            </div>

                            <div class="items">
                                <span class="number text-primary">
                                    {{!empty($payment) ? $payment : 0}}
                                </span>
                            </div>
                        </div>
                    </div>

                </div>
            @endif

        </div>
    </div>
@endsection

@section('inner_js')

<script>
    const state_route= '{{ route("dashboard.stats") }}'
</script>
<script src="{{asset('assets/admin/js/lib/Chart.min.js')}}"></script>
<script src="{{ asset('assets/admin/js/charts.js') }}"></script>

@endsection
