@extends('layouts.app')
@section('title', 'SPK Penerimaan Karyawan ', $alternatif->nama_alternatif)
@section('content')
    <div class="row">
        <div class="col-md-4">
            <div class="card shadow mb-4">
                <!-- Card Header - Accordion -->
                <a href="#tambahkriteria" class="d-block card-header py-3" data-toggle="collapse"
                role="button" aria-expanded="true" aria-controls="collapseCardExample">
                <h6 class="m-0 font-weight-bold text-primary">Edit Alternatif {{ $alternatif->nama_alternatif }}</h6>
                </a>
            
            <!-- Card Content - Collapse -->
            <div class="collapse show" id="tambahkriteria">
                <div class="card-body">
                    @if (Session::has('msg'))
                    <div class="alert alert-info alert-dismissible fade show" role="alert">
                        <strong>Info</strong> {{ Session::get('msg') }}
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                          <span aria-hidden="true">&times;</span>
                        </button>
                      </div>
                    @endif

    <form action="{{ route('alternatif.update', $alternatif->id) }}" method="post">
    @csrf
    @method('put')
    <div class="form-group">
        <label for="nama_alternatif">Nama Alternatif</label>
        <input type="text" class="form-control @error ('nama_alternatif') is-invalid @enderror" name="nama_alternatif" value="{{ $alternatif->nama_alternatif }}">
        @error('nama_alternatif')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>

    <div class="form-group">
        <label for="usia">Usia</label>
        <input type="number" class="form-control @error ('usia') is-invalid @enderror" name="usia" value="{{ $alternatif->usia }}">
        @error('usia')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>

    <div class="form-group">
        <label for="pendidikan">Pendidikan</label>
        <input type="text" class="form-control @error ('pendidikan') is-invalid @enderror" name="pendidikan" value="{{ $alternatif->pendidikan }}">
        @error('pendidikan')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>

    <div class="form-group">
        <label for="ipk">IPK</label>
        <input type="number" step="0.01" class="form-control @error ('ipk') is-invalid @enderror" name="ipk" value="{{ $alternatif->ipk }}">
        @error('ipk')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>

    <div class="form-group">
        <label for="jurusan">Jurusan</label>
        <input type="text" class="form-control @error ('jurusan') is-invalid @enderror" name="jurusan" value="{{ $alternatif->jurusan }}">
        @error('jurusan')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>

    <div class="form-group">
        <label for="lama_studi">Lama Studi (tahun)</label>
        <input type="number" step="0.1" class="form-control @error ('lama_studi') is-invalid @enderror" name="lama_studi" value="{{ $alternatif->lama_studi }}">
        @error('lama_studi')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>

    <div class="form-group">
        <label for="pengalaman">Pengalaman Kerja (tahun)</label>
        <input type="number" class="form-control @error ('pengalaman') is-invalid @enderror" name="pengalaman" value="{{ $alternatif->pengalaman }}">
        @error('pengalaman')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>

    <div class="form-group">
        <label for="serkom">Sertifikasi Kompetensi</label>
        <select name="serkom" class="form-control @error('serkom') is-invalid @enderror">
            <option value="1" {{ $alternatif->serkom ? 'selected' : '' }}>Ya</option>
            <option value="0" {{ !$alternatif->serkom ? 'selected' : '' }}>Tidak</option>
        </select>
        @error('serkom')<div class="invalid-feedback">{{ $message }}</div>@enderror
    </div>

    <button class="btn btn-primary">Simpan</button>
    <a href="{{ route('alternatif.index') }}" class="btn btn-success">Kembali</a>
</form> 
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

@stop