<h3 style="text-align: center;">DEMOGRAFI PELANGGAN BERDASARKAN KOTA</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>PROVINSI</th>
        <th>KOTA</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->nama_provinsi); ?></td>
                <td class="text-center"><?= ucfirst($field->nama_kota); ?></td>
                <td class="text-center"><?= $field->jumlah ?></td>
                <td class="text-center"><?= $field->nominal ?></td>
            </tr>
    <?php
        } 
    ?>

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