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

<head>
    <meta charset="UTF-8">
    <title>Report</title>
    <style>
        body {
            font-family: Poppins, sans-serif;
            font-size: 10px;
            line-height: 1.5;
        }

        .box {
            border: 1px solid #ccc;
            padding: 10px;
            margin-bottom: 10px;
        }

        .table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }

        .table th,
        .table td {
            border: 1px solid #ddd;
            padding: 6px;
            text-align: left;
        }

        .table th {
            background: #f5f5f5;
        }

        .right {
            text-align: right;
        }
    </style>
</head>

<body>
    <table width="100%">
        <tr>
            <td style="width: 50%;">
                <h2>ANNISA SYAR'I</h2>
                <p>Jl. Kenangan No 2a, Pasuruan<br>Telp: 0812-3468-03251</p>
            </td>
        </tr>
    </table>
    <hr>

    <center>
        <h2 style="font-weight: bold; margin-top:1rem; margin-bottom: 2rem;">LAPORAN PERIODE<br><?= $order->periode ?></h2>
    </center>
    <table class="table">
        <thead>
            <tr>
                <th>NO ORDER</th>
                <th>CUSTOMER</th>
                <th>TOTAL ORDER</th>
                <th>STATUS PEMBAYARAN</th>
                <th>NOMINAL DP</th>
                <th>NOMINAL PELUNASAN</th>
                <th>SISA PEMBAYARAN</th>
            </tr>
        </thead>
        <tbody>
            <?php $no = 1;
            foreach ($items as $item): ?>
                <tr>
                    <td><?= $no++ ?></td>
                    <td><?= $item->nama ?></td>
                    <td><?= $item->total_order ?></td>
                    <td>
                        <?php if ($item->status_pelunasan == 2): ?>
                            SUDAH DIBAYAR
                        <?php elseif ($item->status_pelunasan == 1): ?>
                            DP
                        <?php else: ?>
                            BELUM DIBAYAR
                        <?php endif; ?>
                    </td>
                    <td class="right">Rp. <?= number_format($item->dp_pembayaran, 0, ",", ".") ?></td>
                    <td class="right">Rp. <?= number_format($item->nominal_pelunasan, 0, ",", ".") ?></td>
                    <td class="right">Rp. <?= number_format($item->sisa_pembayaran, 0, ",", ".") ?></td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>

</body>

</html>