
<?php $__env->startSection('content'); ?>
<div class="main-header">
    <div class="admin-header">
        <div class="uk-grid">
            <div class="uk-width-1-1">
                <h1 class="main-heading"><?php echo e($title); ?></h1>
            </div>
        </div> 
    </div>
</div>
<div class="uk-margin uk-width-1-1 uk-margin-auto uk-card uk-card-default uk-card-body small-padding">
    <?php echo $__env->make('partials.messages', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
	<div uk-grid>
	    <div class="uk-width-1-2@s">
	        <h3 class="uk-text-bold">Personal Information</h3>
	        <?php if(auth()->user()->user_type == 1 || auth()->user()->user_type == 3): ?>
            	<?php echo e(Form::open(array('route' => 'update-profile','method' => 'POST', 'class' => 'form', 'id' => 'customer_register_form', 'files' => 'true'))); ?>

                    <?php echo csrf_field(); ?>
                    <div class="uk-margin-small">
                        <label for="name" class="uk-form-label">Name <span class="uk-text-danger">*</span></label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('name', $user->name,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="phone_number" class="uk-form-label">Phone Number</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('phone_number', $user->phone_number,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="email" class="uk-form-label">Email <span class="uk-text-danger">*</span></label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::email('email', $user->email,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <?php if(auth()->user()->user_type != 1): ?>
                    <div class="uk-margin-small">
                        <label for="profile_pic" class="uk-form-label">Profile Picture </label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::file('profile_pic', ['class' => 'uk-input','autocomplete' => 'off', 'accept' => '.jpg , .jpeg, .png'])); ?>

                            <?php if($user->profile_pic): ?>
                            <div uk-lightbox>
                                <a href="<?php echo e(url('storage/profile_pictures/realtor/'.$user->id.'/'.$user->profile_pic)); ?>" data-alt="Image"><span><img class="default-image uk-margin-small-top" src="<?php echo e(url('storage/profile_pictures/realtor/'.$user->id.'/'.$user->profile_pic)); ?>" /> <a class="remove-profile-pic uk-margin-left uk-text-danger" data-id="<?php echo e($user->id); ?>" href="javascript:void(0)"><i class="fa-solid fa-square-minus fa-xl"></i></a></span></a>
                            </div>
                            <?php endif; ?>
                        </div>    
                    </div>
                    <?php endif; ?>
                    <div class="uk-margin">
                        <button type="submit" class="uk-button uk-button-primary" id="customer_register_submit">Update</button>
                    </div>
                <?php echo e(Form::close()); ?>

            <?php endif; ?>
            <?php if(auth()->user()->user_type == 2): ?>
                <?php echo e(Form::open(array('route' => 'update-profile','method' => 'POST', 'class' => 'form', 'id' => 'realtor_register_form', 'files' => 'true'))); ?>

                <?php echo csrf_field(); ?>
                    <div class="uk-margin-small">
                        <label for="name" class="uk-form-label">Name <span class="uk-text-danger">*</span></label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('name', $user->name,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="phone_number" class="uk-form-label">Phone Number</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('phone_number', $user->phone_number,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="email" class="uk-form-label">Email <span class="uk-text-danger">*</span></label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::email('email', $user->email,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="address" class="uk-form-label">Address <span class="uk-text-danger">*</span></label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('address', $user->email,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div> 
                    <div class="uk-margin-small">
                        <label for="brokerage" class="uk-form-label">Brokerage</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('brokerage', $user->brokerage,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div> 
                    <div class="uk-margin-small">
                        <label for="real_estate_association" class="uk-form-label">Real Estate Association</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('real_estate_association', $user->real_estate_association,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div> 
                    <div class="uk-margin-small">
                        <label for="awards" class="uk-form-label">Awards</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('awards', $user->awards,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div> 
                    <div class="uk-margin-small">
                        <label for="website" class="uk-form-label">Website</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('website', $user->website,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="realtor" class="uk-form-label">Realtor Number</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('realtor', $user->realtor,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="bio" class="uk-form-label">Bio</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('bio', $user->bio,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="sports_played" class="uk-form-label">Sports Played</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('sports_played', $user->sports_played,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="interest_and_hobby" class="uk-form-label">Interests and hobbies</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('interest_and_hobby', $user->interest_and_hobby,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="uk-margin-small">
                        <label for="years_with_brokerage" class="uk-form-label">Years With Brokerage</label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::text('years_with_brokerage', $user->years_with_brokerage,['class' => 'uk-input','autocomplete' => 'off'])); ?>

                        </div>
                    </div>
                    <div class="additional-section">
                    <?php if(count($cityRanges) > 0): ?>
                    <?php $__currentLoopData = $cityRanges; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cityRange): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="uk-margin">
                        <?php if($key == 0): ?>
                        <label for="city" class="uk-form-label">City (Multiple Add) <span class="uk-text-danger">*</span></label>
                        <?php endif; ?>
                        <div class="uk-form-controls uk-margin-small-top">
                            <div class="city-section">
                                <div class="counter-section">
                                    <?php echo e(Form::hidden('city_id[]',$cityRange->id)); ?>

                                    <div class="uk-grid-small" uk-grid>
                                        <div class="uk-width-expand">
                                            <?php echo e(Form::text('city[]', $cityRange->city_name,['class' => 'uk-input city-autocomplete','autocomplete' => 'off','placeholder' => 'Name'])); ?>

                                            <span class="uk-text-danger city-error"></span>
                                        </div>
                                        <?php if($key == 0): ?>
                                        <div class="uk-width-auto uk-margin-small-top">
                                            <a class="uk-text-primary add-more-city" uk-tooltip="Add More City"><i class="fa-solid fa-circle-plus fa-xl"></i></a>
                                        </div>
                                        <?php else: ?>
                                        <div class="uk-width-auto uk-margin-small-top">
                                            <a class="uk-text-danger remove-city" uk-tooltip="Remove City"><i class="fa-solid fa-circle-minus fa-xl"></i></a>
                                        </div>
                                        <?php endif; ?>
                                    </div>
                                    <div class="uk-grid-small" uk-grid>
                                        <div class="uk-width-expand">
                                            <input class="uk-range" name="city_range[]" type="range" value="<?php echo e($cityRange->city_range); ?>" min="20" max="150" step="1" aria-label="Range">
                                        </div>
                                        <div class="uk-width-auto">
                                            <span><?php echo e($cityRange->city_range); ?> KM</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php else: ?>
                    <div class="uk-margin">
                        <label for="city" class="uk-form-label">City (Multiple Add) <span class="uk-text-danger">*</span></label>
                        <div class="uk-form-controls uk-margin-small-top">
                            <div class="city-section">
                                <div class="counter-section">
                                    <div class="uk-grid-small" uk-grid>
                                        <div class="uk-width-expand">
                                            <?php echo e(Form::text('city[]', '',['class' => 'uk-input city-autocomplete','autocomplete' => 'off','placeholder' => 'Name'])); ?>

                                            <span class="uk-text-danger city-error"></span>
                                        </div>
                                        <div class="uk-width-auto uk-margin-small-top">
                                            <a class="uk-text-primary add-more-city" uk-tooltip="Add More City"><i class="fa-solid fa-circle-plus fa-xl"></i></a>
                                        </div>
                                    </div>
                                    <div class="uk-grid-small" uk-grid>
                                        <div class="uk-width-expand">
                                            <input class="uk-range" name="city_range[]" type="range" value="20" min="20" max="150" step="1" aria-label="Range">
                                        </div>
                                        <div class="uk-width-auto">
                                            <span>20 KM</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <?php endif; ?>
                    </div>
                    <?php
                        $languages    = App\Models\Language::select('name')->where('status', 1)->orderBy('ordering', 'asc')->get();
                        $realtorYears = App\Models\RealtorYear::select('name')->where('status', 1)->orderBy('ordering', 'asc')->get();
                    ?>
                    <?php if($realtorYears->count() > 0): ?>
                        <div class="uk-margin">
                            <label for="years_of_realtor" class="uk-form-label"># of years as a realtor <span class="uk-text-danger">*</span></label>
                            <div class="uk-form-controls uk-margin-small-top">
                                <div class="uk-grid-small" uk-grid>
                                    <?php $__currentLoopData = $realtorYears; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $realtorYear): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="uk-width-auto">
                                            <div class="realtor-years-box <?php echo e($realtorYear->name == $user->realtor_year ? 'active' : ''); ?>" data-name="<?php echo e($realtorYear->name); ?>">
                                                <?php echo e($realtorYear->name); ?>

                                            </div>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            </div>
                            <span class="uk-text-danger years-realtor-error"></span>
                        </div>
                    <?php endif; ?>
                    <?php echo e(Form::hidden('years_of_realtor', $user->realtor_year)); ?>

                    <?php
                        $languageData = '';
                        if($user->language){
                            $languageData = json_decode($user->language, true);
                        }
                    ?>
                    <?php if($languages->count() > 0): ?>
                        <div class="uk-margin">
                            <label for="language" class="uk-form-label">Languages (Multiple Select)</label>
                            <div class="uk-form-controls uk-margin-small-top">
                                <div class="uk-grid-small" uk-grid>
                                    <?php $__currentLoopData = $languages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="uk-width-auto">
                                            <div class="language-box <?php echo e((is_array($languageData) && in_array($language->name, $languageData)) ? 'active' : ''); ?>" data-name="<?php echo e($language->name); ?>">
                                                <?php echo e($language->name); ?>

                                            </div>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            </div>
                            <div class="uk-margin-small <?php echo e((is_array($languageData) && in_array('Other', $languageData)) ? '' : 'uk-hidden'); ?> other-language">
                                <?php echo e(Form::text('other_language', $user->other_language,['class' => 'uk-input','autocomplete' => 'off','placeholder' => 'Other Language'])); ?>

                            </div>
                        </div>
                    <?php endif; ?>
                    <?php echo e(Form::hidden('language', $languageData ? implode(", ",$languageData) : '')); ?>

                    <div class="uk-margin-small">
                        <label for="profile_pic" class="uk-form-label">Profile Picture </label>
                        <div class="uk-form-controls">
                            <?php echo e(Form::file('profile_pic', ['class' => 'uk-input','autocomplete' => 'off', 'accept' => '.jpg , .jpeg, .png'])); ?>

                            <?php if($user->profile_pic): ?>
                            <div uk-lightbox>
                                <a href="<?php echo e(url('storage/profile_pictures/realtor/'.$user->id.'/'.$user->profile_pic)); ?>" data-alt="Image"><span><img class="default-image uk-margin-small-top" src="<?php echo e(url('storage/profile_pictures/realtor/'.$user->id.'/'.$user->profile_pic)); ?>" /> <a class="remove-profile-pic uk-margin-left uk-text-danger" data-id="<?php echo e($user->id); ?>" href="javascript:void(0)"><i class="fa-solid fa-square-minus fa-xl"></i></a></span></a>
                            </div>
                            <?php endif; ?>
                        </div>    
                    </div>
                    <div class="uk-margin">
                        <button type="submit" class="uk-button uk-button-primary" id="realtor_register_submit">Update</button>
                    </div>
                <?php echo e(Form::close()); ?>

            <?php endif; ?>
	    </div>
	    <div class="uk-width-1-2@s">
	        <h3 class="uk-text-bold">Change Password</h3>
	        <?php echo e(Form::open(array('route' => 'change-password','method' => 'POST', 'class' => 'uk-form-stacked','id' => 'change_password'))); ?>

            <?php echo csrf_field(); ?>
    	    <div class="uk-margin-small">
    	        <label for="password" class="uk-form-label">Current Password <span class="uk-text-danger">*</span></label>
                <div class="uk-form-controls">
                    <div class="uk-inline uk-width-1-1@m">
                       <a class="uk-form-icon uk-form-icon-flip eye-icon"><i class="fa-solid fa-eye-slash eye"></i></a>
                        <?php echo e(Form::password('old_password',['class' => 'uk-input password','autocomplete' => 'off','id' => 'password'])); ?>

                    </div>
                    <span class="uk-text-danger old-password-error"></span>
                </div>    
            </div>
            <div class="uk-margin-small">
    	        <label for="password" class="uk-form-label">New Password <span class="uk-text-danger">*</span></label>
                <div class="uk-form-controls">
                    <div class="uk-inline uk-width-1-1@m">
                       <a class="uk-form-icon uk-form-icon-flip confirm-eye-icon"><i class="fa-solid fa-eye-slash eye"></i></a>
                       <?php echo e(Form::password('new_password',['class' => 'uk-input confirm-password','autocomplete' => 'off','id' => 'newPassword'])); ?>

                    </div>
                    <span class="uk-text-danger new-password-error"></span>
                </div>    
            </div>
            <div class="uk-margin-small">
    	        <label for="password" class="uk-form-label">Re-Enter New Password <span class="uk-text-danger">*</span></label>
                <div class="uk-form-controls">
                    <div class="uk-inline uk-width-1-1@m">
                       <a class="uk-form-icon uk-form-icon-flip re-confirm-eye-icon"><i class="fa-solid fa-eye-slash eye"></i></a>
                        <?php echo e(Form::password('confirm_password',['class' => 'uk-input re-password','autocomplete' => 'off'])); ?>

                    </div>
                    <span class="uk-text-danger confirm-password-error"></span>
                </div>    
            </div>
            <div class="uk-margin">
                <div class="uk-form-controls">
                <?php echo e(Form::submit('Change Password', array('class' => 'uk-button uk-button-primary','name' => 'save', 'id' => 'change_submit'))); ?>

                </div>
            </div>
            <?php echo e(Form::close()); ?>

	    </div>
	</div>
</div>                   
<?php $__env->stopSection(); ?>
<?php $__env->startSection('footer-script'); ?>
<script src="https://maps.googleapis.com/maps/api/js?key=<?php echo e(env('MAP_KEY')); ?>&libraries=places"></script>
<script>

    function initializeAutocomplete(inputElement) {
        var options = {
            types: ['(cities)'],
            componentRestrictions: { country: ['us', 'ca'] }
        };
    
        var autocomplete = new google.maps.places.Autocomplete(inputElement, options);
    
        google.maps.event.addListener(autocomplete, 'place_changed', function() {
            var place = autocomplete.getPlace();
            if (!place.geometry) {
                return;
            }
        });
    }
    
    function initialize() {
        var inputs = document.getElementsByClassName('city-autocomplete');
        for (var i = 0; i < inputs.length; i++) {
            initializeAutocomplete(inputs[i]);
        }
    }
    
    google.maps.event.addDomListener(window, 'load', initialize);
    
    $(document).on("click",".eye-icon i.eye",function() {
        var passInput = $(".password");
        if(passInput.attr('type')==='password'){
            $(this).closest('a.eye-icon').html('<i uk-tooltip="Hide Password" class="fa-solid fa-eye eye"></i>');
            passInput.attr('type','text');
        }else{
            $(this).closest('a.eye-icon').html('<i uk-tooltip="Show Password" class="fa-solid fa-eye-slash eye"></i>');
            passInput.attr('type','password');
        }
    });
    
    $(document).on("click",".confirm-eye-icon i.eye",function() {
        var confirmpassInput = $(".confirm-password");
        if(confirmpassInput.attr('type')==='password'){
            $(this).closest('a.confirm-eye-icon').html('<i uk-tooltip="Hide Password" class="fa-solid fa-eye eye"></i>');
            confirmpassInput.attr('type','text');
        }else{
            $(this).closest('a.confirm-eye-icon').html('<i uk-tooltip="Show Password" class="fa-solid fa-eye-slash eye"></i>');
            confirmpassInput.attr('type','password');
        }
    });
    
    $(document).on("click",".re-confirm-eye-icon i.eye",function() {
        var confirmpassInput = $(".re-password");
        if(confirmpassInput.attr('type')==='password'){
            $(this).closest('a.confirm-eye-icon').html('<i uk-tooltip="Hide Password" class="fa-solid fa-eye eye"></i>');
            confirmpassInput.attr('type','text');
        }else{
            $(this).closest('a.confirm-eye-icon').html('<i uk-tooltip="Show Password" class="fa-solid fa-eye-slash eye"></i>');
            confirmpassInput.attr('type','password');
        }
    });
    
    $("#change_password").validate({
        errorClass: "uk-text-danger",
        rules:{
            old_password: {
    			required: true,
    		},
    		new_password: {
    		    required: true,
    			minlength: "6",
    		},
    		confirm_password: {
    		    required: true,
    			minlength: "6",
                equalTo: "#newPassword"
    		},
        },
        messages: {
            old_password:{
                required: "The current password field is required. "
            },
            new_password:{
                required: "The new password field is required. "
            },
            confirm_password:{
                required: "The confirm password field is required."
            },
        },
        errorPlacement: function(error, element) {
            if (element.attr("name") == "old_password") {
                error.insertBefore('.old-password-error');
            }
            else if (element.attr("name") == "new_password") {
                error.insertBefore('.new-password-error');
            }
            else if (element.attr("name") == "confirm_password") {
                error.insertBefore('.confirm-password-error');
            }else {
                error.insertAfter(element);
            }
        },
        submitHandler: function(form) {
            $('#change_submit').attr('disabled',true);
            form.submit();
        }
    });

    $("#customer_register_form").validate({
        errorClass: "uk-text-danger",
        rules:{
            name:"required",
            email: {
				required: true,
				email:true,
				remote:{
                    url: '<?php echo e(url("check-email")); ?>',
                    type: "post",
                    data:{'userId': <?php echo e(auth()->user()->id); ?>}
                }
			},
			password: {
				minlength: 6,
			}
        },
        messages: {
            name: {
                required: "Complete this required field."
            },
            email: {
                required: "Complete this required field.",
                remote:"This email is already exist."
            },
        },
        submitHandler: function(form) {
            $('#customer_register_submit').attr('disabled',true);
            form.submit();
        }
    });
    
    $("#realtor_register_form").validate({
        errorClass: "uk-text-danger",
        rules:{
            name:"required",
            terms_service:"required",
            address:"required",
            email: {
				required: true,
				email:true,
				remote:{
                    url: '<?php echo e(url("check-email")); ?>',
                    type: "post",
                    data:{'userId': <?php echo e(auth()->user()->id); ?>}
                }
			},
			password: {
				required: true,
				minlength: 6,
			},
			password_confirmation: {
                required: true,
                minlength: 6,
                equalTo: "#realtor-password"
            },
            'city[]': {
                required: true
            }
        },
        messages: {
            name: {
                required: "Complete this required field."
            },
            email: {
                required: "Complete this required field.",
                remote:"This email is already exist."
            },
            password: {
                required: "Complete this required field."
            },
            password_confirmation: {
                required: "Complete this required field."
            },
            address: {
                required: "Complete this required field."
            },
            terms_service: {
                required: "Please accept Terms and Conditions."
            },
            'city[]': {
                required: "Please enter the city name."
            }
        },
        submitHandler: function(form) {
            var error = 0;
            const yearsOfRealtor = $('input[name=years_of_realtor]').val();
            if(!yearsOfRealtor){
                $('.years-realtor-error').html('Please select # of years as a realtor');
                error = 1;
                return false;
            }
            $("input[name='city[]']").each(function () {
                if(!$(this).val()){
                    $(this).closest('div').find('.city-error').html('Please enter the city name.');
                    error = 1;
                }
            });
            if(error == 0){
                $('#realtor_register_submit').attr('disabled',true);
                form.submit();
            }else{
                return false;
            }
        }
    });
    
    $(document).on("click",".realtor-years-box",function() {
        $('.realtor-years-box').removeClass('active');
        $(this).addClass('active');
        $('input[name=years_of_realtor]').val($(this).data('name'));
    });
    
    $(document).on("click", ".language-box", function() {
        var language = $(this).data('name');
    
        if ($(this).hasClass('active')) {
            $(this).removeClass('active');
            if (language == 'Other') {
                $('.other-language').addClass('uk-hidden');
                $('input[name="other_language"]').val('');
            }
        } else {
            $(this).addClass('active');
            if (language == 'Other') {
                $('.other-language').removeClass('uk-hidden');
                $('input[name="other_language"]').val('');
            }
        }
    
        var languageList = '';
        $(".language-box.active").each(function() {
            languageList += ', ' + $(this).data('name');
        });
    
        languageList = languageList.substring(2);
    
        $('input[name="language"]').val(languageList);
    });
    
    $(document).on("change",".uk-range",function() {
        $(this).closest('.uk-grid-small').find('span').html($(this).val()+' KM');
    });
    
    var cityHtml = '';
    cityHtml += '<div class="uk-margin-small-top counter-section">';
    cityHtml += '<div class="uk-grid-small" uk-grid>';
    cityHtml += '<div class="uk-width-expand">';
    cityHtml += '<input name="city[]" value="" class="uk-input city-autocomplete" autocomplete="off" placeholder="Name">';
    cityHtml += '<span class="uk-text-danger city-error"></span>';
    cityHtml += '</div>';
    cityHtml += '<div class="uk-width-auto uk-margin-small-top">';
    cityHtml += '<a class="uk-text-danger remove-city" uk-tooltip="Remove City"><i class="fa-solid fa-circle-minus fa-xl"></i></a>';
    cityHtml += '</div>';
    cityHtml += '</div>';
    cityHtml += '<div class="uk-grid-small" uk-grid>';
    cityHtml += '<div class="uk-width-expand">';
    cityHtml += '<input class="uk-range" name="city_range[]" type="range" value="20" min="20" max="150" step="1" aria-label="Range">';
    cityHtml += '</div>';
    cityHtml += '<div class="uk-width-auto">';
    cityHtml += '<span>20 KM</span>';
    cityHtml += '</div>';
    cityHtml += '</div>';
    cityHtml += '</div>';
    
    $(document).on("click",".add-more-city",function() {
        $(this).closest('.additional-section').append(cityHtml);
        initialize();
    });
    
    $(document).on("click",".remove-city",function() {
        $(this).closest('.counter-section').remove();
    });
    
    $(document).on('click','.remove-profile-pic',function(){
        var clst = $(this).closest('div');
        var id   = $(this).data('id');
        UIkit.modal.confirm('Are you sure you want to remove this profile picture?').then(function() {
            $.ajax(
            {
                url: "<?php echo e(url('/admin/profile-picture-remove')); ?>",
                type: 'POST',
                dataType: "JSON",
                data: {
                    'id': id,
                },
                success: function (res)
                {
                    if(res.success == 1){
                	    UIkit.modal.alert('Profile picture successfully remove.');
                        clst.remove();
                    }
                    if(res.success == 0){
                        UIkit.modal.alert(res.error);
                    }
                },
                error:function()
                {
                    UIkit.modal.alert('Oops!<br>Something went wrong. Please try again later.');
                }
            });
        }, function () {
        });
    });
    
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/kelowna/public_html/listingllama.kelowna.website/resources/views/edit_profile/edit.blade.php ENDPATH**/ ?>