@extends('admin.admin') @section('content')

{{ __('Tickets') }}

@php $ticketStatus = '-'; $ticketStatusClass = ''; if ($data['ticketdata']->status == 1) { $ticketStatus = __('Open'); $ticketStatusClass = 'badge badge-primary-transparent ms-2'; } else if ($data['ticketdata']->status == 2) { $ticketStatus = __('Assigned'); $ticketStatusClass = 'badge badge-soft-warning ms-2'; } else if ($data['ticketdata']->status == 3) { $ticketStatus = __('inProgress'); $ticketStatusClass = 'badge badge-soft-info ms-2'; } else if ($data['ticketdata']->status == 4) { $ticketStatus = __('Closed'); $ticketStatusClass = 'badge badge-soft-success ms-2'; } @endphp
@if($data['ticketdata']->user_type=='User') {{ __('User') }} @elseif($data['ticketdata']->user_type=='Provider') {{ __('Provider') }} @else - @endif
{{ $ticketStatus ?? '-'}}
#{{ $data['ticketdata']->ticket_id ?? '-'}}
{{ $data['ticketdata']->subject ?? '-'}}

{{ __('Updated') }} {{ \App\Helpers\TimeHelper::getRelativeTime($data['ticketdata']->updated_at) }}

{{ __('Description') }}

{!! $data['ticketdata']->description ?? '-' !!}

@if(count($data['tickethistory'])>0) @foreach($data['tickethistory'] as $hval)
@if (isset($hval->profile_image) && file_exists(public_path('storage/profile/' .$hval->profile_image))) User Profile Image @else Default Profile Image @endif
{{$hval['username']}}

{{ __('Updated') }} {{ \App\Helpers\TimeHelper::getRelativeTime($hval['created_at']) }}

{{--
--}}
@php $content = $hval['description']; // Summernote content $dom = new DOMDocument(); @$dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8')); $imageLinks = []; // Array to store download links // Extract image tags and prepare download links foreach ($dom->getElementsByTagName('img') as $img) { $src = $img->getAttribute('src'); $dataFilename = $img->getAttribute('data-filename'); // Get the data-filename attribute $imageName = $dataFilename ?: basename($src); // Use data-filename if available, else fallback to src basename // Prepare the download link HTML $imageLinks[] = " "; // Optionally, remove the image tag from content $img->parentNode->removeChild($img); } // Get the remaining content without images $modifiedContent = $dom->saveHTML(); @endphp {{-- Display the modified content --}}
{!! $modifiedContent !!}
{{-- Display the download links --}} @foreach ($imageLinks as $link) {!! $link !!} @endforeach
{{--
--}}
@endforeach @endif

{{ __('Ticket Details') }}

@if (isset($data['ticketdata']->profile_image) && file_exists(public_path('storage/profile/' .$data['ticketdata']->profile_image))) User Profile Image @else @if($data['ticketdata']->user_type=='User') Default Profile Image @else Default Profile Image @endif @endif
{{ $data['ticketdata']->user_type ?? 'User'}}

{{ $data['ticketdata']->username ?? '-'}}

{{ __('User Email') }}

{{ $data['ticketdata']->email ?? '-'}}

{{ __('Last Updated') }} / {{ __('Closed On') }}

{{ formatDateTime($data['ticketdata']->updated_at, true) ?? '-'}}

@endsection