
<div class="modal-header">
    <h1 class="modal-title fs-6" id="exampleModalLabel"> <i class="fal fa-user me-1"></i> {{$head ?? ''}} </h1>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
    <div class="modal-form">
        <div class="row">
            <div class="col-lg-12">
                <div class="form-group mb-3">
                    <div class="avatar-upload">
                        <div class="avatar-preview">
                            <div id="imagePreview" style="background-image: url({{asset($contactList->image ?? 'assets/admin/images/avatar.png')}});">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            @foreach($languages as $language)
                <div class="form-group mb-3">
                    <label for="" class="d-block mb-2"> {{ __('contact_lists.title') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
                    <p class="form-control">{{ $contactList[$language->local]->title ?? "" }}</p>
                </div>
                <div class="form-group mb-3">
                    <label for="" class="d-block mb-2"> {{ __('contact_lists.address') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
                    <p class="form-control">{{ $contactList[$language->local]->address ?? "" }}</p>
                </div>
            @endforeach
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.email') }} </label>
                <p class="form-control">{{ $contactList->email ?? "" }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.gender') }} </label>
                <p class="form-control">{{ __('contact_lists.genders.'.$contactList->gender) }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.is_top_customer') }} </label>
                <p class="form-control">{{ __('contact_lists.'.$contactList->is_top_customer ? 'yes':'no') }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.decision_maker_status') }} </label>
                    <p class="form-control">{{ __('contact_lists.'.($contactList->decision_maker_status ? 'yes' : 'no')) }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.status') }} </label>
                <p class="form-control">{{ __('contact_lists.statuses.'.$contactList->status) }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.country_id') }} </label>
                <p class="form-control">{{ $contactList->country->currentDescription->title ?? "" }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.company_id') }} </label>
                <p class="form-control">{{ $contactList->company->currentDescription->title ?? "" }}</p>
            </div>
            <div class="col-6">
                <div class="form-group mb-3">
                    <label for="" class="d-block mb-2"> {{ __('contact_lists.budget') }} </label>
                    <p class="form-control" id="budget">{{ $contactList->budget ?? "" }}</p>
                </div>
            </div>
            <div class="col-6" id="categories">

            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.avg_stand_annual') }} </label>
                <p class="form-control">{{ $contactList->avg_stand_annual ?? "" }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.avg_events_annual') }} </label>
                <p class="form-control">{{ $contactList->avg_events_annual ?? "" }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.company_website') }} </label>
                <p class="form-control">{{ $contactList->company_website ?? "" }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.role') }} </label>
                <p class="form-control">{{ $contactList->role ?? "" }}</p>
            </div>
            <div class="form-group mb-3">
                <label for="" class="d-block mb-2"> {{ __('contact_lists.note') }} </label>
                <p class="form-control">{{ $contactList->note ?? "" }}</p>
            </div>

            <div class="form-group mb-3 items" >
                <h4>{{ __('contact_lists.phones') }}</h4>
            </div>
            <div class="form-group mb-3 items" id="phones">
                @foreach($phones as $key => $phone)
                    @include('employee.contact_lists.phones.show',['phone'=>$phone,'key'=>$key])
                @endforeach
            </div>

        </div>
    </div>
</div>

<script>

    function fetchBudget()
    {
        let budget = $('#budget').html();
        if(budget)
        {
            $.ajax({
                url : "{{route('employee.fetch.budget')}}",
                type : 'GET',
                data : 'budget='+budget,
                success:function(data)
                {
                    $('#categories').html(data);
                }
            })
        }
        else
        {
            $('#categories').html('')
        }
    }
    fetchBudget()
</script>
