@extends('admin.layouts.container')

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

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

                <div class="form-group col-md-6">
                    <label>{{ meta('request_type', $local) ?? __('caseRequests.request_type') }} </label>
                    <input readonly class="form-control bg-white" value='{{ __('caseRequests.'.$caseRequest->request_type) }}'/>
                </div>
                <div class="form-group col-md-6">
                    <label>{{ meta('name', $local) ?? __('caseRequests.name') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $caseRequest->name}}'/>
                </div>
                <div class="form-group col-md-6">
                    <label>{{ meta('email', $local) ?? __('caseRequests.email') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $caseRequest->email }}'/>
                </div>
                <div class="form-group col-lg-6">
                    <label>{{ meta('phone', $local) ?? __('caseRequests.phone') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $caseRequest->phone }}'/>
                </div>
                <div class="form-group col-lg-12">
                    <label>{{ meta('subject', $local) ?? __('caseRequests.subject') }} </label>
                    <input readonly class="form-control bg-white" value='{{ $caseRequest->subject }}'/>
                </div>
                <div class="form-group col-lg-12">
                    <label>{{ meta('requests', $local) ?? __('caseRequests.requests') }} </label>
                    <textarea cols="30" rows="10" readonly class="form-control bg-white">{{ $caseRequest->requests ?? "" }}</textarea>
                </div>

                <div class="form-group col-lg-12">
                    <label>{{ meta('details', $local) ?? __('caseRequests.details') }} </label>
                    <textarea cols="30" rows="10" readonly class="form-control bg-white">{{ $caseRequest->details ?? "" }}</textarea>
                </div>

                <div class="border-item photos col-md-12 other_image_container">
                    <label>{{ meta('files', $local) ?? __('trainingRequests.files') }} </label>
                    <div class="row">
                        @if ($caseRequest->files && is_array($caseRequest->files) && count($caseRequest->files))
                            @foreach ($caseRequest->files as $file)
                                <div class="col-md-4">
                                    <div class="items">
                                        <div class="img">
                                            <a href="{{ asset($file)}}" data-fancybox="gallery"><img src="{{ asset($file)}}" alt=""></a>
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <a class="btn btn-success" download href="{{asset($file)}}"><i class="fa fa-download"></i> Download</a>
                                    </div>
                                </div>
                            @endforeach
                        @endif
                    </div>
                </div>
            <div class="text-center mt-5 col-12">
                <a href="{{route('caseRequests.index')}}" class="butn "><span>{{ __('caseRequests.head') }}</span></a>
            </div>
        </form>
    </div>



@endsection

@section('inner_js')
    <!-- Editor JS files -->
    <script src="{{ asset('/assets/admin/js/lib/tinymce.min.js') }}"></script>
    {{--    <script src="//cdn.tinymce.com/4/tinymce.min.js"></script>--}}
    <script>
        var route_prefix = "{{ url(config('lfm.prefix')) }}";
        var url = "{{url('/')}}/",
            currentLanguage = "{{$local}}",
            inputName = '';
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>

@endsection



