<style type="text/css">
    .table > thead > tr > th {
        vertical-align: middle;
        text-align: center;
    }
</style>
<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($back_url); ?>" class="btn btn-primary"><span class="fa fa-arrow-left"></span> Kembali</a>
                <?php if($this->input->get('status') < 3) { ?>
                    <?php
                        $url_sampel = 'set_data_sampel/'.$id_uji;
                    ?>
                    <a href="<?php echo site_url($url_sampel) ?>" class="btn btn-primary">Tambah Data</a>
                <?php } ?>
                <hr>
                <!-- <label>Registrasi Laboratorium : <?= $data_uji['registrasi_laboratorium']; ?></label> -->
            </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 Uji</th>
                                <th class="text-center">Registrasi Laboratorium</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">Merk&nbsp;Dagang</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"><?= $this->uri->segment(4) + $i; ?></td>
                                <td>
                                    <?php echo aksi_button('start'); ?>
                                        <li>
                                            <a href="<?= site_url($url_sampel.'/'.$r['id']); ?>">
                                                Edit Sampel
                                            </a>
                                        </li>
                                        <li>
                                            <a href="<?= site_url('sampel/pendaftaran/delete_sampel/'.$id_uji.'/'.$r['id']); ?>">
                                                Hapus
                                            </a>
                                        </li>
                                    <?php echo aksi_button('end'); ?>
                                </td>
                                <td class='text-center'><?php echo $r['nomor_uji']; ?></td>
                                <td class='text-center'><?php echo $r['registrasi_laboratorium']; ?></td>
                                <td class='text-center'><?php echo $r['nomor_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['merk_dagang']; ?></td>
                                <td><?php echo $r['kualitas']; ?></td>
                                <td><?php echo $r['bentuk_jenis']; ?></td>
                                <td>
                                    <?php
                                        $jenis_pengujian = json_decode($r['jenis_pengujian'], true);
                                        $str_uji = '';
                                        foreach($jenis_pengujian as $jp) {
                                            $str_uji .= $this->m_master->getParameterUji($jp).', ';
                                        }
                                        $str_uji = substr($str_uji, 0, -2);
                                        echo $str_uji;
                                    ?>
                                </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 $i++; } ?>
                        </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>
