@extends('admin.layouts.app') @section('title', 'Parcel Manifests') @section('content') @include('admin.includes.alerts')
Mauzo Vifirushi(Parcel)
@foreach ($collectionByOfficeParcel as $x => $office)
@endforeach
{{--
--}}
HESABU KWA AGENT @foreach($agentParcels as $i => $parcel) {{-- --}} @endforeach
SN AGENT OFFICE TODAY YESTERDAY THIS WEEK LAST WEEK THIS MONTH LAST MONTH YEAR LAST YEAR
{{$i+1}}{{$i + $agentParcels->firstItem()}} @if($parcel->senderAgent == 0) TiketiGala @else {{ \App\Models\Agent::where(['id' => $parcel->senderAgent])->first()->name }} @endif {{ \App\Models\Office::where(['id' => $parcel->sentOffice])->first()->location }} @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $todayA = $localTime->format('d-M-Y 00:00:00'); $todayB = $localTime->format('d-M-Y 23:59:00'); $fareT = \App\Models\Parcel::where('senderAgent', '=', $parcel->senderAgent) ->where('status', '>', 0) ->where('is_deleted', '=', 0) ->whereBetween('dateSent', [$todayA, $todayB]) ->sum('collection'); echo $fareT; @endphp @php $fareLD = \App\Models\Parcel::whereDate('created_at', \Illuminate\Support\Carbon::yesterday()->toDateString()) ->where('senderAgent', '=', $parcel->senderAgent) ->where('status', '>', 0) ->where('is_deleted', '=', 0) ->sum('collection'); echo $fareLD; @endphp @php $fareW = \App\Models\Parcel::whereBetween('created_at', [\Illuminate\Support\Carbon::now()->startOfWeek(), \Illuminate\Support\Carbon::now()->endOfWeek()]) ->where('senderAgent', '=', $parcel->senderAgent) ->where('status', '>', 0) ->where('is_deleted', '=', 0) ->sum('collection'); echo $fareW; @endphp @php $previous_week = strtotime("-1 week +1 day"); $start_week = strtotime("last sunday midnight",$previous_week); $end_week = strtotime("next saturday",$start_week); $start_week = date("Y-m-d",$start_week); $end_week = date("Y-m-d",$end_week); $fareLW = \App\Models\Parcel::whereBetween('created_at', [$start_week, $end_week]) ->where('senderAgent', '=', $parcel->senderAgent) ->where('status', '>', 0) ->where('is_deleted', '=', 0) ->sum('collection'); echo $fareLW; @endphp @php $fareM = \App\Models\Parcel::whereMonth('created_at', date('m')) ->where('senderAgent', '=', $parcel->senderAgent) ->where('status', '>', 0) ->where('is_deleted', '=', 0) ->sum('collection'); echo $fareM; @endphp @php $fareLM = \App\Models\Parcel::whereMonth('created_at', '=', \Illuminate\Support\Carbon::now()->subMonth()->month) ->where('senderAgent', '=', $parcel->senderAgent) ->where('status', '>', 0) ->where('is_deleted', '=', 0) ->sum('collection'); echo $fareLM; @endphp @php $fareW = \App\Models\Parcel::whereYear('created_at', date('Y')) ->where('senderAgent', '=', $parcel->senderAgent) ->where('status', '>', 0) ->where('is_deleted', '=', 0) ->sum('collection'); echo $fareW; @endphp @php $fareW = \App\Models\Parcel::whereYear('created_at', date('Y', strtotime('-1 year'))) ->where('senderAgent', '=', $parcel->senderAgent) ->where('status', '>', 0) ->where('is_deleted', '=', 0) ->sum('collection'); echo $fareW; @endphp
{{ $agentParcels->links() }}
{{-- --}} @foreach($manifests as $i => $manifest) {{-- --}} @endforeach
No Parcel Worthy Cash Tracking#OriginDestination Sender Receiver Contacts Agent Office Date
{{$i + $manifests->firstItem()}} {{ $manifest->parcel }} {{ $manifest->parcelWorth }} {{ $manifest->collection }} {{ $manifest->trackingNumber }}{{ $manifest->origin }} {{ $manifest->destination }} {{ $manifest->sender }} {{ $manifest->receiver }} {{ $manifest->senderMsisdn }} @php $agent = \App\Models\Agent::where(['id' => $manifest->senderAgent])->first()->name; echo $agent; @endphp @php $office = \App\Models\Office::where(['id' => $manifest->sentOffice])->first()->location; echo $office; @endphp {{ $manifest->dateSent }}
{{ $manifests->links() }} {{-- @php--}} {{-- $aaa = "15-Jan-2022 01:42:10";--}} {{-- $bbb = "16-Jan-2022 22:42:29";--}} {{-- $agentTotal = DB::table('parcels')--}} {{-- ->where('parcels.senderAgent', '=', 21)--}} {{-- ->where('parcels.status', '=', 1)--}} {{-- ->whereBetween('parcels.dateSent', [$aaa, $bbb])--}} {{-- ->sum('parcels.collection');--}} {{-- echo "Ibra : ".$agentTotal;--}} {{-- @endphp--}}
@endsection