Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //..
- $hasil = $connect->QUERY('SELECT * FROM data_bca');
- $rows = $hasil->fetch_all(MYSQLI_ASSOC);
- $no = $total = 0;
- ?>
- <table>
- <thead>
- <tr>
- <th>No</th>
- <th>Nama Pengirim</th>
- <th>Cabang</th>
- <th>Jumlah</th>
- <th>Keterangan</th>
- <th>Aksi</th>
- </tr>
- </thead>
- <tbody>
- <?php
- foreach($rows as $rows){
- $total += $rows['jumlah'];
- ?>
- <tr>
- <td><?php echo ++$no;?></td>
- <td><?php echo $rows['nama'];?></td>
- <td><?php echo $rows['cabang'];?></td>
- <td><?php echo number_format($rows['jumlah'], 2, ',', '.');?></td>
- <td><?php echo $rows['keterangan'];?></td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- <tfoot>
- <tr>
- <td colspan='3'><label>ST</label></td>
- <td colspan='2'>
- <input type="text" name="Subtotal" value="<?php echo number_format($total,2,',','.'); ?>"/>
- </td>
- </tr>
- </tfoot>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement