<div class="row">
    <!-- begin col-8 -->
    <div class="col-sm-12">
        <!-- begin panel -->
        <div class="panel panel-grey">
            <div class="panel-heading">
                <div class="panel-heading-btn">
                    <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>
                <a href="<?php echo site_url('sampel/pendaftaran'); ?>" class="btn btn-primary"><span class="fa fa-arrow-left"></span> Kembali</a>
                <?php if($this->input->get('status') < 3) { ?>
                    <?php
                      $url_sampel = 'sampel/pendaftaran/create_edit?id_uji='.$idUji.'&type=sampel';
                      if($data) $url_sampel .= "&id_sampel=".end($data)['id_sampel']."&method=addHistory";
                    ?>
                    <a href="<?php echo site_url($url_sampel) ?>" class="btn btn-primary">Tambah Data</a>
                <?php } ?>
                <hr>
            </div>
            <div class="panel panel-body">
                <div class="table-responsive">
                    <?php if($data){ ?>
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
                            <tr>
                                <th class="text-center">No.</th>
                                <th class="text-center">Aksi</th>
                                <th class="text-center">Nomor Sampel</th>
                                <th class="text-center">Asal Sampel</th>
                                <th class="text-center">Jenis&nbsp;Sampel</th>
                                <th class="text-center">Kualitas</th>
                                <th class="text-center">Bentuk/Jenis</th>
                                <th class="text-center">Jenis&nbsp;Pengujian</th>
                                <th class="text-center">Label Pakan</th>
                                <th class="text-center">Petugas Pengambil&nbsp;Sampel</th>
                                <th class="text-center">Keterangan</th>
                                <th class="text-center">Klasifikasi</th>
                            </tr>
                        <thead>
                        <tbody>
                            <?php $i=1; foreach($data as $r) { ?>
                            <tr>
                                <td class="text-center"><?php echo $this->uri->segment(4) + $i++ ?></td>
                                <td>
                                    <?php echo aksi_button('start') ?>
                                        <li>
                                            <a href="<?php echo site_url('sampel/pendaftaran/create_edit?id_uji='.$r['id_uji'].'&type=sampel&id_sampel='.$r['id_sampel']) ?>">
                                                Edit Sampel
                                            </a>
                                        </li>
                                    <?php echo aksi_button('end') ?>
                                </td>
                                <td class='text-center'><?php echo nomor_id($r['id_sampel']); ?></td>
                                <td><?php echo $r['asal_sampel']; ?></td>
                                <td><?php echo $r['jenis_sampel'].(isset($r['kode_sampel']) ? '['.$r['kode_sampel'].']' : ''); ?></td>
                                <td><?php echo $r['kualitas']; ?></td>
                                <td><?php echo $r['bentuk_jenis']; ?></td>
                                <td>
                                    <?php
                                        if(strpos($r['jenis_pengujian'], '1|2|3|4|5|') !== false){
                                          $r['jenis_pengujian'] = str_replace('1|2|3|4|5|', 'Proksimat|', $r['jenis_pengujian']);
                                        }
                                        $prUji = explode('|',$r['jenis_pengujian']);
                                        $x = count($prUji);
                                        for($i=0; $i < $x; $i++){
                                            if (isset($prUji[$i]) && $prUji[$i] !== ''){
                                                if($prUji[$i] == 'Proksimat'){
                                                  echo $prUji[$i].', ';
                                                }else{
                                                  echo $this->m_master->getParameterUji($prUji[$i]).', ';
                                                }
                                            }
                                        }
                                    ?>
                                </td>
                                <td><?php echo $r['label_pakan']; ?></td>
                                <td><?php echo $r['petugas_pengambil_sampel']; ?></td>
                                <td><?php echo $r['keterangan']; ?></td>
                                <td><?php echo $r['klasifikasi']; ?></td>
                            </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                    <?php }else { ?>
                        <div class="alert alert-warning fade show m-b-10">
                            <strong>Peringatan!</strong>
                             Data Kosong
                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
<div>
