@extends('layouts.app')
@section('title', 'Buat Data Responden')
@section('content')
    <!-- Button Back -->
    <a href="{{ URL::to('admin/respondens') }}" class="mb-3 badge text-bg-light text-primary">
        <i class="ti ti-arrow-left">&nbsp;</i> Kembali
    </a>

    <div class="row d-flex align-items-strech">
        <div class="col-lg-6 mx-auto">
            <div class="card">
                <div class="card-header">
                    <h3>Tambah Responden</h3>
                    @error('nik')
                        {{ $message }}
                    @enderror
                </div>
                <div class="card-body border-top">
                    <form method="post" action="{{ route('respondens.index') }}">
                        @csrf
                        @method('POST')
                        <div class="mb-3">
                            <label for="nik" class="form-label">NIK</label>
                            <input type="number" class="form-control @error('nik') is-invalid @enderror" id="nik"
                                name="nik" placeholder="Contoh: 3508293498272349" value="{{ old('nik') }}" required>
                            <div id="nik" class="form-text">Silahkan masukkan NIK dengan 16 angka unik.</div>
                            <!-- error message-->
                            @error('nik')
                                <div class="invalid-feedback">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                        <div class="mb-3">
                            <label for="name" class="form-label">Nama</label>
                            <input type="text" class="form-control @error('nama') is-invalid @enderror" id="name"
                                name="name" placeholder="Contoh: Ardito Pratama" value="{{ old('name') }}" required>
                            <div id="emailHelp" class="form-text">Silahkan masukkan nama lengkap anda.</div>
                            <!-- error message-->
                            @error('name')
                                <div class="invalid-feedback">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                        <div class="mb-3">
                            <label for="email" class="form-label">Email</label>
                            <input type="email" class="form-control @error('email') is-invalid @enderror" id="email"
                                name="email" value="{{ old('email') }}" placeholder="Contoh: ardito@mail.id" required>
                            <!-- error message -->
                            @error('email')
                                <div class="invalid-feedback">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                        <div class="mb-3">
                            <label for="gender" class="form-label">Jenis Kelamin</label>
                            <select class="form-select @error('gender') is-invalid @enderror" id="gender" name="gender"
                                required>
                                <option value="">Pilih Jenis Kelamin</option>
                                <option value="Laki - Laki" {{ old('gender') == 'Laki - Laki' ? 'selected' : '' }}>Laki -
                                    Laki</option>
                                <option value="Perempuan" {{ old('gender') == 'Perempuan' ? 'selected' : '' }}>Perempuan
                                </option>
                            </select>
                            <!-- error message -->
                            @error('gender')
                                <div class="invalid-feedback">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                        <div class="mb-3">
                            <label for="place_of_birth" class="form-label">Tempat Lahir</label>
                            <input type="text" class="form-control @error('place_of_birth') is-invalid @enderror"
                                id="place_of_birth" name="place_of_birth" value="{{ old('place_of_birth') }}"
                                placeholder="Contoh: Jakarta" required>
                            <!-- error message -->
                            @error('place_of_birth')
                                <div class="invalid-feedback">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                        <div class="mb-3">
                            <label for="date_of_birth" class="form-label">Tanggal Lahir</label>
                            <input type="date" class="form-control @error('date_of_birth') is-invalid @enderror"
                                id="date_of_birth" name="date_of_birth" value="{{ old('date_of_birth') }}" required>
                            <!-- error message -->
                            @error('date_of_birth')
                                <div class="invalid-feedback">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                        <div class="mb-3">
                            <label for="password" class="form-label">Password</label>
                            <input type="password" class="form-control  @error('password') is-invalid @enderror"
                                id="password" name="password" required>
                            <!-- error message -->
                            @error('password')
                                <div class="invalid-feedback">
                                    {{ $message }}
                                </div>
                            @enderror
                        </div>
                        <button type="submit" class="btn btn-primary">Simpan</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
@stop
