Current File : /home/tradevaly/new.tradevaly.com.bd/resources/views/backend/pages/dashboard.blade.php
@extends('backend.ayaan.master')

@section('title') Global Business Directory for B2B Marketplace in Bangladesh . @endsection
@section('css')
    <style>
        .statistics .card {
            border: 0;
            box-shadow: 0px 0px 4px 3px #cdcdcd24;
            background: #fff;
            border-radius: 14px;
            overflow: hidden;
        }
        .statistics .box{
            border-radius: 10px;
            padding: 20px;
            padding-bottom: 9px;
            position: relative;
        }
        .statistics .box .icon {
            height: 40px;
            width: 40px;
            border-radius: 50px;
            position: absolute;
            right: 0;
            top: 0;
            margin: 8px 11px;
            text-align: center;
            padding: 10px;
        }
        .box-danger {
            background: #FFF4DE;
        }
        .box-danger .icon{
            background: #FF957B;
            color: #fff;
        }
        .box-success {
            background: #DCFCE7;
        }
        .box-success .icon{
            background: #3DD856;
            color: #fff;
        }
        .box-primary {
            background: #F4E8FF;
        }
        .box-primary .icon{
            background: #BF83FF;
            color: #fff;
        }
        .box-info {
            background: #FFE2E6;
        }
        .box-info .icon{
            background: #FA5A7D;
            color: #fff;
        }

        h3.total {
            color: #121b49;
            font-weight: 700;
        }
        h4.title {
            font-size: 15px;
            font-weight: 400;
        }
        a.btn-view-all {
            font-size: 13px;
            font-weight: 600;
        }
        h4.badge-total {
            background: #f4e8ff;
            padding: 6px 15px;
            border-radius: 50px;
            font-size: 15px;
            color: #495357;
        }
    </style>
@endsection

@section('content')

    @component('components.breadcrumb')
        @slot('li_1') Dashboards @endslot
        @slot('title') Dashboard @endslot
    @endcomponent

    <div class="row">

        <div class="col-xl-12">
            <div class="row">
                <div class="col-xxl-3 col-sm-3">
                    <div class="card bg-primary mini-stats-wid">
                        <a href="{{ route('admin.users.all') }}" class="item-link"></a>
                        <div class="card-body">
                            <div class="media">
									
								<div class="media-body">
                                   <a href="{{ route('admin.users.seller-list') }}">
										<p class="fw-medium text-white">@lang('Total Seller')</p>
										<h4 class="mb-0 text-white">{{ \App\Models\User::where('type', 'seller')->count() }}</h4>
									</a>
								</div>

                                <div class="mini-stat-icon avatar-sm rounded-circle bg-primary align-self-center">
                                    <span class="avatar-title">
                                        <i class="fas fa-users font-size-24"></i>
                                    </span>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="col-xxl-3 col-sm-3">
                    <div class="card bg-success mini-stats-wid">
                        <a href="{{ route('admin.users.active') }}" class="item-link"></a>
                        <div class="card-body">
                            <div class="media">
                                <div class="media-body">
									<a href="{{ route('admin.users.buyer-list') }}">
										<p class="text-white fw-medium">@lang('Total Buyer')</p>
										<h4 class="mb-0 text-white">{{ \App\Models\User::where('type', 'buyer')->count() }}</h4>
									</a>
								</div>

                                <div class="avatar-sm rounded-circle bg-primary align-self-center mini-stat-icon">
                                    <span class="avatar-title rounded-circle bg-success">
                                        <i class="fas fa-user-check font-size-24"></i>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xxl-3 col-sm-3">
                    <div class="card bg-warning mini-stats-wid">
                        <a href="{{ route('admin.users.email.unverified') }}" class="item-link"></a>
                        <div class="card-body">
                            <div class="media">
                                <div class="media-body">
                                    <p class="text-white fw-medium">@lang('Free Package User')</p>
                                    <h4 class="mb-0 text-white">{{ \App\Models\User::where('package_id', 1)->count() }}</h4>
                                </div>

                                <div class="avatar-sm rounded-circle bg-primary align-self-center mini-stat-icon">
                                    <span class="avatar-title rounded-circle bg-warning">
                                        <i class="fas fa-envelope font-size-24"></i>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xxl-3 col-sm-3">
                    <div class="card bg-danger mini-stats-wid">
                        <a href="{{ route('admin.users.mobile.unverified') }}" class="item-link"></a>
                        <div class="card-body">
                            <div class="media">
                                <div class="media-body">
                                    <p class="text-white fw-medium">@lang('Premium Package User')</p>
                                    <h4 class="mb-0 text-white">{{ \App\Models\User::where('package_id', '!=', 1)->count() }}</h4>
                                </div>

                                <div class="avatar-sm rounded-circle bg-primary align-self-center mini-stat-icon">
                                    <span class="avatar-title rounded-circle bg-danger">
                                        <i class="fas fa-comment-slash font-size-24"></i>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- end row -->

        </div>
    </div>
    <!-- end row -->
    <div class="row">
        <div class="col-lg-6 statistics">
            <div class="card">
                <div class="card-header bg-transparent d-flex justify-content-between align-items-center">
                    <h4 class="m-0">Advertiser</h4>
                    <h4 class="m-0 badge-total">Total: {{ $ads }}</h4>
                </div>
                <div class="card-body pt-1">
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="box box-danger">
                                <div class="icon">
                                    <i class="fas fa-chart-bar"></i>
                                </div>
                                <h3 class="total">{{$pending_ads}}</h3>
                                <h4 class="title">Pending Orders</h4>
                                <a class="btn-view-all" href="{{ route('admin.advertiser.pending') }}">Show All</a>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="box box-success">
                                <div class="icon">
                                    <i class="fas fa-chart-bar"></i>
                                </div>
                                <h3 class="total">{{$complete_ads}}</h3>
                                <h4 class="title">Complete Orders</h4>
                                <a class="btn-view-all" href="{{ route('admin.advertiser.index') }}">Show All</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-6 statistics">
            <div class="card">
                <div class="card-header bg-transparent d-flex justify-content-between align-items-center">
                    <h4 class="m-0">Subscribers</h4>
                    <h4 class="m-0 badge-total">Total: {{ $subscribers }}</h4>
                </div>
                <div class="card-body pt-1">
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="box box-info">
                                <div class="icon">
                                    <i class="fas fa-chart-bar"></i>
                                </div>
                                <h3 class="total">{{ $pending_subscribers }}</h3>
                                <h4 class="title">Pending Subscribers</h4>
                                <a class="btn-view-all" href="{{ route('admin.subscriber.pending') }}">Show All</a>
                            </div>
                        </div>
                        <div class="col-lg-6">
                            <div class="box box-primary">
                                <div class="icon">
                                    <i class="fas fa-chart-bar"></i>
                                </div>
                                <h3 class="total">{{ $paid_subscribers }}</h3>
                                <h4 class="title">Paid Subscribers</h4>
                                <a class="btn-view-all" href="{{ route('admin.subscriber.paid') }}">Show All</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-12">
            <div class="row">
                <div class="col-sm-3">
                    <div class="card" style='background:rgba(52,195,143,.25)!important'>
                        <div class="card-body">
                            <div class="d-flex align-items-center mb-3">
                                <div class="avatar-xs me-3">
                                    <span
                                        class="avatar-title rounded-circle bg-success bg-soft text-success font-size-18">
                                        <i class="fas fa-hand-holding-usd"></i>
                                    </span>
                                </div>
                                <h5 class="font-size-14 mb-0">@lang('Pending Payment')</h5>
                            </div>
                            <div class="text-muted mt-4">
                                <h4>{{ \App\Models\Income::where('status', 0)->count() }}</h4>
                                <div class="d-flex">
                                    <a href="{{ route('admin.income.index') }}"
                                       class="btn btn-success waves-effect waves-light btn-sm">@lang('View All')</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-3">
                    <div class="card" style='background:#f1b44c40!important'>
                        <div class="card-body">
                            <div class="d-flex align-items-center mb-3">
                                <div class="avatar-xs me-3">
                                    <span
                                        class="avatar-title rounded-circle bg-warning bg-soft text-warning font-size-18">
                                        <i class="fas fa-spinner"></i>
                                    </span>
                                </div>
                                <h5 class="font-size-14 mb-0">@lang('Products')</h5>
                            </div>
                            <div class="text-muted mt-4">
                                <h4>{{ \App\Models\Product::count() }}</h4>
                                <div class="d-flex">
                                    <a href="{{ route('admin.product_list.product_list') }}"
                                       class="btn btn-warning waves-effect waves-light btn-sm">@lang('View All')</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-3">
                    <div class="card" style='background:rgba(244,106,106,.25)!important'>
                        <div class="card-body">
                            <div class="d-flex align-items-center mb-3">
                                <div class="avatar-xs me-3">
                                    <span
                                        class="avatar-title rounded-circle bg-danger bg-soft text-danger font-size-18">
                                        <i class="fas fa-ban"></i>
                                    </span>
                                </div>
                                <h5 class="font-size-14 mb-0">@lang('Buy Offers')</h5>
                            </div>
                            <div class="text-muted mt-4">
                                <h4>{{ \App\Models\BuyOffer::count() }}</h4>
                                <div class="d-flex">
                                    <a href="{{ route('admin.buy_offer.buy_offer') }}"
                                       class="btn btn-danger waves-effect waves-light btn-sm">@lang('View All')</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-3">
                    <div class="card" style='background:rgba(85,110,230,.25)!important'>
                        <div class="card-body">
                            <div class="d-flex align-items-center mb-3">
                                <div class="avatar-xs me-3">
                                    <span
                                        class="avatar-title rounded-circle bg-primary bg-soft text-danger font-size-18">
                                        <i class="fas fa-percentage"></i>
                                    </span>
                                </div>
                                <h5 class="font-size-14 mb-0">@lang('Packages')</h5>
                            </div>
                            <div class="text-muted mt-4">
                                <h4>{{ \App\Models\Package::count() }}</h4>
                                <div class="d-flex">
                                    <a href="{{ route('admin.package.index') }}"
                                       class="btn btn-primary waves-effect waves-light btn-sm">@lang('View All')</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- end row -->

        </div>
    </div>

    <!-- end row -->

    <div class="row">
        <div class="col-lg-6">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title mb-4">Pending Products</h4>
                    <div class="table-responsive">
                        <table class="table align-middle table-nowrap mb-0">
                            <thead class="table-light">
                            <tr>

                                <th class="align-middle">SN</th>
                                <th class="align-middle">Title</th>
                                <th class="align-middle">Details</th>
                                <th class="align-middle">Company</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach (\App\Models\Product::where('status', 0)->take(8)->get() as $product)
                                <tr>
                                    <td>
                                        {{$loop->iteration}}
                                    </td>
                                    <td><a href="{{route('product.view', $product->slug)}}">{{$product['title']}}</a>
                                    </td>
                                    <td>{{\Illuminate\Support\Str::limit(strip_tags($product['details']), 20, $end='...')}}</td>
                                    <td>{{$product->supplier->name}}</td>
                                </tr>
                            @endforeach

                            </tbody>
                        </table>
                    </div>
                    <!-- end table-responsive -->
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title mb-4">Pending Approval Buy Offer</h4>
                    <div class="table-responsive">
                        <table class="table align-middle table-nowrap mb-0">
                            <thead class="table-light">
                            <tr>

                                <th class="align-middle">SN</th>
                                <th class="align-middle">Title</th>
                                <th class="align-middle">Details</th>
                                <th class="align-middle">Company</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach (\App\Models\BuyOffer::where('status', 0)->take(8)->get() as $product)
                                @if($product->buyer)
                                    <tr>
                                        <td>
                                            {{$loop->iteration}}
                                        </td>
                                        <td><a href="{{route('buy.view', $product->slug)}}">{{$product['title']}}</a>
                                        </td>
                                        <td>{{\Illuminate\Support\Str::limit(strip_tags($product['details']), 20, $end='...')}}</td>
                                        <td>{{$product->buyer->name}}</td>
                                    </tr>
                                @endif
                            @endforeach

                            </tbody>
                        </table>
                    </div>
                    <!-- end table-responsive -->
                </div>
            </div>
        </div>
    </div>
@endsection

@section('script')
    <!-- apexcharts -->
    <script src="{{ asset('/assets/libs/apexcharts/apexcharts.min.js') }}"></script>

    <!-- dashboard init -->
    <script src="{{ asset('/assets/js/pages/dashboard.init.js') }}"></script>
@endsection