<?php if($individual->lastActiveIdCard() || $individual->lastActivePassport()): ?>
    <div class="box" id="address-residence-form">
        <div class="box-header">
            <h5 class="box-title"><?php echo e(__('forms.ResidenceAddress')); ?></h5>
        </div>
        <div class="box-body pb-2">
            
            <form action="<?php echo e(route('crm.individuals.addresses.storeResidence', $individual)); ?>" method="POST">
                <?php echo csrf_field(); ?>

                
                <input type="hidden" name="type" value="Residence">

                <div class="grid grid-cols-1 gap-x-6 mb-6">
                    <div>
                        <label for="residence_line_1" class="ti-form-label <?php $__errorArgs = ['residence.line_1'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> error <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                            <?php $__errorArgs = ['residence.line_1'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <?php echo e($message); ?>

                            <?php else: ?>
                                <?php echo e(__('forms.Address')); ?>

                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </label>
                        <input id="residence_line_1" type="text" name="residence[line_1]"
                            value="<?php echo e(old('residence.line_1')); ?>"
                            class="ti-form-input shadow-sm <?php $__errorArgs = ['residence.line_1'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> border-red-500 <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                            placeholder="<?php echo e(__('forms.Address')); ?>" <?php echo e($readonly ? 'disabled' : ''); ?>>
                    </div>
                </div>

                <div class="mb-6">
                    <label for="residence_city_id_create" class="ti-form-label <?php $__errorArgs = ['residence.city_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> error <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>">
                        <?php $__errorArgs = ['residence.city_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <?php echo e($message); ?>

                        <?php else: ?>
                            <?php echo e(__('forms.Town')); ?>

                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </label>
                    <select 
                        id="residence_city_id_create"
                        class="ti-form-select py-1 <?php $__errorArgs = ['residence.city_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> border-red-500 <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                        name="residence[city_id]"
                        <?php echo e($readonly ? 'disabled' : ''); ?>

                    >
                        <!-- City options -->
                    </select>
                </div>

                <?php if(!$readonly): ?>
                    <div class="flex justify-between">
                        <div>
                            <?php if(session()->has('message')): ?>
                                <div class="mt-4 text-green-600">
                                    <?php echo e(session('message')); ?>

                                </div>
                            <?php endif; ?>
                        </div>
                        <button type="submit" class="ti-btn ti-btn-outline-success py-1 px-3 mr-0">
                            <span><?php echo e(__('forms.Save')); ?></span>
                        </button>
                    </div>
                <?php endif; ?>
            </form>

        </div>
    </div>
<?php endif; ?>
<?php /**PATH C:\laragon\www\policypilot\resources\views/backend/crm/individuals/forms/address-residence-form.blade.php ENDPATH**/ ?>