<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>
              <div class="btn-group" role="group" aria-label="Group Button Penyiapan Sampel">
                <a href="<?php echo site_url('sampel/pengajuan') ?>" class="btn btn-primary m-b-5"><span class="fa fa-arrow-left"></span> Kembali</a>
                <?php $vget = $this->input->get(); ?>
                <a href="<?php echo site_url('sampel/pengajuan/penyiapan_uji?id_uji='.$vget['id_uji'].'&status='.$vget['status']) ?>" class="btn btn-warning m-b-5 active">Penyiapan Sampel</a>
                <a href="<?php echo site_url('sampel/pelayuan_sampel?id_uji='.$vget['id_uji'].'&status='.$vget['status']) ?>" class="btn btn-warning m-b-5">Pelayuan Sampel</a>
              </div>

              <hr>

            </div>
            <div class="panel panel-body table-responsive">
                <table class="table table-bordered table-hover table-striped table-td-valign-middle">
                	<thead>
                    <tr class="default">
                      <th colspan="2">Tanggal</th>
                      <th colspan="2">: <?php echo set_indo_date_from_timestemp($data[0]['tgl_penyiapan_sampel']); ?></th>
                    </tr>
                    <tr class="default">
                      <th colspan="2">Jenis Sampel</th>
                      <th colspan="2">: <?php echo $data[0]['nama_layanan']; ?></th>
                    </tr>
                		<tr class="inverse">
	                		<th rowspan="3" class="text-center">No.</th>
                            <?php if(!empty($status) && in_array((int)$status, array(4))) { ?>
	                		 <th rowspan="3" class="text-center">Aksi</th>
                            <?php } ?>
	                		<th colspan="2" class="text-center">Waktu</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 rowspan="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">Pukul&nbsp;Mulai</th>
	                		<th rowspan="2" class="text-center">Pukul&nbsp;Selesai</th>
	                		<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>
	                	</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) { ?>
                		<tr>
                			<td class="text-center"><?php echo $this->uri->segment(4) + $i++ ?></td>
                            <?php if(!empty($status) && in_array((int)$status, array(4))) { ?>
                			<td class="text-center">
								<?php echo aksi_button('start'); ?>
									<li>
										<a href="<?php echo site_url('sampel/pengajuan/penyiapan_sampel?id_uji='.$id_uji.'&id_sampel='.$r['id_sampel'].'&status='.$status) ?>">Penyiapan Sampel</a>
									</li>
								<?php echo aksi_button('end'); ?>
                			</td>
                            <?php } ?>
                			<td><?php echo $r['pukul_mulai'] ?></td>
                			<td><?php echo $r['pukul_selesai'] ?></td>
                			<td><?php echo $r['id_sampel'] ?></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['nama_grinder'];?></td>
                			<td><?php echo $r['keterangan'] ?></td>
                		</tr>
                		<?php } ?>
                	</tbody>
                	<tfoot>

                	</tfoot>
                </table>
            </div>
            <?php if(!empty($status) && in_array((int)$status, array(4))) { ?>
            <div class="panel panel-footer">
            	<a href="<?php echo site_url('sampel/pengajuan/siapkan_sampel?id_uji='.$id_uji.'&status=5') ?>" class="btn btn-success">Siapkan Sampel</a>
            	<a href="#modal-alert" class="btn btn-danger" data-toggle="modal">Batalkan</a>
            </div>
            <?php }else if(!empty($status) && in_array((int)$status, array(5))){ ?>
            <div class="panel panel-footer">
                <a href="<?php echo site_url('sampel/pengajuan/siapkan_sampel?id_uji='.$id_uji.'&status=6') ?>" class="btn btn-primary">Verifikasi</a>
                <a href="<?php echo site_url('sampel/pengajuan/siapkan_sampel?id_uji='.$id_uji.'&status=4') ?>" class="btn btn-danger">Kembalikan ke Penyiapan Sampel</a>
            </div>
            <?php } ?>
        </div>
        <!-- end panel -->
    </div>
</div>

<div class="modal fade" id="modal-alert" style="display: none;" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="alert alert-danger m-b-0">
                    <p><b>Peringatan:</b> Apakah anda yakin akan membatalkan penyiapan sampel ini?</p>
                </div>
            </div>
            <div class="modal-footer">
                <a href="<?php echo site_url('sampel/pengajuan/siapkan_sampel?id_uji='.$id_uji.'&status=0') ?>" class="btn width-100 btn-sm btn-primary">Ya</a>
                <a href="javascript:;" class="btn width-100 btn-sm btn-danger" data-dismiss="modal">Tidak</a>
            </div>
        </div>
    </div>
</div>
