<?php
use App\Helpers\Helper;
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Surat Jaminan Akhir - {{ 1 }}</title>

    {{-- <link rel="stylesheet" href="{{ public_path('css/app.css') }}"> --}}
    
    {{-- @vite('resources/css/app.css') --}}
    {{----}}
    <?php ob_start(); ?>
    @vite('resources/css/app.css')
    <?php 
        $viteString = ob_get_contents();
        $publicPath = str_replace(env('APP_URL'),"/var/www/aso/public",$viteString);

        echo $publicPath;
        ob_end_clean();
    ?>
    {{----}}
    {{-- <link rel="stylesheet" href="/var/www/html/aso/public/build/assets/app-179954eb.css"> --}}

    <style>
        /* @font-face {
            font-family: Public Sans;
            src: url('{{asset('fonts/PublicSans-Medium.ttf')}}');
            src: url('{{asset('fonts/PublicSans-Medium.ttf')}}') format('truetype');
        } */
        @page {
            size: A4;
            margin: 0;
        }
        
        html, body {
            width: 210mm;
            height: 297mm;
            font-size: 12px !important;
        }
        @media print {
            html, body {
                width: 210mm;
                height: 297mm;
            }
        /* ... the rest of the rules ... */
        }

        body {
            font-family: 'Public Sans';
            color: #404040;
            font-size: 20px;
        }

        td {
            padding: 3px;
            vertical-align: top;
        }

        #member-detail{
            
        }
        #member-detail td {
            width: 50%;
            padding: 10px 0px;
        }
        #member-detail td>div{
            margin-bottom: 5px;
        }

        .benefit-table-wrapper {
            border: 1px solid #E0E0E0;
            border-radius: 5px;
            overflow: hidden;
        }
        #benefit-table {
            width: 100%;
            border-collapse: collapse;
        }

        #benefit-table th, #benefit-table th {
            width: 50%;
        }

        #benefit-table th{
            font-size: 20px;
            font-weight: 400;
            padding: 15px;
            text-align: left;
        }

        #benefit-table tr:first-child {
            background: #F5F5F5;
            border-bottom: 1px solid #E0E0E0;
        }

        #benefit-table td {
            padding: 15px;
            font-size: 20px;
        }
    </style>
