@extends('layouts.dashboard')

@section('content')
<div class="content-wrapper">
      <div class="container-full">
        
        <style>
            .box_color1
            {
                background-color: #9b7693;
            }
            .box_color2
            {
                background-color: #68928c;
            }
            .box_color3
            {
                background-color: #5fbc87;
            }
            .box_color4
            {
                background-color: #e76b48;
            }
            .box_color5
            {
                background-color: #007da5;
            }
            .box_color6
            {
                background-color: #ff7096;
            }
        </style>
        
        <?php
            $total_product = \App\Models\Product::get();
            $total_user = \App\Models\User::where('user_type', 'user')->get();
            $total_order = \App\Models\Orders::get();
            
            $total_amount = 0;
            foreach($total_order as $key => $amount)
            {
                $total_amount += $amount->total_original_amount - $amount->total_discount_amount;
            }
        ?>
        <section class="content">
            <div class="row">
                <div class="col-lg-3 col-12">
                    <a class="box box_color6">
                        <div class="box-body">
                            <span class="text-white icon-Equalizer fs-40"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path3"></span></span>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total Product</div>
                            <div class="text-white fs-24 fw-800">{{ count($total_product) }}</div>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-12">
                    <a class="box box_color1">
                        <div class="box-body">
                            <span class="text-white icon-User fs-40"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path3"></span></span>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total User</div>
                            <div class="text-white fs-24 fw-800">{{ count($total_user) }}</div>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-12">
                    <a class="box box_color2">
                        <div class="box-body">
                            <span class="text-white icon-File fs-40"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total Sale</div>
                            <div class="text-white fs-24 fw-800">{{ count($total_order) }}</div>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-12">
                    <a class="box box_color3">
                        <div class="box-body">
                            <span class="text-white mdi mdi-ticket-confirmation fs-30"><span class="path1"></span><span class="path2"></span></span>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total Amount</div>
                            <div class="text-white fs-24 fw-800">{{ number_format($total_amount, 2) }}</div>
                        </div>
                    </a>
                </div>
            </div>

            <hr>
            {{-- <div class="row">
                <div class="col-lg-3 col-12">
                    <a href="#" class="box box_color5">
                        <div class="box-body">
                            <span class="text-white icon-Smile fs-40"><span class="path1"></span><span class="path2"></span></span>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total Progress Task</div>
                            <div class="text-white fs-24 fw-800">{{ count($progress) }}</div>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-12">
                    <a href="#" class="box bg-danger bg-hover-danger">
                        <div class="box-body">
                            <i class="icon-File" style="font-size: 40px;color: #fff;"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path3"></span></i>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total Over Due Task</div>
                            <div class="text-white fs-24 fw-800">{{ count($over_due) }}</div>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-12">
                    <a href="#" class="box bg-info bg-hover-info">
                        <div class="box-body">
                            <span class="text-white icon-Chart-line fs-40"><span class="path1"></span><span class="path2"></span></span>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total Staff Completed</div>
                            <div class="text-white fs-24 fw-800">{{ count($staff_com) }}</div>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-12">
                    <a href="#" class="box bg-warning bg-hover-warning">
                        <div class="box-body">
                            <span class="text-white icon-Money fs-40"><span class="path1"></span><span class="path2"></span></span>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total Closed Task</div>
                            <div class="text-white fs-24 fw-800">{{ count($completed) }}</div>
                        </div>
                    </a>
                </div>
                <div class="col-lg-3 col-12">
                    <a href="#" class="box box_color4">
                        <div class="box-body">
                            <span class="text-white icon-Attachment1 fs-40"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span></span>
                            <div class="text-white fw-600 fs-18 mb-2 mt-5">Total Rejected Task</div>
                            <div class="text-white fs-24 fw-800">{{ count($rejected) }}</div>
                        </div>
                    </a>
                </div>
                
            </div> --}}
            
        </section>
        <!-- /.content -->
      </div>
</div>
@endsection
