@extends('admin.layouts.container')

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

    <div class="border-item">
        <form class="form-row" >
            @if(count($addresses))
                @foreach($addresses as $row)
                    <div class="form-group col-lg-6">
                        <label>{{ __('orders.address_name') }} </label>
                        <p class="form-control" style="height: auto">{{$row->name}}</p>
                    </div>
                    <div class="form-group col-lg-6">
                        <label>{{  __('orders.city') }} </label>
                        <p class="form-control" style="height: auto">{{ $row->city->currentDescription->title }}</p>
                    </div>
                    <div class="form-group col-lg-6">
                        <label>{{  __('orders.area') }} </label>
                        <p class="form-control" style="height: auto">{{ $row->area->currentDescription->title }}</p>
                    </div>
                    <div class="form-group col-lg-12">
                        <label>{{ __('orders.address') }} </label>
                        <p class="form-control" style="height: auto">{{$row->address}}</p>
                    </div>
                    <div class="form-group col-lg-12">
                        <iframe
                            style='width:100%'
                            height="250"
                            frameborder="0"
                            scrolling="no"
                            marginheight="0"
                            marginwidth="0"
                            src="https://maps.google.com/maps?q={{$row->latitude.', '.$row->longitude}}&z=15&output=embed"
                        >
                        </iframe>
                    </div>
                @endforeach
            @else
                <div class="form-group align-content-center col-lg-12">
                    <p class="form-control align-content-center" style="height: auto">{{__('members.not_found_addresses')}}</p>
                </div>
            @endif
        </form>
    </div>

@endsection

@section('inner_js')
    <!-- Editor JS orders -->
    <script src="//cdn.tinymce.com/4/tinymce.min.js"></script>
    <script>
        let route_prefix = "{{ url(config('lfm.prefix')) }}",
            url = "{{url('/')}}/",
            imagePath = "{{asset('')}}";
    </script>
    <script src="{{ asset('assets/admin/js/editor.js') }}"></script>
    <script src="{{ asset('assets/admin/js/lfm.js') }}"></script>
@endsection
