@extends('layout.app') @section('content')
@php $totalActive = 0; $totalExpire = 0; $totalDisable = 0; $totalDeactive = 0; $totalWithoutClose = 0; $totalClose = 0; $grandTotal = 0; $counter = 1; @endphp @foreach ($resellers as $reseller) @php $firstRow = true; // To ensure manager name appears only once per reseller @endphp @foreach ($pops->where('reseller_id', $reseller->id) as $pop) @php $active = $clientCount->where('clients_status', 'active')->where('pop_id', $pop->id)->first()->total ?? 0; $expired = $clientCount->where('clients_status', 'expired')->where('pop_id', $pop->id)->first()->total ?? 0; $disabled = $clientCount->where('clients_status', 'disable')->where('pop_id', $pop->id)->first()->total ?? 0; $deactivated = $clientCount->where('clients_status', 'deactive')->where('pop_id', $pop->id)->first()->total ?? 0; $closed = $closeClientCount->where('pop_id', $pop->id)->first()->total ?? 0; $withoutClose = $active + $expired + $disabled + $deactivated; $total = $withoutClose + $closed; // Add to global totals $totalActive += $active; $totalExpire += $expired; $totalDisable += $disabled; $totalDeactive += $deactivated; $totalWithoutClose += $withoutClose; $totalClose += $closed; $grandTotal += $total; @endphp @if ($firstRow) @php $firstRow = false; @endphp @endif @endforeach @endforeach
Sl. No. Manager Name POP Name Active User Expire User Disable User Deactive User Total Without Close Close User Total
{{ $counter++ }} {{ $reseller->name }}{{ $pop->popname }}{{ ($pop->subreseller == "yes") ? '(Sub POP)' : '' }} {{ $active }} {{ $expired }} {{ $disabled }} {{ $deactivated }} {{ $withoutClose }} {{ $closed }} {{ $total }}
Total {{ $totalActive }} {{ $totalExpire }} {{ $totalDisable }} {{ $totalDeactive }} {{ $totalWithoutClose }} {{ $totalClose }} {{ $grandTotal }}
@endsection