@extends('layouts.main') @section('title', 'Plan Details') @section('container') {{-- ************ Div **************** --}}
@foreach ($distributor as $row) @php $counts = DB::table("planalloctions")->where([ 'company_id' => $data->company_id, 'zone_id' => $data->zone_id, 'unit_id' => $data->unit_id, 'project_id' => $data->project_id, 'auditor_id' => $row->id ]) ->selectRaw(' COUNT(*) as totaldis, SUM(CASE WHEN status = 1 THEN 1 ELSE 0 END) as pending, SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) as WIP, SUM(CASE WHEN status > 2 THEN 1 ELSE 0 END) as Complete ') ->first(); @endphp

{{ strtoupper(substr($row->name, 0, 1)) }}

{{ $row->name }}

  • {{ $counts->totaldis ?? 0 }} Total Distributor
  • {{ $counts->pending ?? 0 }} Pending Distributor
  • {{ $counts->WIP ?? 0 }} WIP Distributor
  • {{ $counts->Complete ?? 0 }} Complete Distributor
  • Mobile: {{ $row->mobile }}
  • Email : {{ $row->email }}
@endforeach
{{-- ******* Tab ******** --}}

Plan - View

{{-- ******** tables ********* --}}
we
Sr No # Company ID Zone ID Unit ID Project ID Customer Code Distributor Name Contact Person Mobile No Address
{{-- ********** table ********* --}}
{{-- ******* Tab ******** --}}
{{-- ************ Div **************** --}} @endsection
@csrf