@extends('layouts.contentLayoutMaster')

@section('title','Tambah SKD')

@section('vendor-styles')
<link rel="stylesheet" type="text/css" href="{{asset('css/plugins/forms/validation/form-validation.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('vendors/css/forms/select/select2.min.css')}}">
<link rel="stylesheet" type="text/css" href="{{asset('vendors/css/pickers/pickadate/pickadate.css')}}">
@endsection

@section('page-styles')
<link rel="stylesheet" type="text/css" href="{{asset('css/pages/page-users.css')}}">
@endsection

@section('content')
<!-- users edit start -->
<section class="users-edit">
<form method="post" action="{{ route('skd.store') }}" autocomplete="off" class="form" enctype="multipart/form-data">
    @csrf
    @method('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 @error('nik') is-invalid @enderror" class="form-control" name="nik" 
                                value="{{ auth()->user()->nik, old('nik') }}" readonly 
                                autocomplete="nik" autofocus placeholder="Nomor KTP">
                                @if ($errors->has('nik'))
                                <span class="invalid-feedback" role="alert">
                                    <strong>{{ $errors->first('nik') }}</strong>
                                </span>
                                @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="{{ auth()->user()->name, old('name') }}" readonly>
                                @if ($errors->has('name'))
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li>{{ $errors->first('name') }}</li>
                                    </ul>
                                </div>
                                @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">
                        <label>Scan KTP</label>
                        <div class="form-group">
                            <div class="controls">
                                <div class="custom-file">
                                    <input type="file" class="form-controll @error('scan_ktp') is-invalid @enderror 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>
                                @if ($errors->has('scan_ktp'))
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li>{{ $errors->first('scan_ktp') }}</li>
                                    </ul>
                                </div>
                                @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 @error('scan_kk') is-invalid @enderror 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>
                                @if ($errors->has('scan_kk'))
                                <div class="help-block text-danger">
                                    <ul role="alert">
                                        <li>{{ $errors->first('scan_kk') }}</li>
                                    </ul>
                                </div>
                                @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 -->
@endsection

{{-- vendor scripts --}}
@section('vendor-scripts')
<script src="{{asset('vendors/js/forms/select/select2.full.min.js')}}"></script>
<script src="{{asset('vendors/js/forms/validation/jqBootstrapValidation.js')}}"></script>
<script src="{{asset('vendors/js/pickers/pickadate/picker.js')}}"></script>
<script src="{{asset('vendors/js/pickers/pickadate/picker.date.js')}}"></script>
@endsection

{{-- page scripts --}}
@section('page-scripts')
<script src="{{asset('js/scripts/pages/page-users.js')}}"></script>
<script src="{{asset('js/scripts/navs/navs.js')}}"></script>
<script src="{{asset('js/scripts/forms/validation/form-validation.js')}}"></script>
@endsection