<h3 style="text-align: center;">DEMOGRAFI PELANGGAN BERDASARKAN JENIS PELANGGAN</h3>
<h4 style="text-align: center;">TAHUN <?= $tahun ?> <?= strtoupper($bulan) ?></h4>
<h4 style="text-align: center;"><?= strtoupper($nama_group) ?></h4>
<h4></h4>

<table width="100%" style="border-collapse:collapse;" border="1">
    <tr>
        <th>NO</th>
        <th>JENIS PELANGGAN</th>
        <th>JUMLAH</th>
        <th>NOMINAL</th>
    </tr>

    <?php 
        $no          = 0;
        $ttl_jumlah  = 0;
        $ttl_nominal = 0;
        foreach ($list as $field) {
            $no++;
            $ttl_jumlah  += $field->jumlah;
            $ttl_nominal += $field->nominal;
    ?>
            <tr>
                <td class="text-center"><?= $no ?></td>
                <td class="text-center"><?= ucfirst($field->kategori_pelanggan); ?></td>
                <td class="text-center"><?= $field->jumlah ?></td>
                <td class="text-center"><?= $field->nominal ?></td>
            </tr>
    <?php
        } 
    ?>

    <!-- FOOTER -->
    <tr>
        <td colspan="2">GRAND TOTAL</td>
        <td><?= $ttl_jumlah ?></td>
        <td><?= $ttl_nominal ?></td>
    </tr>
</table>
