<div class="row">
  <!-- begin col-8 -->
  <div class="col-sm-12">
      <!-- begin panel -->
      <a class="btn btn-primary mb-2" href="<?= site_url('inventaris/peralatan/create_edit'); ?>">Tambah Data</a>
      <div class="panel panel-grey">
          <div class="panel-heading">
			  <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-grey" data-click="panel-expand"><i class="fa fa-expand"></i></a>
			  <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-grey" data-click="panel-remove"><i class="fa fa-times"></i></a>
          </div>
          <div class="panel panel-body table-responsive">
              <table class="table table-bordered table-hover table-striped table-td-valign-middle">
                  <thead>
                  <tr>
                    <th class="text-center">No.</th>
                    <th class="text-center">Nama Alat</th>
                    <th class="text-center">Jenis Alat</th>
                    <th class="text-center">Kategori</th></th>
                    <th class="text-center">Jenis Uji</th>
                    <th class="text-center">Keterangan</th>
					<th></th>
                  </tr>

                  </thead>
                  <tbody>
                      <?php $i = 0; foreach($data as $r){ $i++ ?>
                        <tr>
                          <td class="text-center"><?php echo $i ?></td>
                          <td><?php echo $r['nama_alat'] ?></td>
                          <td><?php echo $r['jenis_alat'] ?></td>
                          <td><?php echo $r['kategori'] ?></td>
                          <td><?php
                            $param_uji = json_decode($r['jenis_uji']);
                            $param_uji = $this->m_peralatan->get_param_uji_by_in($param_uji);
                            $ep = '';
                            foreach($param_uji as $p){
                                $ep .= $p['nama'].', ';
                            }
                            $ep = substr($ep, 0, '-2');
                            echo $ep;
                          ?></td>
                          <td><?php echo $r['keterangan'] ?></td>
						  <td class="text-center">
							<a href="<?php echo site_url('inventaris/peralatan/create_edit/'.$r['id']) ?>" class="btn btn-primary btn-xs">Edit</a>
							<a href="<?php echo site_url('inventaris/peralatan/hapus_alat?id_alat='.$r['id']) ?>" class="btn btn-danger btn-xs">Hapus</a>
						  </td>
                        </tr>
                      <?php } ?>
                  </tbody>
              </table>
          </div>
      </div>
      <!-- end panel -->
  </div>