<?php $__env->startSection('title','Tambah SKMB'); ?>

<?php $__env->startSection('vendor-styles'); ?>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/plugins/forms/validation/form-validation.css')); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('vendors/css/forms/select/select2.min.css')); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('vendors/css/pickers/pickadate/pickadate.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-styles'); ?>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/pages/page-users.css')); ?>">
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<!-- users edit start -->
<section class="users-edit">
<form method="post" action="<?php echo e(route('skmb.store')); ?>" autocomplete="off" class="form" enctype="multipart/form-data">
    <?php echo csrf_field(); ?>
    <?php echo method_field('post'); ?>
    <div class="card">
        <div class="card-content">
        <div class="card-body">
            <div class="row">
                <div class="col-12 col-sm-6">
                    <div class="form-group">
                        <div class="controls">
                            <label>NIK</label>
                            <input id="nik" type="number" class="form-control <?php $__errorArgs = ['nik'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" class="form-control" name="nik" 
                                value="<?php echo e(auth()->user()->nik, old('nik')); ?>" readonly 
                                autocomplete="nik" autofocus placeholder="Nomor KTP">
                                <?php if($errors->has('nik')): ?>
                                <span class="invalid-feedback" role="alert">
                                    <strong><?php echo e($errors->first('nik')); ?></strong>
                                </span>
                                <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="col-12 col-sm-6">
                    <div class="form-group">
                        <div class="controls">
                            <label>Nama</label>
                            <input type="text" name="name" minlength="3" id="name" class="form-control" placeholder="Nama"
                                value="<?php echo e(auth()->user()->name, old('name')); ?>" readonly>
                                <?php if($errors->has('name')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('name')); ?></li>
                                    </ul>
                                </div>
                                <?php endif; ?>
                        </div>
                    </div>
                </div>
            </div>  
        </div>
        </div>
    </div>
    <div class="card">
        <div class="card-content">
        <div class="card-body">
            <div class="row">
                <div class="col-12">
                    <div class="form-group">
                        <div class="controls">
                            <label>Alamat Saat Ini</label>
                            <input type="text" name="alamat" minlength="3" id="alamat" class="form-control <?php $__errorArgs = ['alamat'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" placeholder="Alamat Saat Ini"
                                    value="<?php echo e(old('alamat')); ?>" required
                                    data-validation-required-message="Alamat Saat Ini wajib diisi."
                                    data-validation-minlength-message="Harus terdiri dari minimal 3 karakter.">
                                <?php if($errors->has('alamat')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('alamat')); ?></li>
                                    </ul>
                                </div>
                                <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="controls">
                            <label>RT</label>
                            <input type="text" id="rt" minlength="1" maxlength="4" class="form-control <?php $__errorArgs = ['rt'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="rt" placeholder="RT" 
                                value="<?php echo e(old('rt')); ?>" required
                                data-validation-required-message="RT wajib diisi."
                                data-validation-containsnumber-regex="(\d)+"
                                data-validation-containsnumber-message="Masukkan RT yang valid."
                                data-validation-minlength-message="Harus terdiri dari minimal 1 karakter."
                                data-validation-maxlength-message="Harus terdiri dari maksimal 4 karakter.">
                                <?php if($errors->has('rt')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('rt')); ?></li>
                                    </ul>
                                </div>
                                <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="controls">
                            <label>RW</label>
                            <input type="text" id="rw" minlength="1" maxlength="4" class="form-control <?php $__errorArgs = ['rw'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="rw" placeholder="RW" 
                                value="<?php echo e(old('rw')); ?>" required
                                data-validation-required-message="RW wajib diisi."
                                data-validation-containsnumber-regex="(\d)+"
                                data-validation-containsnumber-message="Masukkan RW yang valid."
                                data-validation-minlength-message="Harus terdiri dari minimal 1 karakter."
                                data-validation-maxlength-message="Harus terdiri dari maksimal 4 karakter.">
                                <?php if($errors->has('rw')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('rw')); ?></li>
                                    </ul>
                                </div>
                                <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="controls">
                            <label>Provinsi</label>
                            <select class="select2 form-control <?php $__errorArgs = ['provinsi'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="provinsi" name="provinsi" required>
                                <option value="" selected disabled>Pilih Provinsi</option>
                                <?php $__currentLoopData = $provinces; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($item->id ?? ''); ?>"><?php echo e($item->name ?? ''); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                            <?php if($errors->has('provinsi')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('provinsi')); ?></li>
                                    </ul>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="controls">
                            <label>Kabupaten / Kota</label>
                            <select class="select2 form-control <?php $__errorArgs = ['kabupaten_kota'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="kabupaten_kota" name="kabupaten_kota" required>
                                <option value="" selected disabled>Pilih Kabupaten / Kota</option>
                            </select>
                            <?php if($errors->has('kabupaten_kota')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('kabupaten_kota')); ?></li>
                                    </ul>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="controls">
                            <label>Kecamatan</label>
                            <select class="select2 form-control <?php $__errorArgs = ['kecamatan'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="kecamatan" name="kecamatan" required>
                                <option value="" selected disabled>Pilih Kecamatan</option>
                            </select>
                            <?php if($errors->has('kecamatan')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('kecamatan')); ?></li>
                                    </ul>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="controls">
                            <label>Desa / Kelurahan</label>
                            <select class="select2 form-control <?php $__errorArgs = ['desa_kelurahan'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="desa_kelurahan" name="desa_kelurahan" required>
                                <option value="" selected disabled>Pilih Desa / Kelurahan</option>
                            </select>
                            <?php if($errors->has('desa_kelurahan')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('desa_kelurahan')); ?></li>
                                    </ul>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="controls">
                            <label>Kode Pos</label>
                            <input type="text" id="kode_pos" minlength="4" maxlength="6" class="form-control <?php $__errorArgs = ['kode_pos'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" name="kode_pos" placeholder="Kode Pos" 
                                value="<?php echo e(old('kode_pos')); ?>" required
                                data-validation-required-message="Kode Pos wajib diisi."
                                data-validation-containsnumber-regex="(\d)+"
                                data-validation-containsnumber-message="Masukkan Kode Pos yang valid."
                                data-validation-minlength-message="Harus terdiri dari minimal 4 karakter."
                                data-validation-maxlength-message="Harus terdiri dari maksimal 6 karakter.">
                                <?php if($errors->has('kode_pos')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('kode_pos')); ?></li>
                                    </ul>
                                </div>
                                <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label>Scan KTP</label>
                        <div class="form-group">
                            <div class="controls">
                                <div class="custom-file">
                                    <input type="file" class="form-controll <?php $__errorArgs = ['scan_ktp'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> custom-file-input" id="scan_ktp" name="scan_ktp">
                                    <label class="custom-file-label" for="scan_ktp">Pilih foto</label>
                                    <small class="text-warning">Foto KTP diusakan jelas dan tidak terpotong.</small>
                                </div>
                                <?php if($errors->has('scan_ktp')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('scan_ktp')); ?></li>
                                    </ul>
                                </div>
                                <?php endif; ?>
                            </div>
                        </div>    
                    </div>
                    <div class="form-group">
                        <label>Scan KK</label>
                        <div class="form-group">
                            <div class="controls">
                                <div class="custom-file">
                                    <input type="file" class="form control <?php $__errorArgs = ['scan_kk'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> custom-file-input" id="scan_kk" name="scan_kk">
                                    <label class="custom-file-label" for="scan_kk">Pilih foto</label>
                                    <small class="text-warning">Foto KK diusakan jelas dan tidak terpotong.</small>
                                </div>
                                <?php if($errors->has('scan_kk')): ?>
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li><?php echo e($errors->first('scan_kk')); ?></li>
                                    </ul>
                                </div>
                                <?php endif; ?>
                            </div>
                        </div>    
                    </div>
                </div>
                <div class="col-12 d-flex flex-sm-row flex-column justify-content-start mt-1">
                    <button type="submit" class="btn btn-danger glow mb-1 mb-sm-0 mr-0 mr-sm-1">Simpan</button>
                    <button type="reset" class="btn btn-light">Cancel</button>
                </div>
            </div>
            
        </div>
        </div>
    </div>
