@extends('layouts.app_operasi')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-12">
            <div class="card">
                
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb pb-3">
                        <li class="breadcrumb-item"><a href="{{ url('/') }}">Home</a></li>
                        <li class="breadcrumb-item" aria-current="page"><a href="{{ (Auth::user()->roles == 'admin') ? route('admin.daftar.kakitangan') : route('daftar.kakitangan') }}">Kakitangan</a></li>
                      <li class="breadcrumb-item active" aria-current="page">Edit Maklumat Kakitangan</li>
                    </ol>
                </nav>

                <div class="card-body text-center">
                    <form action="{{ (Auth::user()->roles == 'admin') ? route('admin.kakitangan.edit.store') :  route('operasi.kakitangan.edit.store') }}" method="post">
                        @csrf
                        <input type="hidden" name='user_id' id='user_id' readonly value="{{ $user->id }}" class='form-control'>
                        <div class='row form-group'>
                            <div class='col-md-6'>
                                <div class='form-group row col-md-12'>
                                    <div class='col-md-5'>
                                        <b>Nama</b>
                                    </div>
                                    <div class='col-md-7'>
                                        <input type="text" name='nama' id='nama' value="{{ $user->name }}" class='form-control'>
                                    </div>
                                </div>
                                <div class='form-group row col-md-12'>
                                    <div class='col-md-5'>
                                        <b>Email</b>
                                    </div>
                                    <div class='col-md-7'>
                                        <input type="text" name='email' id='email' value="{{ $user->email }}" class='form-control'>
                                    </div>
                                </div>
                                <div class='form-group row col-md-12'>
                                    <div class='col-md-5'>
                                        <b>Baki Perubatan</b>
                                    </div>
                                    <div class='col-md-7'>
                                        <input type="text" name='perubatan' id='perubatan' value="{{ number_format($user->perubatan,2) }}" class='form-control'>
                                    </div>
                                </div>
                            </div>
                            <div class='col-md-6'>
                                <div class='form-group row col-md-12'>
                                    <div class='col-md-5'>
                                        <b>No KP</b>
                                    </div>
                                    <div class='col-md-7'>
                                        <input type="text" name='nokp' id='nokp' value="{{ $user->no_kp }}" class='form-control'>
                                    </div>
                                </div>
                                <div class='form-group row col-md-12'>
                                    <div class='col-md-5'>
                                        <b>No Telefon</b>
                                    </div>
                                    <div class='col-md-7'>
                                        <input type="text" name='telefon' id='telefon' value="{{ $user->no_telefon }}" class='form-control'>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class='row justify-content-end'>
                            <div class='col-md-12'>
                                <input type="submit" class='btn btn-info float-right mr-5' value='Update'>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection