@if ($reportData != null) @if ($subType == 'AgentStatus')
@foreach ($getStatus['records'] as $status) @endforeach @forelse($reportData as $data) @php $loginTime = new DateTime($data->login_at); $logoutTime = new DateTime($data->logout_at); $timeDifference = $loginTime->diff($logoutTime); $interval = $timeDifference->format('%Dd %H:%I:%S'); @endphp @foreach ($getStatus['records'] as $status) @endforeach @empty @endforelse
User ID Name Date Total Staff Time AUX Types
{{ $status->name }}
{{ optional($data->user)->username }} {{ optional($data->user)->first_name }} {{ optional($data->user)->last_name }} {{ optional($data->created_at)->format('d/m/Y') }}{{ $interval }} @php $totalTime = 0; @endphp @forelse($data->agentStatusActionLogs->where('agent_status_id', $status->id) as $logs) @php $logged_tow = $data->agentStatusActionLogs->where('id', '>', $logs->id)->first(); $logged_tow = $logged_tow != null ? $logged_tow->created_at : $logs->created_at; $loginTime = new DateTime($logs->created_at); $logoutTime = new DateTime($logged_tow); $timeDifference = $loginTime->diff($logoutTime); // Convert the interval to seconds and accumulate $totalTime += $timeDifference->h * 3600 + $timeDifference->i * 60 + $timeDifference->s; @endphp @empty @endforelse @php $hours = floor($totalTime / 3600); $minutes = floor(($totalTime % 3600) / 60); $seconds = $totalTime % 60; @endphp {{ sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds) }}
There is no data found
@elseif($subType == 'AgentLoginLogout')
@forelse($reportData as $getAgent) @empty @endforelse
User ID User Name Login at Logout at
{{ optional($getAgent->user)->username }} {{ optional($getAgent->user)->first_name }} {{ optional($getAgent->user)->last_name }} {{ $getAgent->login_at }} {{ $getAgent->logout_at }}
There is no data found
{{-- {!! $getticketApp->links() !!} --}}
@elseif($subType == 'AgentDailyStaffed')
@forelse($reportData as $getAgentDS) @empty @endforelse
Date User ID User Name Staffed Hours
{{ $getAgentDS->day }} {{ optional($getAgentDS->user)->username }} {{ optional($getAgentDS->user)->first_name }} {{ optional($getAgentDS->user)->last_name }} {{ $getAgentDS->total_duration }}
There is no data found
{{-- {!! $getticketApp->links() !!} --}}
@elseif($subType == 'active_inactive')
@forelse($reportData as $user) @empty @endforelse
Name User ID Email Register Date Last Login Date Privilege Status
{{ $user->first_name . ' ' . $user->last_name }} {{ $user->username }} {{ $user->email }} {{ $user?->created_at?->format('d-m-Y') }} {{ $user->agentSessions()->latest('created_at')->value('login_at') ? Carbon::parse($user->agentSessions()->latest('created_at')->value('login_at'))->format('d-m-Y h:i A') : '-' }} {{ $user->roles->first()->display_name }} {{ $user->status == 1 ? 'Active' : 'Inactive' }}
There is no data found
{{-- {!! $getticketApp->links() !!} --}}
@elseif($subType == 'activations')
@forelse($reportData as $user) @empty @endforelse
Name User ID Email Privilege Status Register Date Total Active Days
{{ $user->first_name . ' ' . $user->last_name }} {{ $user->username }} {{ $user->email }} {{ isset($user->roles[0]) ? $user->roles[0]->display_name : '-' }} {{ $user->status == 1 ? 'Active' : 'Inactive' }} {{ $user->created_at?->format('d-m-Y') }} @php $total = 0; if($user->status == 0){ // Assuming $user is an Eloquent model with created_at and updated_at properties $createdAt = \Carbon\Carbon::parse($fromDate); $toAt = \Carbon\Carbon::parse($toDate); $updatedAt = \Carbon\Carbon::parse($user->updated_at); if ($createdAt > $updatedAt) { $total = 0; }else{ // Calculate the difference in days if ($toAt <= $updatedAt) { $total = $toAt->diffInDays($createdAt)+1; }else{ $total = $updatedAt->diffInDays($createdAt)+1; } } }else{ $createdAt = \Carbon\Carbon::parse($fromDate); $updatedAt = \Carbon\Carbon::parse($toDate); // Calculate the difference in days $total = $updatedAt->diffInDays($createdAt)+1; $createdAt2 = \Carbon\Carbon::parse($user->created_at); $updatedAt2 = \Carbon\Carbon::parse($toDate); // Calculate the difference in days $total2 = $updatedAt->diffInDays($createdAt2)+1; } @endphp {{ $total2 > $total ? $total : $total2}}
There is no data found
{{-- {!! $getticketApp->links() !!} --}}
@elseif($subType == 'AgentPerformance')
@foreach ($getStatus2['records'] as $status) @endforeach @forelse($reportData as $data) @foreach ($getStatus2['records'] as $status) @endforeach @empty @endforelse
User ID Name Date AUX Types
{{ $status->name }}
{{ optional($data->user)->username }} {{ optional($data->user)->first_name }} {{ optional($data->user)->last_name }} {{ optional($data->created_at)->format('d/m/Y') }} @php $totalTime = 0; @endphp @forelse($data->agentStatusActionLogs->where('agent_status_id', $status->id) as $logs) @php $logged_tow = $data->agentStatusActionLogs->where('id', '>', $logs->id)->first(); $logged_tow = $logged_tow != null ? $logged_tow->created_at : $logs->created_at; $loginTime = new DateTime($logs->created_at); $logoutTime = new DateTime($logged_tow); $timeDifference = $loginTime->diff($logoutTime); // Convert the interval to seconds and accumulate $totalTime += $timeDifference->h * 3600 + $timeDifference->i * 60 + $timeDifference->s; @endphp @empty @endforelse @php $hours = floor($totalTime / 3600); $minutes = floor(($totalTime % 3600) / 60); $seconds = $totalTime % 60; @endphp {{ sprintf('%02d:%02d:%02d', $hours, $minutes, $seconds) }}
There is no data found
@else
no report select
@endif @else
no report select
@endif
Type

Report Type

@if ($subType == 'active_inactive')
Filters

@endif