{{-- sent emails report table --}} @if ($subType == 'sentEmail')
@foreach ($levels as $level) @endforeach {{-- --}} @forelse($reportData as $resource) @if ($resource->resourceInfo->channel == 'Google') @if ($resource->resourceInfo->google->location_id) @else - @endif @else @endif {{-- --}} @forelse($resource->resourceCategories()->limit($levels->count())->get() as $cat) @empty @foreach ($levels as $level) @endforeach @endforelse @empty @endforelse
Source ID Title Content Account Customer Username Customer Name Assigned Username Assigned Name Assigned Ops ID Assigned At Attachment{{ $level->label }}New At Resolved At Closed At
{{ $resource->id }} {{ $resource->resourceInfo->channel }} {{ $resource->resourceInfo->type }}{{ \App\Models\Tenant\GoogleReviewLocation::where('location_id', $resource->resourceInfo->google->location_id)->first() ? \App\Models\Tenant\GoogleReviewLocation::where('location_id', $resource->resourceInfo->google->location_id)->first()->location_name : '-' }}{{ $resource->resourceInfo->account_name }}{{ isset($resource->resourceInfo->customer) ? $resource->resourceInfo->customer->username : '-' }} {{ isset($resource->resourceInfo->customer) ? $resource->resourceInfo->customer->display_name : '-' }} {{ $resource->status }} {{ $resource->user != null ? $resource->user->username : '-' }} {{ $resource->user != null ? $resource->user->first_name . ' ' . $resource->user->last_name : '-' }} {{ $resource->assign_at != null ? $resource->assign_at : '-' }}{{$resource->resourceInfo->read_at ? $resource->resourceInfo->read_at : '-'}}{{ $resource->resourceInfo->first_response_time ? $resource->resourceInfo->first_response_time : '-' }}{{ $cat->category->name }}-{{ $resource->created_at->format('M d, y H:i:s') }} {{ $resource->resourceActions()->where('action', 'Resolved')->first() ? $resource->resourceActions()->where('action', 'Resolved')->first()->created_at->format('M d, y H:i:s') : '-' }} {{ $resource->resourceActions()->where('action', 'Closed')->first() ? $resource->resourceActions()->where('action', 'Closed')->first()->created_at->format('M d, y H:i:s') : '-' }}
There is no data found
@elseif ($subType == 'performance')
@if ($reportData != null) @forelse($reportData->groupBy('user_id') as $resource) @php $totalTime = 0; $totalCount = 0; foreach ($resource as $item) { if ($item->status != 'New' && $item->updated_at) { $totalTime += $item->created_at->diffInSeconds($item->updated_at); $totalCount++; } } $averageUpdateTime = $totalCount > 0 ? $totalTime / $totalCount : null; // Convert total time to hours, minutes, and seconds $hours = floor($averageUpdateTime / 3600); $minutes = floor(($averageUpdateTime % 3600) / 60); $seconds = $averageUpdateTime % 60; @endphp @php $totalTime = 0; $totalCount = 0; foreach ($resource as $item) { if ($item->resourceInfo && $item->resourceInfo->first_response_time) { $frt = Carbon\Carbon::parse($item->resourceInfo->first_response_time); $totalTime += $item->created_at->diffInSeconds($frt); $totalCount++; } } $averageFRT = $totalCount > 0 ? $totalTime / $totalCount : null; // Convert total time to hours, minutes, and seconds $hours = floor($averageFRT / 3600); $minutes = floor(($averageFRT % 3600) / 60); $seconds = $averageFRT % 60; @endphp {{-- --}} @php $channelCounts = []; // Initialize an empty array to store channel counts // Loop through each item in the $resource array foreach ($resource as $item) { $channel = $item->resourceInfo->channel; // Assuming 'channel' is the property containing the channel name // Increment the count for the current channel or initialize it to 1 if it doesn't exist yet if (isset($channelCounts[$channel])) { $channelCounts[$channel]++; } else { $channelCounts[$channel] = 1; } } echo ""; @endphp @empty @endforelse @endif
User Avg Resolution Time Avg First Response Time Volume of Ticket response Escalation Rate Volume by Channel
{{$resource[0]->user->first_name}} {{$resource[0]->user->last_name}} {{$hours}}H : {{$minutes}}M : {{$seconds}}S {{$hours}}H : {{$minutes}}M : {{$seconds}}S @php $totalCount = 0; foreach ($resource as $item) { $pendingActions = $item->resourceActions()->where('action', 'Pending')->get(); // Count the number of pending actions for the current item $pendingCount = $pendingActions->count(); // Increment the total count by the number of pending actions for the current item $totalCount += $pendingCount; } @endphp {{$totalCount}} --}} {{-- @php--}} {{-- $totalTime = 0;--}} {{-- $totalCount = 0;--}} {{-- foreach ($resource as $item) {--}} {{-- if ($item->where('status','New')) {--}} {{-- $frt = Carbon\Carbon::parse(now());--}} {{-- $totalTime += $item->created_at->diffInSeconds($frt);--}} {{-- $totalCount++;--}} {{-- }--}} {{-- }--}} {{-- $averageFRT = $totalCount > 0 ? $totalTime / $totalCount : null;--}} {{-- // Convert total time to hours, minutes, and seconds--}} {{-- $hours = floor($averageFRT / 3600);--}} {{-- $minutes = floor(($averageFRT % 3600) / 60);--}} {{-- $seconds = $averageFRT % 60;--}} {{-- @endphp--}} {{-- {{$hours}}H : {{$minutes}}M : {{$seconds}}S--}} {{-- @php $pendingCount =0; foreach ($resource as $item) { $pendingActions = $item->resourceActions()->where('action', 'New Ticket')->count(); $newTicet= $item->resourceActions()->where('action', 'New')->count(); // Count the number of pending actions for the current item if ($newTicet) $pendingCount += $pendingActions/$newTicet; // Increment the total count by the number of pending actions for the current item } @endphp {{$pendingCount}}% "; // Print the channel names and their counts foreach ($channelCounts as $channel => $count) { echo "$channel: $count
"; } echo "
There is no data found
@else @if ($reportData != null)
@foreach ($levels as $level) @endforeach @foreach ($filter_fields as $field) @endforeach @forelse($reportData as $resource) @if ($resource->resourceInfo->channel == 'Google') @if ($resource->resourceInfo->google->location_id) @else - @endif @else @endif {{-- --}} @forelse($resource->resourceCategories()->limit($levels->count())->get() as $cat) @empty @foreach ($levels as $level) @endforeach @endforelse @foreach ($filter_fields as $field) @php if (!empty($resource->resourceFields) && isset($resource->resourceFields[0])) { // Decode the JSON object $fields = json_decode($resource->resourceFields[0]->fields); // Check if $fields is an object and has the property if (is_object($fields) && isset($fields->$field)) { $value = $fields->$field; } else { $value = "-"; } } else { $value = "-"; } @endphp @endforeach @empty @endforelse
Source ID Channel Type Account Customer Username Customer Name Status Assigned Username Assigned Name Assigned At FRT{{ $level->label }}{{\App\Models\Tenant\FormField::where('slug',$field)->first()->label}}New At Resolved At Closed At Comment
{{ $resource->id }} {{ $resource->resourceInfo->channel }} {{ $resource->resourceInfo->type }}{{ \App\Models\Tenant\GoogleReviewLocation::where('location_id', $resource->resourceInfo->google->location_id)->first() ? \App\Models\Tenant\GoogleReviewLocation::where('location_id', $resource->resourceInfo->google->location_id)->first()->location_name : '-' }}{{ $resource->resourceInfo->account_name }}{{ isset($resource->resourceInfo->customer) ? $resource->resourceInfo->customer->username : '-' }} {{ isset($resource->resourceInfo->customer) ? $resource->resourceInfo->customer->display_name : '-' }} {{ $resource->status }} {{ $resource->user != null ? $resource->user->username : '-' }} {{ $resource->user != null ? $resource->user->first_name . ' ' . $resource->user->last_name : '-' }} {{ $resource->assign_at != null ? $resource->assign_at : '-' }}{{$resource->resourceInfo->read_at ? $resource->resourceInfo->read_at : '-'}}{{ $resource->resourceInfo->first_response_time ? $resource->resourceInfo->first_response_time : '-' }}{{ $cat->category->name }}-{{ $value }}{{ $resource->created_at->format('M d, y H:i:s') }} {{ $resource->resourceActions()->where('action', 'Resolved')->first() ? $resource->resourceActions()->where('action', 'Resolved')->first()->created_at->format('M d, y H:i:s') : '-' }} {{ $resource->resourceActions()->where('action', 'Closed')->first() ? $resource->resourceActions()->where('action', 'Closed')->first()->created_at->format('M d, y H:i:s') : '-' }} {{ $resource->resourceActions ? $resource->resourceActions()->orderBy('id','desc')->first()->comment :"" }}
There is no data found
{{-- {{$resources->links()}} --}} @else
no report select
@endif @endif
Type

Channels

{{-- --}}
@if ($subType != null && $subType != 'sentEmail')
Status

@endif @if($subType != null)
Select Fields

@endif
@if ($subType != null)
@endif