<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-header">
                <div>
                    <span class="card-title"><i class="ri-git-repository-line"></i> {{ __('settings_name') }}</span>
                </div>
            </div>
            <div class="card-content">
                <form id="settingsForm">
                    <div class="row my-3">
                        <div class="col-12 mb-2">
                            <div class="form-check form-check-custom form-check-solid">
                                <input type="hidden" name="privacyprotection" value="0">
                                <input class="form-check-input" type="checkbox" value="1" name="privacyprotection" id="privacyprotection"{{ $updata['privacyprotection'] == 1 ? ' checked':'' }}>
                                <label class="form-check-label" for="privacyprotection">
                                    WHOis üzerinde yapılan sorgularda kişisel bilgilerinizi korumak için WHOis kilidini kullanabilirsiniz.
                                </label>
                            </div>
                        </div>
                        <div class="col-12 mb-2">
                            <div class="form-check form-check-custom form-check-solid">
                                <input type="hidden" name="idprotection" value="0">
                                <input class="form-check-input" type="checkbox" value="1" name="idprotection" id="idprotection"{{ $updata['idprotection'] == 1 ? ' checked':'' }}>
                                <label class="form-check-label" for="idprotection">
                                    Alan adınızın sadece sizin izniniz ile transfer edilebilmesi için aktif ediniz.
                                </label>
                            </div>
                        </div>
                        <div class="col-12 row-center row-flex">
                            <a href="#" class="btn btn-primary beCallRequestx" data-method="settings" data-form="settings">
                                {{ __('global_save') }}
                            </a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script>
    var wait = false;
    $(".beCallRequestx").on("click",function(){
        if(!wait){
            wait = true;
            var item = $(this);
            var content = item.html();
            item.html('<span class="btn-spinner mx-2"></span> Lütfen Bekleyiniz!');
            var method = item.data("method");
            var form = item.data("form");
            var data = item.data("data");
            var datacontent = "";
            if(form){
                datacontent = $("#"+form+"Form").serialize()+"&action="+method+"&upid={{ $userproduct['upid'] }}";
            }
            else{
                datacontent = data+"&action="+method+"&upid={{ $userproduct['upid'] }}";
            }
            $.ajax({
                url: "{{ beGetRoute('client.userproduct.userproduct.show.post') }}",
                type: "post",
                data: datacontent,
                dataType: "json",
                crossDomain: true,
                success: function(response){
                    wait = false;
                    item.html(content);
                    if(response.status){
                        $.Toast("Başarılı",response.message,"success");
                        if(response.refresh){
                            setTimeout(function(){
                                location.reload();
                            },1000);
                        }
                    }
                    else{
                        $.Toast("Bir Sorun Oluştu",response.message,"error");
                    }
                }
            });	
            return false;
        }
        else{
            $.Toast("Bir Sorun Oluştu","İşlem devam ediyor lütfen bekleyiniz","error");
        }
    });
</script>