
    <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="form-group col-lg-6">
                    <label for="" class="d-block mb-2"> {{ __('deals.start_date') }} <span style="color:red">*</span></label>
                    <p class="form-control">{{$deal->start_date ?? ''}}</p>
                </div>
                <div class="form-group col-lg-6">
                    <label for="" class="d-block mb-2"> {{ __('deals.end_date') }} <span style="color:red">*</span></label>
                    <p class="form-control">{{$deal->end_date ?? ''}}</p>
                </div>
                <div class="form-group col-lg-6">
                    <label for="" class="d-block mb-2"> {{ __('deals.amount') }} <span style="color:red">*</span></label>
                    <p class="form-control">{{$deal->amount ?? ''}}</p>
                </div>
                <div class="form-group mb-3">
                    <label for="" class="d-block mb-2"> {{ __('companies.sector_id') }} <span style="color:red">*</span></label>
                    <p class="form-control">{{$deal->sector->currentDescription->title ?? ''}}</p>
                </div>

                <div class="form-group mb-3" >
                    <label for="" class="d-block mb-2"> {{ __('deals.status') }} </label>
                    <p class="form-control">{{ __('deals.statuses.'.$deal->status) ?? ''}}</p>
                </div>

                <div class="form-group mb-3" >
                    <label for="" class="d-block mb-2"> {{ __('deals.payment_status') }} </label>
                    <p class="form-control">{{ __('deals.payment_statuses.'.$deal->payment_status) ?? ''}}</p>
                </div>

                <div class="form-group mb-3 items">
                    <div class="form-group mb-3">
                        <h5>{{ __('deals.payments') }}</h5>
                    </div>
                </div>
                <div class="form-group mb-3 items" id="items">
                    @foreach($payments as $key => $row)
                        @include('admin.deals.payments.show',['payment'=>$row,'key'=>$key])
                    @endforeach
                </div>


                <div class="form-group mb-3" id="products">
                    <label for="" class="d-block mb-2"> {{ __('deals.product_id') }} </label>
                    <p class="form-control">{{$deal->product->currentDescription->title ?? ''}}</p>
                </div>
                <div class="form-group mb-3" id="employees">
                    <label for="" class="d-block mb-2"> {{ __('deals.employee_id') }} </label>
                    <p class="form-control">{{$deal->employee->name ?? ''}}</p>
                </div>
                <div class="form-group mb-3" id="companies">
                    <label for="" class="d-block mb-2"> {{ __('deals.company_id') }} </label>
                    <p class="form-control">{{$deal->company->currentDescription->title ?? ''}}</p>
                </div>

                <div class="form-group mb-3" id="contact_lists">
                    <label for="" class="d-block mb-2"> {{ __('deals.contact_list_id') }} </label>
                    <p class="form-control">{{$deal->contactList->currentDescription->title ?? ''}}</p>
                </div>
                @foreach($languages as $language)
                    <div class="col-lg-6">
                        <div class="form-group mb-3">
                            <label for="" class="d-block mb-2"> {{ __('deals.title') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} <span style="color:red">*</span></label>
                            <p class="form-control">{{ $deal[$language->local]->title ?? ''}}</p>
                        </div>
                    </div>
                    <div class="col-lg-12">
                        <div class="form-group mb-3">
                            <label for="" class="d-block mb-2"> {{ __('deals.description') }} {{ count($languages) > 1 ? "({$language->name})" : '' }} </label>
                            <p class="form-control">{{ $deal[$language->local]->description ?? ''}}</p>
                        </div>
                    </div>
                @endforeach

                @if($deal->file_url)
                    <div class="form-group mb-3">
                        <label for="" class="d-block mb-2"> {{ __('deals.file_url') }} <span style="color:red">*</span></label>
                        <p class="form-control">{{ $deal->file_url ?? ''}}</p>
                    </div>
                @endif


                @if(isset($deal) && ($deal->file ?? false) )
                    <div class="form-group mb-3">
                        <a href="{{asset($deal->file)}}" download class="blue-butn butn-st2 butn-md"><span> {{__('deals.download')}} </span></a>
                    </div>
                @endif
            </div>
        </div>
    </div>


<script>
    const dropdowns = document.querySelectorAll('.dropdown-select');
    dropdowns.forEach(dropdown => {
        const checkboxes = dropdown.querySelectorAll('.cat-selects input[type="checkbox"], .cat-selects input[type="radio"]');
        checkboxes.forEach(checkbox => {
            checkbox.addEventListener('change', function() {
                const dropdownButton = dropdown.querySelector('.cat-selected');
                dropdownButton.querySelectorAll('.cat-txt:not(:first-child)').forEach(el => el.remove());

                checkboxes.forEach(cb => {
                    if (cb.checked) {
                        const label = cb.nextElementSibling.innerText;
                        const newText = document.createElement('span');
                        newText.classList.add('cat-txt', 'me-1');
                        newText.textContent = label;
                        dropdownButton.appendChild(newText);
                    }
                });
            });
        });
    });

    $(".don-btn").on("click", function(){
        $(this).parents(".dropdown-menu").removeClass("show")
    })
    // Select all elements with the 'prevent-close' class
    document.querySelectorAll('.dropdown-select .dropdown-menu').forEach(function(element) {
        element.addEventListener('click', function(event) {
            event.stopPropagation(); // Prevents the dropdown menu from closing
        });
    });
</script>

    <script>



    function SelecStatus()
    {
        let status = $('#payment_status').html()
        if(status != 1)
        {
            $('.items').show()
        }
        else
        {
            $('.items').hide()
        }
    }
    SelecStatus()

</script>