</head>
<body>
    <table style="width: 100%">
        <tr><td colspan="99" style="text-align: center; font-weight: bold;font-size: 14px;">SURAT JAMINAN AKHIR</td></tr>
        <tr><td colspan="99" style="text-align: center"></td></tr>
        <tr><td colspan="99" style="text-align: center"></td></tr>
        <tr>
            <td style="width: 25%;">
                <span style="float: left;">Kepada</span>
                <span style="float: right;">:</span>
            </td>

            <td style="width: 25%">{{ $hospital->name ?? '' }}</td>
            
            <td style="width: 25%">
                <span style="float: left;">GOP Tanggal</span>
                <span style="float: right;">:</span>
            </td>
            <td style="width: 25%">{{ $claim->created_at ? (new DateTime($claim->created_at))->format('d-M-Y, H:i') : '' }}</td>
        </tr>
        <tr>
            <td>
                <span style="float: left;">Alamat</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ $hospital->address ?? '' }}</td>
            
            <td style="width: 25%">
                <span style="float: left;">GOP Nomor</span>
                <span style="float: right;">:</span>
            </td>
            <td style="width: 25%">{{ $claim->code ?? '' }}</td>
        </tr>
        <tr>
            <td>
                <span style="float: left;">No Telpon / Fax</span>
                <span style="float: right;">:</span>
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <span style="float: left;">Email</span>
                <span style="float: right;">:</span>
            </td>
            <td></td>
        </tr>
    </table>

    <p>Dengan ini jaminan diberikan kepada pasien yang juga merupakan tertanggung/peserta yang diasuransikan "Pasien" dengan data sebagai berikut</p>


    <table style="width: 100%">
        <tr><td colspan="99" style="background: red; padding-left: 30px; color: white">A. Identitas Pasien</td></tr>
        <tr>
            <td style="width: 25%">
                <span style="float: left;">1. Nama Pasien</span>
                <span style="float: right;">:</span>
            </td>
            <td style="width: 25%">{{ $member->name ?? '' }}</td>
            
            <td style="width: 25%">
                <span style="float: left;">7. Hak Kelas Kamar</span>
                <span style="float: right;">:</span>
            </td>
            <td style="width: 25%">{{ $member->room_class_coverage ?? '' }}</td>
        </tr>
        <tr>
            <td>
                <span style="float: left;">2. Tanggal Lahir</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ $member->birth_date ? (new DateTime($member->birth_date))->format('d-M-Y') : '' }}</td>

            <td>
                <span style="float: left;">8. Hak Kamar ICU</span>
                <span style="float: right;">:</span>
            </td>
            <td></td>
        </tr>
        <tr>
            <td>
                <span style="float: left;">3. Jenis Kelamin</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ ($member->gender ? 
                ($member->gender == 'female' ? 'Perempuan' 
                    : ($member->gender == 'male' ? 'Laki-Laki' 
                        : $member->gender) 
                ) : '') }}</td>
            
            <td>
                <span style="float: left;">9. No Polis</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ $member->payor_id ?? '' }}</td>
        </tr>
        <tr>
            <td>
                <span style="float: left;">4. Nomor e-KTP</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ $member->nric ?? ''}}</td>
            
            <td>
                <span style="float: left;">10. Nama PH / Perusahaan</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ $member->corporate_name ?? '' }}</td>
        </tr>
        <tr>
            <td>
                <span style="float: left;">5. Manfaat</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ $member->services ?? '' }}</td>
            
            <td>
                <span style="float: left;">11. Periode Polis</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ $member->periode_policy ? (new DateTime($member->periode_policy))->format('d-M-Y') : '' }}</td>
        </tr>
        <tr>
            <td>
                <span style="float: left;">6. Status Polis</span>
                <span style="float: right;">:</span>
            </td>
            <td>{{ $member->status_policy == 'active' ? 'Aktif' : 'Tidak Aktif' }}</td>
            
            <td>
                <span style="float: left;">12. Mata Uang</span>
                <span style="float: right;">:</span>
            </td>
            <td>IDR</td>
        </tr>

        <tr><td colspan="99" style="background: red; padding-left: 30px; color: white">B. Informasi Perawatan</td></tr>
        <tr>
            <td style="width: 25%">1. Tanggal Masuk</td>
            <td style="width: 25%">: {{ 1 }}</td>
            
            <td style="width: 25%">7. Lama Perawatan</td>
            <td style="width: 25%">: {{ 1 }}</td>
        </tr>
        <tr>
            <td>2. Tanggal Keluar</td>
            <td>: {{ 1 }}</td>

            <td>8. Kamar Perawatan</td>
            <td>: {{ "" }}</td>
        </tr>
        <tr>
            <td>3. Nama Rumah Sakit</td>
            <td>: {{ 1 }}</td>
            
            <td>9. Jumlah Tempat Tidur</td>
            <td>: {{ 1 }}</td>
        </tr>
        <tr>
            <td>4. Dokter yang Merawat</td>
            <td>: {{ 1 }}</td>
            
            <td>10. Estimasi Biaya Rawat Inap</td>
            <td>: {{ 1 }}</td>
        </tr>
        <tr>
            <td>5. No. Rekam Medis</td>
            <td>: {{ 1 }}</td>
            
            <td>11. Diagnosa</td>
            <td>: {{ 1 }}</td>
        </tr>

        
        <tr><td colspan="99" style="background: red; padding-left: 30px; color: white">C. Nilai Jaminan</td></tr>
        <tr>
            <td colspan="99">
                <table style="width: 100%" border="1">
                    <tr>
                        <th>Manfaat Polis</th>
                        <th>Biaya Diajukan</th>
                        <th>Biaya Dijamin</th>
                        <th>Biaya Tidak Dijamin</th>
                    </tr>
                    @foreach ($benefit as $item)    
                    <tr>
                        <td style="text-align:left">{{ $item->description }}</td>
                        <td style="text-align:center">{{ Helper::currencyIdrFormat($item->biaya_diajukan)}}</td>
                        <td style="text-align:center">{{ Helper::currencyIdrFormat($item->biaya_disetujui) }}</td>
                        <td style="text-align:center">{{ Helper::currencyIdrFormat($item->biaya_tidak_disetujui) }}</td>
                    </tr>
                    @endforeach
                </table>

                <p>Tidak Dijamin : Full Cover</p>
                <p>* Bila pasien menempati kamar perawatan di atas manfaat yang dimiliki maka pasien wajib membayar selisih yang timbul dan biaya yang tidak dijamin setelah menjalani perawatan Rumah Sakit</p>
            </td>
        </tr>

        
        <tr><td colspan="99" style="background: red; padding-left: 30px; color: white">D. Otorisasi Surat Jaminan</td></tr>
        <tr><td colspan="99">Surat Jaminan ini diotorisasi oleh PMN</td></tr>

        <tr>
            <td colspan="99">
                <table style="width: 100%;">
                    <tr>
                        <td style="max-width: {{1/3}}%; overflow: visible; text-align: center">
                            <span style="font-weight: bold;">Hormat Kami</span>
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                            (PRUMedical Network)
                        </td>
                        <td style="max-width: {{1/3}}%; overflow: visible; text-align: center">
                            Staff Administrasi Rumah Sakit
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                            (&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)
                        </td>
                        <td style="max-width: {{1/3}}%; overflow: visible; text-align: center">
                            PH/Pasien/Keluarga
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                            ({{ 1 }})
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>



    <div>
        <p><strong>*) Surat ini tidak memerlukan tanda tangan karena dicetak secara komputerisasi</strong></p>
    </div>

    <div style="width: 100%; text-align: right; font-size: 10px; color: #777; margin-top: 20px;"><span style="padding: 15px;">Generated by Primecenter Linksehat at {{ now() }}</span></div>
</body>
</html>