@extends('admin.layouts.master') @section('css') @endsection @section('contents')
@if(auth()->user()->can('create_users') ) @endif
@include('admin.users.search_form')

{{__('Users')}} {{ $rows->total() }}

| @foreach($sortedCategories as $category) {{ $category->name }} {{ $categoryCounts->get($category->id, 0) }} @endforeach @if(isset($categoryCounts['']) || isset($categoryCounts[null]) || isset($categoryCounts[0])) {{__('بدون تصنيف')}} {{ $categoryCounts[''] ?? $categoryCounts[null] ?? $categoryCounts[0] ?? 0 }} @endif
@foreach($rows as $row) @php $effectiveSource = $row->source; $effectiveMedium = $row->utm_medium; $effectiveCampaign = $row->utm_campaign; $effectiveContent = $row->utm_content; $effectiveClickIdType = $row->first_click_id_type ?: $row->last_click_id_type; $effectiveChannel = $row->attribution_channel; // Fallback for ad clicks that arrive with click IDs but without explicit UTM params. if (!$effectiveSource && in_array($effectiveClickIdType, ['gclid', 'msclkid'], true)) { $effectiveSource = 'google'; } elseif (!$effectiveSource && $effectiveClickIdType === 'fbclid') { $effectiveSource = 'facebook'; } elseif (!$effectiveSource && $effectiveClickIdType === 'ttclid') { $effectiveSource = 'tiktok'; } if (!$effectiveMedium && $effectiveChannel === 'paid_search') { $effectiveMedium = 'cpc'; } elseif (!$effectiveMedium && $effectiveChannel === 'paid_social') { $effectiveMedium = 'paid_social'; } $hasUtmLikeData = $effectiveMedium || $effectiveCampaign || $effectiveContent || $effectiveChannel || $effectiveClickIdType; @endphp @endforeach
# {{__('Username')}} {{__('Name')}} {{__('Gender')}} {{__('Country')}} {{__('Category')}} {{__('أكمل حسابه')}} {{__('تاريخ التسجيل')}} {{__('المصدر')}} {{__('UTM')}} {{__('الجهاز')}} {{__('طريقة التسجيل')}} {{__('تذكير إكمال الحساب')}} {{__('Actions')}}
{{$rows->total() - (($rows->currentPage() - 1) * $rows->perPage() + $loop->index)}} @if($row->username) {{$row->username}} @else {{__('None')}} @endif {{$row->name ?? __('None')}} @if($row->gender == 'male') {{__('Male')}} @elseif($row->gender == 'female') {{__('Female')}} @else {{__('None')}} @endif {{$row->country?->name ?? __('None')}} {{$row->category?->name ?? __('None')}} @php $profileStatus = getUserProfileCompletionStatus($row); $profileCompleted = !$profileStatus['is_incomplete']; @endphp @if($profileCompleted) نعم ✓ @else لا ✗ @endif {{Carbon\Carbon::parse($row->created_at)->format('M j, Y')}}
{{Carbon\Carbon::parse($row->created_at)->format('g:i A')}}
@if($effectiveSource) {{ $effectiveSource }} @else مباشر @endif @if($hasUtmLikeData)
@if($effectiveMedium)
medium: {{ $effectiveMedium }}
@endif @if($effectiveCampaign)
campaign: {{ $effectiveCampaign }}
@endif @if($effectiveContent)
content: {{ $effectiveContent }}
@endif @if($effectiveChannel)
channel: {{ $effectiveChannel }}
@endif @if($effectiveClickIdType)
click_id: {{ $effectiveClickIdType }}
@endif
@else @endif
@if($row->register_device == 'android') 📱 Android @elseif($row->register_device == 'iphone') 🍎 iPhone @elseif($row->register_device == 'desktop') 💻 Desktop @else @endif @if($row->google_id) جوجل @else ✉️ عادي @endif @if($row->profile_reminder_sent_at) نعم ✓
{{Carbon\Carbon::parse($row->profile_reminder_sent_at)->format('M j, Y')}} @else لم يُرسل @endif
@if(auth()->user()->can('update_users')) @endif @if(auth()->user()->can('update_users')) @endif
@if(auth()->user()->can('update_users') ) @endif
@if(auth()->user()->can('update_users') && $row->stripe_connect_account_id) @endif
@if(auth()->user()->can('delete_users')) @endif @if(auth()->user()->can('update_users'))
@csrf
@endif
@include('admin.components.advanced-pagination', ['paginator' => $rows])
@endsection @section('js') @endsection