@extends('admin.layouts.container')

@section('content')
    <div class="side-title">
        <h3>{{$head ?? '' }}</h3>
    </div>

    <div class="border-item">
        <form class="form-row">
            @if($otherRequest ?? ''  && $otherRequest->id)
                @method('PUT')
            @endif
            @csrf

                <div class="form-group col-lg-6">
                    <label>{{ meta('request_no', $lang) ?? __('otherRequests.request_no') }} </label>
                    <input readonly class="form-control bg-white" value='{{$otherRequest->id }}'/>
                </div>
                <div class="form-group col-lg-6">
                    <label>{{ meta('other_request_topic_id', $lang) ?? __('otherRequests.other_request_topic_id') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $requestTopic->name }}'/>
                </div>
                <div class="form-group col-lg-4">
                    <label>{{ meta('name', $lang) ?? __('otherRequests.name') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $otherRequest->name}}'/>
                </div>
                <div class="form-group col-lg-4">
                    <label>{{ meta('email', $lang) ?? __('otherRequests.email') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $otherRequest->email }}'/>
                </div>
                <div class="form-group col-lg-4">
                    <label>{{ meta('phone', $lang) ?? __('otherRequests.phone') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $otherRequest->phone }}'/>
                </div>
                <div class="form-group col-lg-12">
                    <label>{{ meta('request_type', $lang) ?? __('otherRequests.request_type') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $otherRequest->request_type }}'/>
{{--                    <textarea rows="5" readonly class="form-control bg-white">{{ $otherRequest->request_type ?? "" }}</textarea>--}}
                </div>
{{--                <div class="form-group col-lg-12">--}}
{{--                    <label>{{ meta('requests', $lang) ?? __('otherRequests.requests') }} </label>--}}
{{--                    <textarea rows="5" readonly class="form-control bg-white">{{ $otherRequest->requests ?? "" }}</textarea>--}}
{{--                </div>--}}

                <div class="form-group col-lg-12">
                    <label>{{ meta('details', $lang) ?? __('otherRequests.details') }} </label>
                    <textarea rows="5" readonly class="form-control bg-white">{{ $otherRequest->details ?? "" }}</textarea>
                </div>

                <div class="border-item photos col-md-12 other_image_container">
                    <label>{{ meta('files', $lang) ?? __('otherRequests.files') }} </label>
                    <div class="row">
                        @if ($otherRequest->files && is_array($otherRequest->files) && count($otherRequest->files))
                            @foreach ($otherRequest->files as $file)
                                <div class="col-md-4 mb-5">
                                    <div class="items">
                                        <div class="img">
                                            @if(strpos($file, '.pdf'))
                                                <a href="{{ asset($file)}}"><img style="object-fit: contain; padding: 50px;" src="{{asset(strpos($file, '.pdf') ? 'assets/admin/images/file-icon.png' : $file)}}" alt=""></a>
                                            @else
                                                <a href="{{ asset($file)}}" data-fancybox><img src="{{ asset($file)}}" alt=""></a>
                                            @endif
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <a class="btn btn-success" download href="{{asset($file)}}"><i class="fa fa-download"></i> {{__('dashboard.download')}}</a>
                                    </div>
                                </div>
                            @endforeach
                        @endif
                    </div>
                </div>

            <div class="text-center mt-5 col-12">
                <a href="{{route('otherRequests.index')}}" class="butn case_update_button"><span>{{ __('otherRequests.head') }}</span></a>
            </div>
        </form>
    </div>



@endsection

@section('inner_js')

@endsection