</form>
</section>
<!-- users edit ends -->
<?php $__env->stopSection(); ?>


<?php $__env->startSection('vendor-scripts'); ?>
<script>
    function onChangeSelect(url, id, name) {
        // send ajax request to get the cities of the selected province and append to the select tag
        $.ajax({
            url: url,
            type: 'GET',
            data: {
                id: id
            },
            success: function (data) {
                $('#' + name).empty();
                $('#' + name).append('<option>Pilih Salah Satu</option>');

                $.each(data, function (key, value) {
                    $('#' + name).append('<option value="' + key + '">' + value + '</option>');
                });
            }
        });
    }
    $(function () {
        $('#provinsi').on('change', function () {
            onChangeSelect('<?php echo e(route("cities")); ?>', $(this).val(), 'kabupaten_kota');
        });
        $('#kabupaten_kota').on('change', function () {
            onChangeSelect('<?php echo e(route("districts")); ?>', $(this).val(), 'kecamatan');
        })
        $('#kecamatan').on('change', function () {
            onChangeSelect('<?php echo e(route("villages")); ?>', $(this).val(), 'desa_kelurahan');
        })
    });
</script>
<script src="<?php echo e(asset('vendors/js/forms/select/select2.full.min.js')); ?>"></script>
<script src="<?php echo e(asset('vendors/js/forms/validation/jqBootstrapValidation.js')); ?>"></script>
<script src="<?php echo e(asset('vendors/js/pickers/pickadate/picker.js')); ?>"></script>
<script src="<?php echo e(asset('vendors/js/pickers/pickadate/picker.date.js')); ?>"></script>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('page-scripts'); ?>
<script src="<?php echo e(asset('js/scripts/pages/page-users.js')); ?>"></script>
<script src="<?php echo e(asset('js/scripts/navs/navs.js')); ?>"></script>
<script src="<?php echo e(asset('js/scripts/forms/validation/form-validation.js')); ?>"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.contentLayoutMaster', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u1728740/public_html/e-surat/resources/views/skmb/create.blade.php ENDPATH**/ ?>