<!-- Table with stripped rows -->
<table class="table table-hover" id="tabelku">
<thead>
<tr>
    <th scope="col">Kode Member</th>
    <th scope="col">Nama Member</th>
    <th scope="col">Total Nominal Belanja</th>
    <th scope="col">Total Perolehan Poin</th>
    <th scope="col">Total Perolehan Koin</th>
</tr>
</thead>
<tbody>
<?php
$total=0;
$poin=0;
$koin=0;
foreach ($arrkodemember as $key => $value) {
    if ($value=='' || @$arrnama[$value]=='') {
        continue;
    }
    $belanja=@array_sum($arrmember[$value]['total']);
    ?>
    <tr>
        <td><?php echo $value ?></td>
        <td><?php echo @$arrnama[$value] ?></td>
        <td><?php echo number_format($belanja,0,',','.') ?></td>
        <td><?php echo @array_sum($arrpoin[$value]) ?></td>
        <td><?php echo @array_sum($arrkoin[$value]) ?></td>
    </tr>
    <?php
    $total=$total+$belanja;
    $poin=$poin+@array_sum($arrpoin[$value]);
    $koin=$koin+@array_sum($arrkoin[$value]);
}
?>
</tbody>
<tfoot>
<tr>
    <th colspan="2">Total</th>
    <th><?php echo number_format($total,0,',','.') ?></th>
    <th><?php echo $poin ?></th>
    <th><?php echo $koin ?></th>
</tr>
</tfoot>
</table>
<!-- End Table with stripped rows -->
<script type="text/javascript">
$(document).ready(function() {
    $("#tabelku").DataTable({
        "processing":true,
        "serverSide":false,
        "responsive":true,
        "paging": false
    });
});
</script>