<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Laporan Penilai Jaminan</title>

    @if ($statusLpj == 1)
        <style>
            * {
                font-family: Arial, Helvetica, sans-serif;
                font-size: 12px;
            }

            /** Define the header rules **/
            @page {
                margin-top: 100px;
                margin-bottom: 50px;

            }

            #header {
                position: fixed;
                top: -80px;
                left: 0;
                right: 0;
                height: 50px;
                text-align: center;
                padding-bottom: 10px;
            }

            .header-logo {
                position: absolute;
                left: 20px;
                top: 10px;
                max-height: 80px;
                max-width: 150px;
            }

            .header-title {
                margin-top: 20px;
            }

            #footer {
                position: fixed;
                bottom: -50px;
                left: 0;
                right: 0;
                height: 50px;
                text-align: center;
                border-top: 1px solid #ddd;
                padding-top: 10px;
                font-size: 12px;
            }

            .page-number:after {
                content: counter(page) " dari " counter(pages);
            }

            .content {
                margin-top: 10px;
            }

            .page-break {
                page-break-after: always;
            }

            #footer {
                position: fixed;
                bottom: -50px;
                left: 0;
                right: 0;
                height: 50px;
                text-align: left;
                border-top: 1px solid #ddd;
                padding-top: 10px;
            }

            body {
                margin-top: 3cm;
                margin-bottom: 120px;
                position: relative;
                z-index: 1;
            }
            .break-before {
            page-break-before: always;
            break-before: page;
        }
            .border {
                border: 1px solid #000;
            }

            .no-break {
            page-break-inside: avoid;
            page-break-before: auto;
            page-break-after: auto;

        }
        </style>
     @endif
</head>
{{-- @php
    $data = '';
    foreach ($permohonan->documents as $dokumen) {
        $data .= $dokumen->jenisJaminan->name . ', ';

        $penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
        $surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
        $teams = $permohonan->region->teams;

        if ($teams) {
            foreach ($teams as $team) {
                $team_users = $team->teamsUsers;
                // print_r($team_users);
                if ($team_users) {
                    foreach ($team_users as $team_user) {
                        $user = $team_user->user;

                        if ($user && $user->hasRole('senior-officer')) {
                            $senior_officer = $user;
                            break 3;
                        }
                    }
                }
            }
        }
    }
    use Modules\Usermanagement\Models\User;
    $penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();

    $data = rtrim($data, ', ');
@endphp --}}

<body style="width: 90%; margin: auto;">

    <header id="header">
        <table style="width: 100%; border: none;">
            <tr>
                <td style="width: 20%; text-align: left;" class="header-left">
                    @include('lpj::component.logo-bag', ['width' => 150, 'height' => 40])
                </td>
                <td style="text-align: right;">
                    <p style="margin: 0; padding:0; font-size:10px;">
                        Tanggal: {{ \Carbon\Carbon::parse(date('Y-m-d'))->format('d-m-Y') }}
                    </p>
                    <p style="margin: 0; padding:0; font-size:10px;">
                        Waktu: {{ \Carbon\Carbon::parse(date('H:i:s'))->format('H:i:s') }}
                    </p>
                    <p style="margin: 0; padding:0;  font-size:10px;">User: {{ Auth::user()->name }}</p>
                </td>
            </tr>
        </table>
    </header>
