<!-- Table with stripped rows -->
<table class="table table-hover" id="tabelkeranjang">
<thead>
<tr>
    <th scope="col">Tanggal</th>
    <th scope="col">Faktur Jual</th>
    <th scope="col">Kode Member</th>
    <th scope="col">Nama Member</th>
    <th scope="col">Total Belanja</th>
    <th scope="col">Jumlah Piutang</th>
    <th scope="col">Sisa Piutang</th>
    <th scope="col">Terbayar</th>
    <th scope="col">Nama Kasir/Pegawai</th>
</tr>
</thead>
<tbody>
<?php
$jumpi=0;
$jumsisa=0;
$jumbayar=0;
$jumtot=0;
foreach ($datajual as $hasil) {
    $terbayar=$hasil->piutang-$hasil->sisa;
    ?>
    <tr>
        <td><?php echo date('d-m-Y',strtotime($hasil->tanggal)) ?></td>
        <td><a href="<?php echo base_url('transaksi/cetak_faktur?no='.$hasil->faktur_jual) ?>" target="_blank" title="Cetak struk"><?php echo $hasil->faktur_jual ?></a></td>
        <td><?php echo $hasil->kode_member ?></td>
        <td><?php echo $hasil->member ?></td>
        <td><?php echo number_format($hasil->total,0,',','.') ?></td>
         <td><?php echo number_format($hasil->piutang,0,',','.') ?></td>
        <td><?php echo number_format($hasil->sisa,0,',','.') ?></td>
        <td><?php echo number_format($terbayar,0,',','.') ?></td>
        <td><?php echo $hasil->pegawai ?></td>
    </tr>
    <?php
    $jumpi=$jumpi+$hasil->piutang;
    $jumsisa=$jumsisa+$hasil->sisa;
    $jumbayar=$jumbayar+$terbayar;
    $jumtot=$jumtot+$hasil->total;
}
?>
</tbody>
<tfoot>
<tr>
    <th colspan="4">Jumlah Total</th>
     <th><?php echo number_format($jumtot,0,',','.') ?></th>
    <th><?php echo number_format($jumpi,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 -->