@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-12">
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb pb-3">
                    <li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
                    <li class="breadcrumb-item"><a href="{{ route('profile') }}">Maklumat Pengguna</a></li>
                    <li class="breadcrumb-item active" aria-current="page">Ubah Maklumat Pengguna</li>
                </ol>
            </nav>
            <div class="card">
                <form method="post" name="frmedit" action="{{ route('profile.editstore') }}">
                @csrf
                <div class="card-body text-center">
                    <div class="col-md-12" style="margin-right:auto;margin-left:auto">
                        <div class="row form-group">
                            <div class="col-md-6">
                                <div class="row form-group">
                                    <div class="col-md-6">Nama</div>
                                    <div class="col-md-6"><input type="text" name="nama" class="form-control @error('nama') is-invalid @enderror" value="{{ strtoupper($auth_user->name) }}">
                                        @error('nama') <span class="text-danger">{{ $message }}</span> @enderror
                                    </div>
                                    <div class="col-md-6">No Telefon</div>
                                    <div class="col-md-6"><input type="text" name="notel" class="form-control @error('notel') is-invalid @enderror" value="{{ $auth_user->no_telefon }}">
                                        @error('notel') <span class="text-danger">{{ $message }}</span> @enderror
                                    </div>
                                    <div class="col-md-6">Email</div>
                                    <div class="col-md-6"><input type="text" class="form-control" readonly value="{{ $auth_user->email }}"></div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="row form-group">
                                    <div class="col-md-6">No Kad Pengenalan</div>
                                    <div class="col-md-6"><input type="text" class="form-control" readonly value="{{ $auth_user->no_kp }}"></div>
                                    <div class="col-md-6">Jawatan</div>
                                    <div class="col-md-6"><input type="text" class="form-control" readonly value="{{ strtoupper($auth_user->role_harian) }}"></div>
                                    <div class="col-md-6">Baki Perubatan</div>
                                    <div class="col-md-6"><input type="text" class="form-control" readonly value="{{ 'RM '. number_format($auth_user->perubatan,2) }}"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-primary">Kemaskini Profil</button>
                </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection