@extends('admin.layouts.master') @section('title', 'Dashboard') @section('content') @php function daysleft($date){ $datetime1 = new DateTime(date('Y-m-d')); $datetime2 = new DateTime($date); $difference = $datetime1->diff($datetime2); echo $difference->y.' years, ' .$difference->m.' months, ' .$difference->d.' days'; } @endphp
@if(Auth::user()->role==1) Calculate Commission Stock Recalculate @endif @if(Auth::user()->user_type==4)

{{$count_product}}

Product

{{$count_category}}

Category

{{Auth::user()->customer_target}}

Customer Target

{{Auth::user()->sell_target}}

Sell Target
@endif @if(Auth::user()->user_type==1)
@if(Auth::user()->role==7) @else @endif

{{$count_user}}

Users

{{$count_product}}

Product

{{$count_category}}

Category

{{$count_blog}}

Blogs
@if(Auth::user()->role==7)

Recent Active Order

@if(Auth::user()->trade_licence_validupto < date('Y-m-d')) @endif @if(Auth::user()->food_license_validupto < date('Y-m-d')) @endif @if(Auth::user()->rc_validupto < date('Y-m-d')) @endif @if(Auth::user()->dl_validupto < date('Y-m-d')) @endif
1
Trade Licence
{{ Auth::user()->trade_licence_validupto }} Expire
{{ daysleft(Auth::user()->trade_licence_validupto) }}
2
Food License
{{ Auth::user()->food_license_validupto }} Expire
{{ daysleft(Auth::user()->food_license_validupto) }}
3
Vehicle Registration Certificate
{{ Auth::user()->rc_validupto }} Expire
{{ daysleft(Auth::user()->rc_validupto) }}
4
Delivery Boy Driving Licenses
{{ Auth::user()->dl_validupto }} Expire
{{ daysleft(Auth::user()->dl_validupto) }}
@endif
@if(Auth::user()->role<=4)
@endif @endif @if(Auth::user()->user_type==2)

Customer

@php $x=1; @endphp @foreach($customer as $c) @php $x++; @endphp @endforeach
# Customer Name Mobile Number Last Billed Amount Last Billed Date Purchased
(Last 15 days)
Locality Action
{{$x}}
{{$c->name}}
{{$c->phone}} {{ $c->last_purchase_amount }} {{daysleft($c->last_purchase_date)}}
Rs {{$c->limit_price}}
@csrf
@if($c->mapped_to>0) Order Now @else No Retailer @endif
Showing {{ $customer->firstItem() }} to {{ $customer->lastItem() }} of {{ $customer->total() }} entries
{{ $customer->appends(Request::except('page'))->links('pagination::bootstrap-4') }}
@endif
@endsection