<table style="margin-top: -10px; width: 100%;">
    <tr>
        <td style="margin-top: -10px; width: 20%;"><img src="<?= base_url('images/logo.png'); ?>" width="70" height="50"></td>
        <td style="margin-top: -10px; width: 80%; text-align:center;">
            <b style='font-size:18px;'><?= $abdulradjak['NamaPerusahaan']; ?></b><br>
            <?= $abdulradjak['AlamatPerusahaan']; ?><br>
            <small>Telp. <?= $abdulradjak['TeleponPerusahaan']; ?>, Fax : <?= $abdulradjak['FaxPerusahaan']; ?></small>
        </td>
    </tr>
</table>
<hr>
<br>

<table border="0" style="border-collapse: collapse; width:100mm">

    <tr>
        <td style='font-size:10px'>Case ID / No.MR</td>
        <td style='font-size:10px'>&nbsp;:&nbsp;&nbsp;&nbsp; </td>
        <td style='font-size:10px'><?= $dt['Case ID'] . '/' . $dt['PatientCode'] ?></td>
    </tr>
    <tr>
        <td style='font-size:10px'>Nama</td>
        <td style='font-size:10px'>&nbsp;:&nbsp;&nbsp;&nbsp; </td>
        <td style='font-size:10px'><?= $dt['PatientName']; ?></td>
    </tr>
    <tr>
        <td style='font-size:10px'>Tanggal Kunjungan</td>
        <td style='font-size:10px'>&nbsp;:&nbsp;&nbsp;&nbsp; </td>
        <td style='font-size:10px'><?= $dt['Intake Date']; ?></td>
    </tr>
    <tr>
        <td style='font-size:10px'>Tanggal Close</td>
        <td style='font-size:10px'>&nbsp;:&nbsp;&nbsp;&nbsp; </td>
        <td style='font-size:10px'><?= $dt['Closed Date']; ?></td>
    </tr>
    <tr>
        <td style='font-size:10px'>Penjamin</td>
        <td style='font-size:10px'>&nbsp;:&nbsp;&nbsp;&nbsp;</td>
        <td style='font-size:10px'><?= $dt['CompanyName']; ?></td>
    </tr>

</table>
<hr>
<br>
<small>
    <table border="0" style="border-collapse: collapse; width:100mm">
        <tr>
            <td>&nbsp;&nbsp;Deskripsi</td>
            <td>&nbsp;&nbsp;Jumlah</td>
            <td>&nbsp;&nbsp;&nbsp;Harga</td>
            <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Total</td>
        </tr>
        <?php
        foreach ($trxdata as $d) :
        ?>
            <tr>
                <td>&nbsp;&nbsp; <?= $d['Description']; ?></td>

                <td>&nbsp;&nbsp;&nbsp;&nbsp;<?= $d['Activity Count']; ?></td>
                <td>&nbsp;&nbsp;<?= number_format($d['Charge'], 0); ?></td>
                <td>&nbsp;&nbsp;<?= number_format($d['Total'], 0); ?></td>
            </tr>
        <?php
        endforeach; ?>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </table>
    <hr>
    <table>
        <?php
        foreach ($StatmentDetailNo as $data) :
        ?>
            <tr>
                <td><?= $data['Keterangan']; ?></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td>&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?= number_format($data['TotalDrugs'], 0); ?></td>
            </tr>
        <?php
        endforeach;
        ?>
    </table>
    <hr>
    <?php
    $sum = 0;
    $charge = 0;
    foreach ($StatmentDetail as $d) :
        $sum += $d['Ppn'];
        $charge += $d['Charge'];
        $total = $sum + $charge;
    ?>
    <?php endforeach; ?>
    <table>
        <tr>
            <td>Total Charge</td>
            <td>:</td>
            <td><?= $total; ?></td>
        </tr>
        <tr>
            <td>Total Bayar</td>
            <td>:</td>
            <td></td>
        </tr>
    </table>
    <hr>
    <table>
        <tr>
            <td>Harus Dibayar Pasien</td>
            <td>:</td>
            <td></td>
        </tr>
        <tr>
            <td><b><i>*(<?= terbilang($total); ?>)</i></b></td>
        </tr>
    </table>
</small>
<br>
<table>
    <tr>
        <td>
            &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;&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;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            Jakarta, <?= date('d-m-Y', strtotime($dt['Intake Date'])); ?><br>
        </td>
    </tr>
    <tr>
        <td>
            &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;&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;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            DiTerima Oleh,<br>
        </td>
    </tr>
    <tr>
        <td>
            <br>
        </td>
    </tr>
    <tr>
        <td>
            &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;&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;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <u>Petugas Kasir</u><br>
        </td>
    </tr>
</table>