 <div class="container-fluid">
 	
 		<button class="btn btn-sm btn-primary mb-3" data-toggle="modal" data-target="#tambah_barang"><i class="fas fa-plus fa-sm"></i> Tambah Barang</button>

<table class="table table-bordered">
	<tr>
		<th><center>NO</center></th>
		<th><center>NAMA BARANG</center></th>
		<th><center>KETERANGAN</center></th>
		<th><center>KATEGORI</center></th>
		<th><center>HARGA</center></th>
		<th><center>STOK</center></th>
		<th align="center" colspan="3"><center>AKSI</center></th>
	</tr>
		<?php
		$no=1;
		Foreach($barang as $brg) : ?>

	<tr>
		<td> <?php echo $no++ ?></td>
		<td> <?php echo $brg->nama_brg ?></td>
		<td> <?php echo $brg->keterangan ?></td>
		<td> <?php echo $brg->kategori ?></td>
		<td> Rp.<?php echo $brg->harga + $brg->keuntungan ?></td>
		<td> <?php echo $brg->stok ?></td>
		<td><?php echo anchor('admin/data_barang/detail/' .$brg->id_brg, '<div class="btn btn-success btn-sm"><i class="fas fa-search-plus"></i></div>') ?></td>
		<td><?php echo anchor('admin/data_barang/edit/' .$brg->id_brg, '<div class="btn btn-primary btn-sm"><i class="fa fa-edit"></i></div>') ?></td>
		<td><a onclick="return confirm('apakah yakin akan menghapus data ini?')" href="<?= base_url('admin/data_barang/hapus/'.$brg->id_brg)?>"><div class="btn btn-danger btn-sm"><i class="fa fa-trash" ></i></div></a></td>

	</tr>

		<?php endforeach; ?>
</table>

 </div>

 <!-- Modal -->
<div class="modal fade" id="tambah_barang" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">FORM INPUT PRODUK</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        	<span area-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        
        	<form action=" <?php echo base_url(). 'admin/data_barang/tambah_aksi'; ?>" method="post" enctype="multipart/form-data">
        		
        		<div class="form-group">
        			<label>Nama Barang</label>
        			<input type="text" name="nama_brg" class="form-control">
        		</div>

        		<div class="form-group">
        			<label>Keterangan</label>
        			<input type="text" name="keterangan" class="form-control">
        		</div>

        		<div class="form-group">
        			<label>Kategori</label>
        			<select class="form-control" name="kategori">
                <option>Ayam Pedaging</option>
                <option>Ayam Petelur</option>
                <option>Bebek Pedaging</option>
                <option>Bebek Petelur</option>
              </select>
        		</div>

        		<div class="form-group">
        			<label for="laba">Keuntungan pendapat</label>
        			<input type="text" name="laba" class="form-control">
        		</div>

        		<div class="form-group">
        			<label>Harga belum termasuk keuntungan</label>
        			<input type="text" name="harga" class="form-control">
        		</div>

        		<div class="form-group">
        			<label>Stok</label>
        			<input type="text" name="stok" class="form-control">
        		</div>

        		<div class="form-group">
        			<label>Gambar Produk</label><br>
        			<input type="file" name="gambar" class="form-control">
        		</div>	
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary">Simpan</button>
      </div>

      </form>
    </div>
  </div>
</div>