@extends("admin.layouts.app") @section("title", __("admin.tickets.title")) @section("content")
@foreach(["" => "All", "open" => "Open", "answered" => "Answered", "customer-reply" => "Customer Reply", "closed" => "Closed", "on hold" => "On Hold"] as $val => $label) @php $isActive = (request("status","") == $val); @endphp $val ?: null]) }}" style="display:inline-block;padding:8px 16px;font-size:13px;text-decoration:none;color:{{ $isActive ? "#1a4d80" : "#666" }};font-weight:{{ $isActive ? "700" : "400" }};border-bottom:{{ $isActive ? "3px solid #1a4d80" : "3px solid transparent" }};margin-bottom:-1px;"> {{ $label }} {{ $val === '' ? array_sum($statusCounts) : ($statusCounts[$val] ?? 0) }} @endforeach {{ __('admin.tickets.only_guests') }}
@php $canDelete = auth('admin')->user()?->hasPermission('manage_tickets'); @endphp @include('admin.partials.list-filters', ['filters' => $filters, 'action' => route('admin.tickets.index'), 'keep' => ['status' => request('status'), 'guests' => request()->boolean('guests') ? 1 : null]]) @if($canDelete) @endif
@if($canDelete)@endif @forelse($tickets as $ticket) @php $statusBadge = match(strtolower($ticket->status ?? "")) { "open" => "badge-open", "answered" => "badge-answered", "customer-reply" => "badge-customer-reply", "closed" => "badge-terminated", "on hold" => "badge-suspended", "in progress" => "badge-pending", default => "badge-cancelled", }; $priorityBadge = match(strtolower($ticket->priority ?? "")) { "high", "critical" => "badge-terminated", "medium" => "badge-pending", "low" => "badge-active", default => "badge-cancelled", }; @endphp @if($canDelete)@endif @empty @endforelse
{!! $filters->sortLink('tid', __('admin.tickets.ticket_num')) !!} {{ __('common.table.department') }} {{ __('common.table.subject') }} {{ __('common.table.client') }} {!! $filters->sortLink('priority', __('common.table.priority')) !!} {{ __('common.table.status') }} {!! $filters->sortLink('last_reply', __('common.table.last_reply')) !!}
#{{ $ticket->tid }} {{ $ticket->department->name ?? "N/A" }} {{ Str::limit($ticket->title, 55) }} {{ $ticket->client?->full_name ?? $ticket->name ?? $ticket->email }}@if(! $ticket->client_id) {{ __('admin.tickets.guest') }}@endif {{ ucfirst($ticket->priority ?? "") }} {{ ucfirst($ticket->status ?? "") }} {{ $ticket->last_reply?->diffForHumans() ?? "-" }}
{{ __('admin.tickets.no_tickets') }}
{{ $tickets->withQueryString()->links() }}
@endsection