@extends('layouts.app')
@section('title','Registrasi')
@section('content')
    <section class="section">
        <div class="section-header">
        <h1>Registrasi Kelompok</h1>
        <div class="section-header-breadcrumb">
        </div>
        </div>

        <form class="needs-validation" novalidate="" method="POST" action="{{ route('group.kegiatan')}}" enctype="multipart/form-data">
        <div class="section-body">
            @csrf
            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-6 form-group" @if ($errors->has('nama')) has-error @endif>
                                    <label>Nama</label>
                                    <input type="text" id="nama" name="nama" class="form-control" required="" placeholder="" value="{{ old('nama')}}">
                                    @if ($errors->has('nama'))
                                        <label id="login-error" class="error" for="nama" style="color: red">{{$errors->first('nama')}}</label>
                                    @endif
                                </div>
                                <div class="col-6 form-group" @if ($errors->has('nik')) has-error @endif>
                                    <label>NIK</label>
                                    <input type="text" id="nik" name="nik" class="form-control" required="" placeholder="" value="{{ old('nik')}}">
                                    @if ($errors->has('nik'))
                                        <label id="login-error" class="error" for="nik" style="color: red">{{$errors->first('nik')}}</label>
                                    @endif
                                </div>
                            </div>
                                <div class="row">
                                    <div class="col-6 form-group" @if ($errors->has('email')) has-error @endif>
                                        <label>E-mail</label>
                                        <div class="input-group">
                                            <div class="input-group-prepend">
                                                <div class="input-group-text">
                                                    <i class="fas fa-envelope"></i>
                                                </div>
                                            </div>
                                            <input type="email" id="email" name="email" class="form-control email" required="" placeholder="" value="{{ old('email')}}">
                                        </div>
                                        @if ($errors->has('email'))
                                            <label id="login-error" class="error" for="nama_depan" style="color: red">{{$errors->first('email')}}</label>
                                        @endif
                                    </div>
                                    <div class="col-6 form-group" @if ($errors->has('telepon')) has-error @endif>
                                        <label>Telepon</label>
                                        <div class="input-group">
                                            <div class="input-group-prepend">
                                                <div class="input-group-text">
                                                    <i class="fas fa-phone"></i>
                                                </div>
                                            </div>
                                            <input type="number" id="telepon" name="telepon" class="form-control number" required="true" placeholder="" value="{{ old('telepon')}}">
                                        </div>
                                        @if ($errors->has('telepon'))
                                            <label id="login-error" class="error" for="telepon" style="color: red">{{$errors->first('telepon')}}</label>
                                        @endif
                                    </div>
                            </div>
                            <div class="form-group" @if ($errors->has('instansi')) has-error @endif>
                                <label>Instansi</label>
                                    <div class="input-group">
                                        {{-- <input type="text" id="instansi" name="instansi" class="form-control number" required="true" placeholder="" value="{{ old('instansi')}}"> --}}
                                        <select class="form-control select" id="instansi" name="instansi"placeholder="">
                                            <option value="" selected>- Pilih -</option>
                                            {{-- @foreach ($universitas as $univ)
                                                <option value="{{ $univ['nm_lemb'] }}">{{ $univ['nm_lemb'] }}</option>
                                            @endforeach --}}
                                            <option value="Universitas Negeri Padang">Universitas Negeri Padang</option>
                                            <option value="Universitas Negeri Manado">Universitas Negeri Manado</option>
                                            <option value="Universitas Negeri Surabaya">Universitas Negeri Surabaya</option>
                                            <option value="Universitas Negeri Semarang">Universitas Negeri Semarang</option>
                                            <option value="Universitas Pendidikan Ganesha">Universitas Pendidikan Ganesha</option>
                                            <option value="Universitas Negeri Jakarta">Universitas Negeri Jakarta</option>
                                            <option value="Universitas Negeri Yogyakarta">Universitas Negeri Yogyakarta</option>
                                            <option value="Universitas Negeri Malang">Universitas Negeri Malang</option>
                                            <option value="Universitas Pendidikan Indonesia">Universitas Pendidikan Indonesia</option>
                                            <option value="Universitas Negeri Gorontalo">Universitas Negeri Gorontalo</option>
                                            <option value="Universitas Negeri Makassar">Universitas Negeri Makassar</option>
                                            <option value="Universitas Negeri Medan">Universitas Negeri Medan</option>

                                        </select>
                                    </div>
                                    @if ($errors->has('instansi'))
                                        <label id="login-error" class="error" for="instansi" style="color: red">{{$errors->first('instansi')}}</label>
                                    @endif
                            </div>
                            <div class="form-group" @if ($errors->has('jabatan')) has-error @endif>
                                <label>Jabatan</label>
                                    <div class="input-group">
                                        <input type="text" id="jabatan" name="jabatan" class="form-control email" required="true" placeholder="" value="{{ old('jabatan')}}">
                                    </div>
                                    @if ($errors->has('jabatan'))
                                        <label id="login-error" class="error" for="jabatan" style="color: red">{{$errors->first('jabatan')}}</label>
                                    @endif
                            </div>
                            <div class="row">
                                <div class="col-8 form-group" @if ($errors->has('alamat')) has-error @endif>
                                    <label>Alamat</label>
                                    <div class="input-group">
                                        <input type="text" id="alamat" name="alamat" class="form-control" required="true" placeholder="" value="{{ old('alamat')}}">
                                        {{-- <div class="invalid-feedback">Mohon isikan alamat lengkap Anda</div> --}}
                                    </div>
                                    @if ($errors->has('alamat'))
                                        <label id="login-error" class="error" for="alamat" style="color: red">{{$errors->first('alamat')}}</label>
                                    @endif
                                </div>
                                <div class="form-group" @if ($errors->has('kodepos')) has-error @endif>
                                    <label>Kode Pos</label>
                                    <input type="number" id="kodepos" name="kodepos" class="form-control number" required="true" placeholder="" value="{{ old('kodepos')}}">
                                    @if ($errors->has('kodepos'))
                                        <label id="login-error" class="error" for="kodepos" style="color: red">{{$errors->first('kodepos')}}</label>
                                    @endif
                                    {{-- <div class="invalid-feedback">Isikan Kode Pos yg sesuai</div> --}}
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-12">
                                    <div class="form-group" @if ($errors->has('kota')) has-error @endif>
                                        <label>Kota</label>
                                        <input type="text" id="kota" name="kota" class="form-control" required="" placeholder="" value="{{ old('kota')}}">
                                        @if ($errors->has('kota'))
                                            <label id="login-error" class="error" for="kota" style="color: red">{{$errors->first('kota')}}</label>
                                        @endif
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <div class="card-footer text-right">
                <button class="btn btn-primary mr-1" type="submit">Lanjutkan</button>
                <button class="btn btn-secondary" type="reset">Reset</button>
            </div>
        </div>
        </form>
    </section>
@endsection

@push('js')
    <script>
        $(document).ready(function () {
        //change selectboxes to selectize mode to be searchable
        $("#instansi").select2();
        });
    </script>
@endpush
