@include('admin.loader')
@php
$getUserRoleData = userRoleData();
$LeadSources = explode(",",$getUserRoleData->LeadSources);
@endphp
@if( count((array) $errors) > 0)
@foreach($errors->all() as $error)
{{ trans('labels.Error') }}:
{{ $error }}
@endforeach
@endif
@if(session()->has('message'))
×
{{ trans('labels.Successlabel') }}
{{ session()->get('message') }}
@endif
@if(session()->has('error'))
×
{{ trans('labels.WarningLabel') }}
{{ session()->get('error') }}
@endif
All Products
Time Interval
Unique Chat Count
Total Messages Received
Total Messages Sent
Sent Agent Name
Unique Chat Agent Name
{{-- Loop through mergedUniqueChatsPerHour to show the unique chat counts and user names --}}
@foreach ($mergedUniqueChatsPerHour as $timeInterval => $uniqueChatData)
{{ $timeInterval }}
{{-- Display the unique chat count --}}
{{ $uniqueChatData['count'] }}
{{-- Display total messages received for this time interval --}}
@if (isset($mergedReceivedMessages[$timeInterval]) && is_array($mergedReceivedMessages[$timeInterval]))
{{ $mergedReceivedMessages[$timeInterval]['count'] }}
@else
{{ $mergedReceivedMessages[$timeInterval] ?? 0 }}
@endif
{{-- Display total messages sent for this time interval --}}
@if (isset($groupedSentMessages[$timeInterval]) && is_array($groupedSentMessages[$timeInterval]))
{{ $groupedSentMessages[$timeInterval]['count'] }}
@else
{{ $groupedSentMessages[$timeInterval] ?? 0 }}
@endif
{{-- Display agent names (users) for sent messages --}}
@if (isset($groupedSentMessages[$timeInterval]) && isset($groupedSentMessages[$timeInterval]['users']))
{{ implode(', ', $groupedSentMessages[$timeInterval]['users']) }}
@else
'N/A'
@endif
{{-- Show the list of unique users and their chat counts below the Unique Chat Count --}}
@if (isset($uniqueChatData['users']) && !empty($uniqueChatData['users']))
{{ implode(', ', $uniqueChatData['users']) }}
@else
'N/A'
@endif
@endforeach
{{-- Handle time intervals that are only in mergedReceivedMessages --}}
@foreach ($mergedReceivedMessages as $timeInterval => $receivedData)
@if (!isset($mergedUniqueChatsPerHour[$timeInterval]))
{{ $timeInterval }}
0
{{-- Display received messages count --}}
@if (is_array($receivedData))
{{ $receivedData['count'] }}
@else
{{ $receivedData ?? 0 }}
@endif
{{-- Display sent messages count --}}
@if (isset($groupedSentMessages[$timeInterval]) && is_array($groupedSentMessages[$timeInterval]))
{{ $groupedSentMessages[$timeInterval]['count'] }}
@else
{{ $groupedSentMessages[$timeInterval] ?? 0 }}
@endif
{{-- Display agent names (users) for sent messages --}}
@if (isset($groupedSentMessages[$timeInterval]) && isset($groupedSentMessages[$timeInterval]['users']))
{{ implode(', ', $groupedSentMessages[$timeInterval]['users']) }}
@else
'N/A'
@endif
@endif
@endforeach
{{-- Handle time intervals that are only in groupedSentMessages --}}
@foreach ($groupedSentMessages as $timeInterval => $sentData)
@if (!isset($mergedReceivedMessages[$timeInterval]) && !isset($mergedUniqueChatsPerHour[$timeInterval]))
{{ $timeInterval }}
0
0
{{-- Display sent messages count --}}
@if (is_array($sentData))
{{ $sentData['count'] }}
@else
{{ $sentData ?? 0 }}
@endif
{{-- Display agent names (users) for sent messages --}}
@if (isset($sentData['users']))
{{ implode(', ', $sentData['users']) }}
@else
'N/A'
@endif
@endif
@endforeach
Guru IPTV
Time Interval
Unique Chat Count
Total Messages Received
Total Messages Sent
Send Agent Name
Unique Agent Name
@php
// Collect and merge all unique time intervals for Guru IPTV
$guruTimeIntervals = collect($uniqueChatsPerTimeInterval['guru'] ?? [])
->keys()
->merge(array_keys($finalData['guru'] ?? []))
->merge(array_keys($finalSenderData['guru'] ?? []))
->unique()
->sort()
->values();
@endphp
@foreach ($guruTimeIntervals as $timeInterval)
{{ $timeInterval }}
{{ $uniqueChatsPerTimeInterval['guru'][$timeInterval]['count'] ?? 0 }}
{{ $finalData['guru'][$timeInterval] ?? 0 }}
{{ $finalSenderData['guru'][$timeInterval][0] ?? 0 }}
@php
$raw = $finalSenderData['guru'][$timeInterval][1] ?? '';
$items = $raw ? explode(',', $raw) : [];
@endphp
@if (!empty($items))
@foreach ($items as $item)
{{ $item }}
@endforeach
@else
N/A
@endif
@if (isset($uniqueChatsPerTimeInterval['guru'][$timeInterval]['users'] ))
{{ implode(', ', $uniqueChatsPerTimeInterval['guru'][$timeInterval]['users'] ) }}
@else
'N/A'
@endif
@endforeach
Tashan IPTV
Time Interval
Unique Chat Count
Total Messages Received
Total Messages Sent
Send Agent Name
Unique Agent Name
@php
$tashanTimeIntervals = collect($uniqueChatsPerTimeInterval['tashan'] ?? [])
->keys()
->merge(array_keys($finalData['tashan'] ?? []))
->merge(array_keys($finalSenderData['tashan'] ?? []))
->unique()
->sort()
->values();
@endphp
@foreach ($tashanTimeIntervals as $timeInterval)
{{ $timeInterval }}
{{ $uniqueChatsPerTimeInterval['tashan'][$timeInterval]['count'] ?? 0 }}
{{-- {{ $uniqueChatsPerTimeInterval['tashan'][$timeInterval] ?? 0 }} --}}
{{ $finalData['tashan'][$timeInterval] ?? 0 }}
{{ $finalSenderData['tashan'][$timeInterval][0] ?? 0 }}
{{-- {{ $finalSenderData['tashan'][$timeInterval][1] ?? 'N/A' }} --}}
@php
$raw = $finalSenderData['tashan'][$timeInterval][1] ?? '';
$items = $raw ? explode(',', $raw) : [];
@endphp
@if (!empty($items))
@foreach ($items as $item)
{{ $item }}
@endforeach
@else
N/A
@endif
{{-- {{ $uniqueChatsPerTimeInterval['tashan'][$timeInterval]['users'] ?? 0 }} --}}
@if (isset($uniqueChatsPerTimeInterval['tashan'][$timeInterval]['users'] ))
{{ implode(', ', $uniqueChatsPerTimeInterval['tashan'][$timeInterval]['users'] ) }}
@else
'N/A'
@endif
@endforeach
Boss IPTV
Time Interval
Unique Chat Count
Total Messages Received
Total Messages Sent
Send Agent Name
UniqueAgent Name
@foreach ($uniqueChatsPerTimeInterval['boss'] as $timeInterval => $uniqueChatCount)
{{ $timeInterval }}
{{ $uniqueChatsPerTimeInterval['boss'][$timeInterval]['count'] ?? 0 }}
{{-- {{ $uniqueChatCount }} --}}
{{ isset($finalData['boss'][$timeInterval]) ? $finalData['boss'][$timeInterval] : 0 }}
{{ isset($finalSenderData['boss'][$timeInterval]) ? $finalSenderData['boss'][$timeInterval][0] : 0 }}
{{-- {{ isset($finalSenderData['boss'][$timeInterval]) ? $finalSenderData['boss'][$timeInterval][1] : 'N/A' }} --}}
@php
$raw = $finalSenderData['boss'][$timeInterval][1] ?? '';
$items = $raw ? explode(',', $raw) : [];
@endphp
@if (!empty($items))
@foreach ($items as $item)
{{ $item }}
@endforeach
@else
N/A
@endif
{{-- {{ $uniqueChatsPerTimeInterval['boss'][$timeInterval]['users'] ?? 0 }} --}}
@if (isset($uniqueChatsPerTimeInterval['boss'][$timeInterval]['users'] ))
{{ implode(', ', $uniqueChatsPerTimeInterval['boss'][$timeInterval]['users'] ) }}
@else
'N/A'
@endif
@endforeach
@foreach ($finalData['boss'] as $timeInterval => $sentCount)
@if (!isset($uniqueChatsPerTimeInterval['boss'][$timeInterval]))
{{ $timeInterval }}
0
{{ $sentCount }}
{{ isset($finalSenderData['boss'][$timeInterval]) ? $finalSenderData['boss'][$timeInterval][0] : 0 }}
{{ isset($finalSenderData['boss'][$timeInterval]) ? $finalSenderData['boss'][$timeInterval][1] : 'N/A' }}
0
@endif
@endforeach
@foreach ($finalSenderData['boss'] as $timeInterval => $receivedCount)
@if (!isset($finalData['boss'][$timeInterval]) && !isset($uniqueChatsPerTimeInterval['boss'][$timeInterval]))
{{ $timeInterval }}
0
0
{{ isset($finalSenderData['boss'][$timeInterval]) ? $finalSenderData['boss'][$timeInterval][0] : 0 }}
{{ isset($finalSenderData['boss'][$timeInterval]) ? $finalSenderData['boss'][$timeInterval][1] : 'N/A' }}
0
@endif
@endforeach
Vois IPTV
Time Interval
Unique Chat Count
Total Messages Received
Total Messages Sent
Send Agent Name
UniqueAgent Name
@php
$voiceTimeIntervals = collect($uniqueChatsPerTimeInterval['voice'] ?? [])
->keys()
->merge(array_keys($finalData['voice'] ?? []))
->merge(array_keys($finalSenderData['voice'] ?? []))
->unique()
->sort()
->values();
@endphp
@foreach ($voiceTimeIntervals as $timeInterval)
{{ $timeInterval }}
{{ $uniqueChatsPerTimeInterval['voice'][$timeInterval]['count'] ?? 0 }}
{{-- {{ $uniqueChatsPerTimeInterval['voice'][$timeInterval] ?? 0 }} --}}
{{ $finalData['voice'][$timeInterval] ?? 0 }}
{{ $finalSenderData['voice'][$timeInterval][0] ?? 0 }}
{{-- {{ $finalSenderData['voice'][$timeInterval][1] ?? 'N/A' }} --}}
@php
$raw = $finalSenderData['voice'][$timeInterval][1] ?? '';
$items = $raw ? explode(',', $raw) : [];
@endphp
@if (!empty($items))
@foreach ($items as $item)
{{ $item }}
@endforeach
@else
N/A
@endif
{{-- {{ $uniqueChatsPerTimeInterval['voice'][$timeInterval]['users'] ?? 0 }} --}}
@if (isset($uniqueChatsPerTimeInterval['voice'][$timeInterval]['users'] ))
{{ implode(', ', $uniqueChatsPerTimeInterval['voice'][$timeInterval]['users'] ) }}
@else
'N/A'
@endif
@endforeach
Brampton IPTV
Time Interval
Unique Chat Count
Total Messages Received
Total Messages Sent
@foreach ($uniqueChatsPerTimeInterval['brampton'] as $timeInterval => $uniqueChatCount)
{{ $timeInterval }}
{{ $uniqueChatCount }}
{{ isset($finalData['brampton'][$timeInterval]) ? $finalData['brampton'][$timeInterval] : 0 }}
{{ isset($finalSenderData['brampton'][$timeInterval]) ? $finalSenderData['brampton'][$timeInterval][0] : 0 }}
{{-- {{ isset($finalSenderData['brampton'][$timeInterval]) ? $finalSenderData['brampton'][$timeInterval][1] : 'N/A' }} --}}
@php
$raw = $finalSenderData['brampton'][$timeInterval][1] ?? '';
$items = $raw ? explode(',', $raw) : [];
@endphp
@if (!empty($items))
@foreach ($items as $item)
{{ $item }}
@endforeach
@else
N/A
@endif
@endforeach
@foreach ($finalData['brampton'] as $timeInterval => $sentCount)
@if (!isset($uniqueChatsPerTimeInterval['brampton'][$timeInterval]))
{{ $timeInterval }}
0
{{ $sentCount }}
{{ isset($finalSenderData['brampton'][$timeInterval]) ? $finalSenderData['brampton'][$timeInterval][0] : 0 }}
{{ isset($finalSenderData['brampton'][$timeInterval]) ? $finalSenderData['brampton'][$timeInterval][1] : 'N/A' }}
@endif
@endforeach
@foreach ($finalSenderData['brampton'] as $timeInterval => $receivedCount)
@if (!isset($finalData['brampton'][$timeInterval]) && !isset($uniqueChatsPerTimeInterval['brampton'][$timeInterval]))
{{ $timeInterval }}
0
0
{{ isset($finalSenderData['brampton'][$timeInterval]) ? $finalSenderData['brampton'][$timeInterval][0] : 0 }}
{{ isset($finalSenderData['brampton'][$timeInterval]) ? $finalSenderData['brampton'][$timeInterval][1] : 'N/A' }}
@endif
@endforeach
Indian IPTV
Time Interval
Unique Chat Count
Total Messages Received
Total Messages Sent
Send message agent name
Unique message agent name
@php
$indianTimeIntervals = collect($uniqueChatsPerTimeInterval['indian'] ?? [])
->keys()
->merge(array_keys($finalData['indian'] ?? []))
->merge(array_keys($finalSenderData['indian'] ?? []))
->unique()
->sort()
->values();
@endphp
@foreach ($indianTimeIntervals as $timeInterval)
{{ $timeInterval }}
{{ $uniqueChatsPerTimeInterval['indian'][$timeInterval]['count'] ?? 0 }}
{{-- @dd($finalSenderData['indian']); --}}
{{-- {{ $uniqueChatsPerTimeInterval['indian'][$timeInterval] ?? 0 }} --}}
{{ $finalData['indian'][$timeInterval] ?? 0 }}
{{ $finalSenderData['indian'][$timeInterval][0] ?? 0 }}
{{-- {{ $finalSenderData['indian'][$timeInterval][1] ?? 'N/A' }} --}}
@php
$raw = $finalSenderData['indian'][$timeInterval][1] ?? '';
$items = $raw ? explode(',', $raw) : [];
@endphp
@if (!empty($items))
@foreach ($items as $item)
{{ $item }}
@endforeach
@else
N/A
@endif
@if (isset($uniqueChatsPerTimeInterval['indian'][$timeInterval]['users'] ))
{{ implode(', ', $uniqueChatsPerTimeInterval['indian'][$timeInterval]['users'] ) }}
@else
'N/A'
@endif
@endforeach