<div class="container" style="font-size:13px;">
   <div class="row">
      <div class="col-md">
         <div class="card shadow">
            <div class="card-body">
               <button type="button" class="btn btn-sm btn-dark mb-3" data-toggle="modal" data-target="#exampleModal">
                  <i class="fas fa-plus fa-sm"></i> Tambah
               </button>
               <table id="dataTable" class="table table-sm table-bordered">
                  <thead>
                     <tr>  
                        <th scope="col">#</th>
                        <th scope="col">Nama Blok</th>
                        <th scope="col">Harga Per Hari</th>
                        <th scope="col">Keterangan</th>
                        <th scope="col">Mapping</th>
                        <th scope="col" class="text-center">Aksi</th>
                     </tr>
                  </thead>
                  <tbody>
                     <?php
                     $i = 1;
                     foreach ($barang as $brg) : ?>
                        <tr>
                           <th scope="row"><?= $i++; ?></th>
                           <td><?= $brg['blok'];; ?></td>
                           <td><?= $brg['harga']; ?></td>
                           <td><?= $brg['keterangan']; ?></td>
                           <td><?= $brg['latlng'];; ?></td>
                           <td>

                              <a href="<?= base_url('admin/data_barang/edit/') . $brg['id_area']; ?>" class="btn btn-circle btn-sm btn-primary"><i class="fas fa-edit"></i></a>

                              <a href="<?= base_url('admin/data_barang/hapus/') . $brg['id_area']; ?>" class="btn btn-circle btn-sm btn-danger"><i class="fas fa-trash"></i></a>
                           </td>
                        </tr>
                     <?php endforeach; ?>
                  </tbody>
               </table>
            </div>
         </div>
      </div>
   </div>

   <!-- Modal -->
   <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
      <div class="modal-dialog">
         <div class="modal-content">
            <div class="modal-header">
               <h5 class="modal-title" id="exampleModalLabel">Tambah</h5>
               <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
               </button>
            </div>
            <div class="modal-body">
               <form action="<?= base_url('admin/data_barang/tambah'); ?>" method="POST" enctype="multipart/form-data">
                  <div class="form-group">
                     <input class="form-control form-control-sm mb-3" type="text" placeholder="Nama Blok" name="nama_blok" id="nama_blok">
                     <input class="form-control form-control-sm mb-3" type="text" placeholder="Harga" name="harga" id="harga">
                     <input class="form-control form-control-sm mb-3" type="text" placeholder="Mapping" name="latlng" id="latlng">
                     <input class="form-control form-control-sm mb-3" type="text" placeholder="Keterangan" name="ket" id="ket">
                     <input class="form-control form-control-sm mb-3" type="file" placeholder="Mapping" name="gambar" id="gambar">
                  </div>
            </div>
            <div class="modal-footer">
               <button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Batal</button>
               <button type="submit" class="btn btn-sm btn-primary">Tambah</button>
            </div>
            </form>
         </div>
      </div>
   </div>
</div>