@include('sidebarss')

Tickets

Create New Ticket

Create / Edit Tickets

@if (!in_array($role, [3, 6, 7])) @else @endif
@forelse($ticket_details as $ticket) @php $skip = false; if ($role == 4 || $role == 5) { if ($user_id != $ticket->user_id) { $skip = true; } } if (in_array($role, [3, 6, 7])) { $assigned_staff = explode(',', $ticket->assigned_staff_id ?? ''); if (!in_array($user_id, $assigned_staff)) { $skip = true; } } @endphp @if (!$skip) @endif @empty @endforelse
Ticket No Assigned to Contact No Created Date Modified Date Turn around time Modified User Status Actions
{{ $ticket->ticket_number }} @php $technician = $ticket->technician; $users = []; if (in_array($role, [1, 2])) { $users = DB::table('users') ->whereIn('role', [3, 6, 7]) ->where('user_id', $technician) ->get(); } elseif ($role == 3) { $users = DB::table('users') ->where('role', 3) ->where('user_id', $technician) ->get(); } elseif (in_array($role, [4, 5])) { $users = DB::table('users') ->where('role', 3) ->where('user_id', $technician) ->get(); } elseif (in_array($role, [6, 7])) { $users = DB::table('users') ->whereIn('role', [6, 7]) ->where('user_id', $technician) ->get(); } foreach ($users as $user) { echo $user->user_name; } @endphp {{ $ticket->contact_number }} {{ \Carbon\Carbon::parse($ticket->created_at)->format('Y-m-d H:i:s') }} {{ \Carbon\Carbon::parse($ticket->updated_at)->format('Y-m-d H:i:s') }} @php $startDate = new DateTime($ticket->created_at); $endDate = new DateTime($ticket->updated_at); $dateInterval = $startDate->diff($endDate); $totalDays = $dateInterval->days; $totalSeconds = $dateInterval->s + $dateInterval->i * 60 + $dateInterval->h * 3600 + $dateInterval->days * 86400; $totalHours = floor($totalSeconds / 3600); $totalMinutes = floor(($totalSeconds % 3600) / 60); $totalSecs = $totalSeconds % 60; echo "{$totalDays} days - {$totalHours}:{$totalMinutes}:{$totalSecs}"; @endphp {{ $ticket->updated_by ?? '-' }} @php $statusMap = [ '1' => ['color' => 'blue', 'text' => 'Acknowledged'], '2' => [ 'color' => 'yellow', 'text' => 'Return with query', 'textColor' => '#333', ], '3' => ['color' => 'green', 'text' => 'Mark Resolved'], '4' => ['color' => 'magenta', 'text' => 'Return'], '5' => ['color' => 'orange', 'text' => 'Cancel'], '7' => ['color' => 'gray', 'text' => 'Cancelled'], ]; $status = $statusMap[$ticket->issue_status] ?? [ 'color' => '#999', 'text' => 'Unknown', ]; @endphp {{ $status['text'] }}
@if ($ticket->issue_status != '5') @if ($role == 2) @endif @endif
No tickets found
@if (in_array($role, [5, 1, 2])) @endif @include('footer')