<form method="post" action="" id="form_filter_cari">
  <table id="tb_cari" style="width:100%;" cellpadding="3px;" style="background-color: #717b85;">
    <tr>
      <th><h4 style="color:#fff;"><i>Search</i></h4></th>
    </tr>

    <tr>
      <td><label>Nomor Sampel</label></td>
      <td>:</td>
      <td>
        <input class="form-control" value="<?php echo !empty($filter) ? $filter['id_sampel'] : ''; ?>" name="id_sampel" placeholder="Masukkan Nomor Sampel">
      </td>

      <td width="50px"></td>

      <td><label>Keterangan</label></td>
      <td>:</td>
      <td>
        <select class="form-control default-select2" name="keterangan" style="width:100%;">
          <option></option>
          <?php foreach ($keterangan as $r) { ?>
            <option <?php echo !empty($filter) && $filter['keterangan'] == $r['id_jenis'] ? 'selected' : ''; ?> value="<?php echo $r['id_jenis']; ?>"><?php echo $r['nama_jenis']; ?></option>
          <?php } ?>
        </select>
      </td>
    </tr>

    <tr>
      <td><label>Kualitas Sampel</label></td>
      <td>:</td>
      <td>
        <select class="form-control default-select2" name="kualitas_sampel" style="width:100%;">
          <option></option>
          <option <?php echo !empty($filter) && $filter['kualitas_sampel'] == 'Baik' ? 'selected' : ''; ?> value="Baik">Baik</option>
          <option <?php echo !empty($filter) && $filter['kualitas_sampel'] == 'Tidak Baik' ? 'selected' : ''; ?> value="Tidak Baik">Tidak Baik</option>
        </select>
      </td>

      <td width="50px"></td>

      <td><label>Penanganan Sampel</label></td>
      <td>:</td>
      <td>
        <select class="form-control default-select2" name="penanganan_sampel" style="width:100%;">
          <option></option>
          <?php foreach ($penanganan_sampel as $r) { ?>
            <option <?php echo !empty($filter) && $filter['penanganan_sampel'] == $r['id_jenis'] ? 'selected' : ''; ?> value="<?php echo $r['id_jenis']; ?>"><?php echo $r['nama_jenis']; ?></option>
          <?php } ?>
        </select>
      </td>
    </tr>

    <tr>
      <td><label>Parameter Uji</label></td>
      <td>:</td>
      <td>
        <select class="form-control default-select2" name="parameter_uji" style="width:100%;">
          <option></option>
          <?php foreach ($parameter_uji as $r) { ?>
            <option <?php echo !empty($filter) && $filter['parameter_uji'] == $r['id_jenis'] ? 'selected' : ''; ?> value="<?php echo $r['id_jenis']; ?>"><?php echo $r['nama_jenis']; ?></option>
          <?php } ?>
        </select>
      </td>

      <td width="50px"></td>

      <td></td>
      <td></td>
      <td></td>
    </tr>

    <tr>
      <td></td>
      <td></td>
      <td>
        <button class="btn btn-primary btn-sm" type="button" onclick="onfilter_cari();">Cari</button>
        <a href="<?php echo site_url('sampel/pengajuan'); ?>" class="btn btn-danger btn-sm">Reset</a>
      </td>
    </tr>
    <tr>
      <td colspan="7"></td>
    </tr>
  </table>

  <input class="form-control" type="hidden" name="filter_cari" value="1">
</form>

<script>
  function onfilter_cari() {
    $("#form_filter_cari").submit();
  }
</script>
