@extends('adminlte::page')
@section('title', 'Tambah Karyawan')
@section('content_header')
<h1 class="m-0 text-dark">Tambah Karyawan</h1>
@stop
@section('content')
<form action="{{route('karyawan.store')}}" method="post" enctype="multipart/form-data">
    @csrf
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <div class="form-group">
                        <label for="Nama">Nama Karyawan</label>
                        <input type="text" class="form-control @error('Nama') is-invalid @enderror" id="Nama" placeholder="Nama Karyawan" name="Nama" value="{{old('Nama')}}">
                        @error('Nama') <span class="text-danger">{{$message}}</span> @enderror
                    </div>
                    <div class="form-group">
                        <label for="Phone">Phone</label>
                        <input type="text" class="form-control @error('Phone') is-invalid @enderror" id="Phone" placeholder="Phone" name="Phone" value="{{old('Phone')}}">
                        @error('Phone') <span class="text-danger">{{$message}}</span> @enderror
                    </div>
                    <div class="form-group">
                        <label for="jabatan">Jabatan</label>
                        <select class="form-select @error('jabatan') isinvalid @enderror" id="jabatan" name="jabatan">
                            <option value="admin" @if(old('jabatan')=='admin' )selected @endif>
                                Admin</option>
                            <option value="project_manager" @if(old('jabatan')=='project_manager' )selected @endif>
                                Project Manager</option>
                        </select>
                    </div>

                </div>
            </div>
            <div class="card-footer">
                <button type="submit" class="btn btn-primary">Simpan</button>
                <a href="{{route('karyawan.index')}}" class="btn btn-default">
                    Batal
                </a>
            </div>
        </div>
    </div>
    </div>

    @stop