@extends('layout.app') @section('head') @endsection @section('content')

User Active Client

@if ($searched) Download Excel @endif
{{-- Plain select on purpose: too few options to be worth a search box. --}}
Reset
@if ($searched)
{{ $selectedRole ? 'Users with role "' . $selectedRole . '"' : 'Total users' }}{{ $selectedStatus ? ' (' . ucfirst($selectedStatus) . ')' : '' }}: {{ $userCount }} Active clients in system: {{ $totalActiveClient }}
@forelse ($users as $user) @empty @endforelse
ID Email Name Role Status Sees Active Client
{{ $user->id }} {{ $user->email }} {{ $user->name }} {{ $user->role_names }} @if ($user->user_status == 'active') Active @elseif ($user->user_status == 'deactive') Deactive @elseif ($user->user_status == 'pending') Pending @else N/A @endif @if (in_array($user->scope_label, ['No POP assigned', 'No manager assigned'])) {{ $user->scope_label }} @else {{ $user->scope_label }} @endif {{ $user->active_client_count }}
No user found.
Each count is what that user sees in their own customer list: Admin sees every POP, a reseller role sees the POPs of its assigned manager, and a sub reseller sees only its assigned POPs. Scopes overlap, so the column does not add up to a meaningful total. @else
Choose a role and press Search to list the users.
@endif
@endsection