@extends('layout.app') @section('content')
@if (!checkAPI()) @endif @php $totalActive = 0; $totalOnline = 0; // Add this $totalExpire = 0; $totalDisable = 0; $totalDeactive = 0; $totalWithoutClose = 0; $totalClose = 0; $grandTotal = 0; $counter = 1; @endphp @foreach ($resellers as $reseller) @php $firstRow = true; @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; $onlineCount = $pop_wise_online_counts[$pop->id] ?? 0; // Store in variable $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; $totalOnline += $onlineCount; // Add this $totalExpire += $expired; $totalDisable += $disabled; $totalDeactive += $deactivated; $totalWithoutClose += $withoutClose; $totalClose += $closed; $grandTotal += $total; @endphp @if ($firstRow) @php $firstRow = false; @endphp @endif @if (!checkAPI()) @endif @endforeach @endforeach @if (!checkAPI()) @endif
Sl. No. Manager Name POP Name Active UserOnline UserExpire User Disable User Deactive User Total Without Close Close User Total
{{ $counter++ }} {{ $reseller->name }}{{ $pop->popname }}{{ $pop->subreseller == 'yes' ? '(Sub POP)' : '' }} {{ $active }}{{ $onlineCount }}{{ $expired }} {{ $disabled }} {{ $deactivated }} {{ $withoutClose }} {{ $closed }} {{ $total }}
Total {{ $totalActive }}{{ $totalOnline }}{{ $totalExpire }} {{ $totalDisable }} {{ $totalDeactive }} {{ $totalWithoutClose }} {{ $totalClose }} {{ $grandTotal }}
@endsection