Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <tbody>
- <?php
- $koneksi = mysqli_connect('localhost', 'root', '', 'db_wbcweb');
- $panggil_db = mysqli_query($koneksi, "SELECT * FROM tabel_barang");
- while ($row = mysqli_fetch_array($panggil_db, MYSQLI_ASSOC)) {
- $id = $row['kd_barang'];
- echo "<tr>";
- echo "<td>", $row['kd_barang'], "</td>";
- echo "<td>", $row['nm_barang'], "</td>";
- echo "<td>", $row['jn_barang'], "</td>";
- echo "<td>", number_format($row['hrg_jual']), "</td>";
- echo "<td>", number_format($row['hrg_beli']), "</td>";
- echo "<td>", $row['jml_barang'], "</td>";
- echo "<td>
- <a data-toggle='modal' data-target='#beliModal' data-href='beli_action_barang.php?kd_barang=".$id."'>
- <button class='btn btn-outline-primary btn-sm'>Beli</button>
- </a>
- <div class='modal fade' id='beliModal' tabindex='-1' role='dialog' aria-labelledby='hapusModalLabel' aria-hidden='true'>
- <div class='modal-dialog' role='document'>
- <div class='modal-content'>
- <div class='modal-header'>
- <h5 class='modal-title' id='hapusModalLabel'>Pembelian Barang</h5>
- <button type='button' class='close' data-dismiss='modal' aria-label='Close'>
- <span aria-hidden='true'>×</span>
- </button>
- </div>
- <div class='modal-body'>
- <form>
- <div class='form-group row'>
- <label for='jumlahBarang' class='col-sm-2 col-form-label'>Jumlah</label>
- <div class='col-sm-4'>
- <input autocomplete='off' type='text' name='jml_barang' class='form-control'>
- </div>
- </div>
- //Disini mas
- <div class='alert alert-warning' role='alert'>
- Maksimal pembelian adalah ".$id."
- </div>
- </form>
- </div>
- <div class='modal-footer'>
- <button type='button' class='btn btn-outline-secondary' data-dismiss='modal'>Batal</button>
- <a id='btn-beli'><button type='button' class='btn btn-outline-primary' data-dismiss='modal'>Beli</button></a>
- </div>
- </div>
- </div>
- </div>
- <a href='form_edit_barang.php?kd_barang=".$id."'>
- <button type='button' class='btn btn-outline-info btn-sm'>Ubah</button>
- </a>
- <a data-toggle='modal' data-target='#hapusModal' data-href='delete_action_barang.php?kd_barang=".$id."'>
- <button class='btn btn-outline-danger btn-sm'>Hapus</button>
- </a>
- </td>
- ";
- }
- ?>
- </tbody>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement