@extends('layouts.app')

@section('content')
    <!--begin::App Content Header-->
    <div class="app-content-header"> <!--begin::Container-->
        <div class="container-fluid">
            <!--begin::Row-->
            <div class="row">
                <div class="col-sm-6">
                    <h3 class="mb-0">View Form Daily 4.8 Entry</h3>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-end">
                        <li class="breadcrumb-item"><a href="{{ route('admin.dashboard') }}">Home</a></li>
                        <li class="breadcrumb-item"><a href="{{ route('form48.daily.index') }}">Form 4.8 List</a></li>
                        <li class="breadcrumb-item active">View Form Daily 4.8</li>
                    </ol>
                </div>
            </div>
            <!--end::Row-->
        </div> <!--end::Container-->
    </div>
    <!--end::App Content Header-->

    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    <h3 class="card-title">Entry ID: {{ $worker->id }}</h3>
                </div>
                <div class="card-body">
                    <p><strong>Nama Pekerja:</strong> {{ $worker->nama_pekerja }}</p>
                    <p><strong>Tarikh Lahir:</strong> {{ $worker->tarikh_lahir }}</p>
                    <p><strong>No Kad Pengenalan:</strong> {{ $worker->no_ic_passport }}</p>
                    <p><strong>Jantina:</strong> {{ $worker->jantina }}</p>
                    <p><strong>Negara Asal:</strong> {{ $worker->negara_asal }}</p>
                    <p><strong>Rekod Latihan:</strong></p>
                    <ul>
                        @foreach ($worker->rekodLatihan as $latihan)
                            <li>{{ $latihan->training_date }} - {{ $latihan->jenis_latihan }}
                                ({{ $latihan->penganjur_penceramah }})</li>
                        @endforeach
                    </ul>

                    <!-- Rekod Kesihatan -->
                    <p><strong>Rekod Kesihatan:</strong></p>
                    <ul>
                        @foreach ($worker->rekodKesihatan as $kesihatan)
                            <li>{{ $kesihatan->health_date }} - {{ $kesihatan->nama_klinik_hospital }}
                                ({{ $kesihatan->justifikasi_pemeriksaan }} - {{ $kesihatan->rawatan_diperolehi }})</li>
                        @endforeach
                    </ul>
                    <p><strong>Nama Operator:</strong> {{ $worker->nama_operator }}</p>
                    <a href="{{ route('form48.daily.index') }}" class="btn btn-secondary">Back to List</a>
                </div>
            </div>
        </div>
    </div>
@endsection
