@extends('component.app')
@section('title', 'Detail Pegawai')
@section('active5', 'active')
@section('menu1', 'open')
@section('content')

    <div class="content-wrapper">
        <div class="container-xxl flex-grow-1 container-p-y">
            <!-- Invoice List Table -->
            <div class="card">
                <div class="header-menu d-flex justify-content-start align-items-center">
                    <a href="{{ route('pegawai.index') }}" class=" ms-5"><i class="bx bx-left-arrow-alt"></i></a>
                    <h4 class="card-header">Detail Pegawai</h4>

                </div>
                <div class="card-body">
                    <div class="card shadow-sm border-0 rounded-lg">
                        <div class="row g-0">
                            <!-- Foto Profil -->
                            <div class="col-md-5 text-center p-4 ">
                                <div class="box bg-light  p-4">
                                    <img src="{{ asset('storage/img/' . $data->foto) }}"
                                        class="img-fluid rounded-circle shadow mb-3" alt=""
                                        style="width: 150px; height: 150px; object-fit: cover">
                                    <h5 class="card-title mt-2">{{ $data->nama }}</h5>
                                    <span class="badge bg-primary">{{ $data->laundry->nama_laundry }}</span>
                                </div>
                            </div>
                            <!-- Detail Profil -->
                            <div class="col-md-7">
                                <div class="card-body">
                                    {{-- <h6 class="card-subtitle mb-3 text-muted">Detail Pegawai</h6> --}}
                                    <ul class="list-group">
                                        <!-- Username -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>Username:</strong>
                                            <span>{{ $data->user->username }}</span>
                                        </li>
                                        <!-- Email -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>Email:</strong>
                                            <span>{{ $data->user->email }}</span>
                                        </li>
                                        <!-- No. Telp -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>No. Telp:</strong>
                                            <span>{{ $data->no_telp }}</span>
                                        </li>
                                        <!-- Nama -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>Nama:</strong>
                                            <span>{{ $data->nama }}</span>
                                        </li>
                                        <!-- Alamat -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>Alamat:</strong>
                                            <p class="mb-0">{{ $data->alamat }}</p>
                                        </li>
                                        <!-- Alamat -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>Gaji Pokok:</strong>
                                            <p class="mb-0">{{ 'Rp. ' . number_format((int) $data->gaji_pokok) }}</p>
                                        </li>
                                        <!-- Alamat -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>Komisi Harian:</strong>
                                            <p class="mb-0">{{ 'Rp. ' . number_format($data->komisi_harian, 0) }}</p>
                                        </li>
                                        <!-- Alamat -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>Komisi Paket:</strong>
                                            <p class="mb-0">
                                                {{ 'Rp. ' . number_format($pegawai_paket->first()->komisi_paket) }}</p>
                                        </li>

                                        <!-- Alamat -->
                                        <li class="list-group-item d-flex justify-content-between align-items-center">
                                            <strong>List Paket:</strong>
                                            <div class="boxnya">
                                                @foreach ($pegawai_paket as $pp)
                                                    <p class="mb-0" style="font-size: 12px">
                                                        {{ ' - ' . $pp->paket->nama_paket . ' (' . $pp->paket->satuan . ')' }}
                                                    </p>
                                                @endforeach
                                            </div>
                                        </li>

                                    </ul>
                                </div>
                            </div>

                        </div>
                    </div>

                </div>

            </div>
        </div>
    </div>

@endsection
