<!-- Table with stripped rows -->
<table class="table table-hover" id="tabelkeranjang">
<thead>
<tr>
    <th scope="col">Tanggal</th>
    <th scope="col">Kode Masuk</th>
    <th scope="col">Nomor Nota</th>
    <th scope="col">Nama Suplier</th>
    <th scope="col">Jumlah Hutang</th>
    <th scope="col">Sisa Hutang</th>
    <th scope="col">Terbayar</th>
    <th scope="col">Jatuh Tempo</th>
</tr>
</thead>
<tbody>
<?php
$jumhu=0;
$jumsisa=0;
$jumbayar=0;
foreach ($datahutang as $hasil) {
    $terbayar=$hasil->hutang-$hasil->sisa;
    ?>
    <tr>
        <td><?php echo date('d-m-Y',strtotime($hasil->tanggal)) ?></td>
        <td><a href="<?php echo base_url('transaksi/cetak_masuk?no='.$hasil->kode_masuk) ?>" target="_blank" title="Cetak struk"><?php echo $hasil->kode_masuk ?></a></td>
        <td><?php echo $hasil->no_nota ?></td>
        <td><?php echo $hasil->suplier ?></td>
        <td><?php echo number_format($hasil->hutang,0,',','.') ?></td>
        <td><?php echo number_format($hasil->sisa,0,',','.') ?></td>
        <td><?php echo number_format($terbayar,0,',','.') ?></td>
        <td><?php echo date('d-m-Y',strtotime($hasil->tempo)) ?></td>
    </tr>
    <?php
    $jumhu=$jumhu+$hasil->hutang;
    $jumsisa=$jumsisa+$hasil->sisa;
    $jumbayar=$jumbayar+$terbayar;
}
?>
</tbody>
<tfoot>
<tr>
    <th colspan="4">Jumlah Total</th>
    <th><?php echo number_format($jumhu,0,',','.') ?></th>
    <th><?php echo number_format($jumsisa,0,',','.') ?></th>
    <th><?php echo number_format($jumbayar,0,',','.') ?></th>
    <th></th>
</tr>
</tfoot>
</table>
<!-- End Table with stripped rows -->