<?php
//print_r($data);
?>
<div class="panel panel-grey">
    <div class="panel-heading">
      <hr>
    </div>
    <div class="panel-body table-responsive">
        <table class="table table-hover table-striped table-bordered">
            <thead>
                <tr class="inverse">
                    <th rowspan="3" class="text-center">No.</th>
                    <!-- <th rowspan="3" class="text-center">Aksi</th> -->
                    <th rowspan="3" class="text-center">Nomor Sampel</th>
                    <th rowspan="3" class="text-center">Bentuk/Jenis Sampel</th>
                    <th colspan="4" class="text-center">Kondisi Sampel</th>
                    <th colspan="6" class="text-center">Jenis Sampel</th>
                    <th colspan="3" class="text-center">Jenis Grinder</th>
                    <th rowspan="3" class="text-center">Keterangan</th>
                </tr>
                <tr class="inverse">
                    <th rowspan="2" class="text-center">Cair</th>
                    <th colspan="3" class="text-center">Padat</th>
                    <th colspan="3" class="text-center">Arsip</th>
                    <th colspan="3" class="text-center">Kerja</th>
                    <th rowspan="2" class="text-center">Xi Liang</th>
                    <th rowspan="2" class="text-center">FOSS</th>
                    <th rowspan="2" class="text-center">Yellow Line</th>
                </tr>
                <tr class="inverse">
                    <th class="text-center">Basah</th>
                    <th class="text-center">Lembab</th>
                    <th class="text-center">Kering</th>
                    <th class="text-center">Cair</th>
                    <th class="text-center">Tanpa Dioven</th>
                    <th class="text-center">Dioven</th>
                    <th class="text-center">Uji MBM</th>
                    <th class="text-center">Selain Uji Aflatoksin</th>
                    <th class="text-center">Uji Aflatoksin</th>
                </tr>
            </thead>
            <tbody>
                <?php $i = 1;
                foreach ($data as $r) {
                    $id_uji = $r['id_uji'];
                    ?>
                    <tr>
                        <td class="text-center"><?php echo $this->uri->segment(4) + $i++ ?></td>
                        <!-- <td class="text-center">
                            <div class="btn-group m-b-5 m-r-5">
                                <a href="javascript:;" class="btn btn-success">Aksi</a>
                                <a href="javascript:;" data-toggle="dropdown" class="btn btn-success dropdown-toggle" aria-expanded="false">
                                    <span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu pull-right" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(70px, 32px, 0px);">
                                    <li>
                                        <a href="<?php echo site_url('sampel/pengajuan/penyiapan_sampel?id_uji=' . $id_uji . '&id_sampel=' . $r['id_sampel']) ?>">Penyiapan Sampel</a>
                                    </li>
                                </ul>
                            </div>
                        </td> -->
                        <td class="text-center">
                            <?php $pk = strlen($r['id_sampel']);
                            if($pk == 3) $idsm = '0'.$r['id_sampel'];
                            else if($pk == 2) $idsm = '00'.$r['id_sampel'];
                            else if($pk == 1) $idsm = '000'.$r['id_sampel'];

                            echo $idsm;
                            ?>
                        </td>
                        <td><?php echo $r['bentuk_jenis'] ?></td>
                        <td class="text-center"><?php echo $r['id_bentuk_sampel'] === '1' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo strpos($r['id_bentuk_sampel'], '2') !== false ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo strpos($r['id_bentuk_sampel'], '3') !== false ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo strpos($r['id_bentuk_sampel'], '4') !== false ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_penanganan_arsip'] === '1' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_penanganan_arsip'] === '2' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_penanganan_arsip'] === '3' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_penanganan_kerja'] === '4' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_penanganan_kerja'] === '5' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_penanganan_kerja'] === '6' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_jenis_grinder'] === '1' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_jenis_grinder'] === '2' ? '√' : '-'; ?></td>
                        <td class="text-center"><?php echo $r['id_jenis_grinder'] === '3' ? '√' : '-'; ?></td>
                        <td><?php echo $r['keterangan'] ?></td>
                    </tr>
<?php } ?>
            </tbody>
        </table>
    </div>
</div>
