{{-- Category Filters --}} @foreach($levels ?? [] as $level) @if ($level->level == 1)
@elseif(!empty($category_array[$level->id - 1]))
@else
@endif @endforeach
{{-- Right aligned Buttons --}}
@foreach ($filter_fields as $field) @endforeach @forelse($reportData ?? [] as $ticket) @php $ticketCategory = $ticket->ticketCategories()->where('category_level_id', 1)->first(); $categoryName = optional($ticketCategory->category)->name; @endphp {{-- @continue(!in_array($categoryName, ['Complaints', 'SAMA complaint', 'SAMA escalation'])) --}} @php if ($ticket->status == 'Closed') { $day = $ticket->created_at->diffInDays($ticket->updated_at); } else { $day = $ticket->created_at->diffInDays(now()); } $backgroundColor = ''; $dayYouHave = 0; if ($categoryName === 'Complaints') { $dayYouHave = 10; if ($day == 9) { $backgroundColor = 'yellow'; } elseif ($day >= 10) { $backgroundColor = 'red'; } } elseif ($categoryName === 'Requests') { $dayYouHave = 3; if ($day == 2) { $backgroundColor = 'yellow'; } elseif ($day >= 3) { $backgroundColor = 'red'; } } elseif ($categoryName === 'SAMA complaint') { $dayYouHave = 3; if ($day == 2) { $backgroundColor = 'yellow'; } elseif ($day >= 3) { $backgroundColor = 'red'; } } elseif ($categoryName === 'SAMA escalation') { $dayYouHave = 2; if ($day == 1) { $backgroundColor = 'yellow'; } elseif ($day >= 2) { $backgroundColor = 'red'; } } @endphp @foreach ($filter_fields as $field) @php if (!empty($ticket->ticketFiled) && isset($ticket->ticketFiled)) { // Decode the JSON object $fields = json_decode($ticket->ticketFiled->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
Costomer care Business Development Complaints Management Ticket Fields
Ticket number Customer name Customer account Customer contact number creation Date The sevirity Sub cateogry of transaction Product Category custamer description TransactionChannel ID number The root cause Remarks Department The final resolution action date/time Received employee Responsible function Escalation Estimated time for resolution Status{{\App\Models\Tenant\FormField::where('slug',$field)->first()->label}}
{{$ticket->id}} {{$ticket->ticketCustomer->display_name ?? ''}} @php // Decode the JSON fields to an associative array $fieldsArray = json_decode($ticket->ticketFiled->fields, true); // Check if 'contact-number' is set in the decoded array if (isset($fieldsArray['contact-number'])) { // If 'contact-number' is set, use it $contactNumber = $fieldsArray['contact-number']; } else { // Otherwise, fall back to the mobile number $contactNumber = $ticket->ticketCustomer->mobile_number; } @endphp {{$contactNumber ?? '-'}} {{$ticket->created_at->format('Y/m/d H:i:s')}} {{$ticket->ticketInfo->priority}} {{ optional($ticket->ticketCategories()->where('category_level_id', 2)->first()->category)->name }} {{ optional($ticket->ticketCategories()->where('category_level_id', 1)->first()->category)->name }} @php echo optional( $ticket->ticketActions() ->orderBy('created_at', 'asc') ->first() )->comment ?? ''; @endphp {{$ticket->ticketInfo->channel}} {{ optional($ticket->ticketCategories()->where('category_level_id', 1)->first()->category)->name }} @php $id = optional($ticket->ticketActions()->where('department_id', 4)->first())->id ?? '' ; if($id){ echo optional($ticket->ticketActions()->where('id','>', $id)->first())->comment ?? '' ; } @endphp {{ optional($ticket->ticketActions()->latest()->first())->comment ?? '' }} {{$ticket->updated_at->format('Y/m/d H:i:s')}} @php $latestTicketAction = $ticket->ticketActions()->latest()->first(); @endphp {{ optional($latestTicketAction->user)->first_name ?? '' }} {{ optional($latestTicketAction->user)->last_name ?? '' }} {{ optional($ticket->ticketCategories()->where('category_level_id', 1)->first()->category)->name }} {{ $day }} {{ $dayYouHave }} {{ $ticket->status }}{{ $value }}
There is no data found
{{ $reportData->links() }}