@include('hk.header')

{{ $page_title }}

User Activity Report

{{-- Filter Form --}}
{{-- Search User --}}
{{-- Start Date --}}
{{-- End Date --}}
{{-- Submit Button --}}
{{-- Data Table --}} @php $grandTotalCompanies = 0; $grandTotalProducts = 0; @endphp @foreach ($users as $user) @php $dates = collect([...$user->companies, ...$user->products]) ->pluck('date') ->unique() ->sort(); @endphp @foreach ($dates as $index => $date) @php $companyCount = $user->companies->firstWhere('date', $date)->companies_count ?? 0; $productCount = $user->products->firstWhere('date', $date)->products_count ?? 0; $grandTotalCompanies += $companyCount; $grandTotalProducts += $productCount; @endphp @if ($index === 0) @endif @endforeach @endforeach
User Name Date No. of Companies Added No. of Products Added
{{ $user->name }}{{ $date }} {{ $companyCount }} {{ $productCount }}
Total {{ $grandTotalCompanies }} {{ $grandTotalProducts }}
@include('hk.footer')