<style type="text/css">
	.width-td{width: 100px;}
</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('sampel/pengajuan') ?>" class="btn btn-primary m-b-5"><span class="fa fa-arrow-left"></span> Kembali</a>
              <a target='_blank' href="<?php echo site_url('download_dok/cetak_lhp?id_uji='.$get['id_uji'].'&status='.$get['status']) ?>" class="btn btn-primary m-b-5">Cetak LHP</a>
							<hr>
            </div>
            <div class="panel panel-body table-responsive">
                <table class="table table-bordered table-hover table-striped table-td-valign-middle">
                	<thead>
                		<tr>
	                		<th rowspan="2" class="text-center">No.</th>
	                		<!-- <th rowspan="2" class="text-center">Aksi</th> -->
	                		<th rowspan="2" class="text-center">No. Uji</th>
	                		<th rowspan="2" class="text-center">Jenis/Asal Sampel</th>
                            <th colspan="2" class="text-center">Kadar Air<br>(%)</th>
                            <th colspan="2" class="text-center">Kadar Abu<br>(%)</th>
                            <th colspan="2" class="text-center">Kadar Protein Kasar<br>(%)</th>
                            <th colspan="2" class="text-center">Kadar Lemak Kasar<br>(%)</th>
                            <th colspan="2" class="text-center">Kadar Serat Kasar<br>(%)</th>
                            <th colspan="2" class="text-center">Kadar Kalsium<br>(%)</th>
                            <th colspan="2" class="text-center">Kadar Fosfor<br>(%)</th>
	                	</tr>
	                	<tr>
	                		<th class="text-center">Sampel</th>
	                		<th class="text-center">SNI(Maks)</th>
                            <th class="text-center">Sampel</th>
	                		<th class="text-center">SNI(Maks)</th>
                            <th class="text-center">Sampel</th>
	                		<th class="text-center">SNI(Maks)</th>
                            <th class="text-center">Sampel</th>
	                		<th class="text-center">SNI(Maks)</th>
                            <th class="text-center">Sampel</th>
	                		<th class="text-center">SNI(Maks)</th>
                            <th class="text-center">Sampel</th>
	                		<th class="text-center">SNI(Maks)</th>
                            <th class="text-center">Sampel</th>
	                		<th class="text-center">SNI(Maks)</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)) { ?>
                			<td class="text-center">
                                <?php echo aksi_button('start'); ?>
                                    <li>
                                        <a href="<?php echo site_url('sampel/pengajuan/uji_air') ?>">Edit Manual LHP</a>
                                    </li>
                                <?php echo aksi_button('end'); ?>
                			</td> -->
                            <?php //} ?>
                            <td class="text-center">
								<?php $pk = strlen($r['nomor_sampel']);
									if($pk == 3) $idsm = '0'.$r['nomor_sampel'];
									else if($pk == 2) $idsm = '00'.$r['nomor_sampel'];
									else if($pk == 1) $idsm = '000'.$r['nomor_sampel'];

									echo $idsm;
								?>
							</td>

                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['l_air'] ?>"></td>

                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['l_air']; ?>"></td>
                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['kadar_air'] ?>"></td>

                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['l_abu'] ?>"></td>
                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['kadar_abu'] ?>"></td>

                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['l_protein_kasar'] ?>"></td>
                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['protein_kasar'] ?>"></td>

                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['l_lemak_kasar'] ?>"></td>
                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['lemak_kasar'] ?>"></td>

                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['l_serat_kasar'] ?>"></td>
                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['serat_kasar'] ?>"></td>

                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['l_kalsium'] ?>"></td>
                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['kalsium'] ?>"></td>

                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['l_fosfor'] ?>"></td>
                            <td><input readonly class="width-td" type="" name="" value="<?php echo $r['fosfor'] ?>"></td>
                		</tr>
                		<?php } ?>
						<tr>
                			<th colspan="3" class="text-center">Metode</th>

							<td colspan="2"><?php echo $this->m_master->getMetodeUji(1)[0]['detail']; //id_method ?></td>
                			<td colspan="2"><?php echo $this->m_master->getMetodeUji(2)[0]['detail']; //id_method ?></td>
                			<td colspan="2"><?php echo $this->m_master->getMetodeUji(3)[0]['detail']; //id_method ?></td>
                			<td colspan="2"><?php echo $this->m_master->getMetodeUji(5)[0]['detail']; //id_method ?></td>
                			<td colspan="2"><?php echo $this->m_master->getMetodeUji(6)[0]['detail']; //id_method ?></td>
                			<td colspan="2"><?php echo $this->m_master->getMetodeUji(7)[0]['detail']; //id_method ?></td>
                			<td colspan="2"><?php echo $this->m_master->getMetodeUji(9)[0]['detail']; //id_method ?></td>

                		</tr>
                	</tbody>
                	<tfoot>

                	</tfoot>
                </table>
            </div>
            <div class="panel panel-footer">
            <?php if($this->input->get('status') === '9'){ ?>
							<a href="<?php echo site_url('sampel/pengajuan/siapkan_sampel?id_uji='.$id_uji.'&status=10') ?>" class="btn btn-primary btn-md">Buat Draft</a>
						<?php } ?>
            <?php if($this->input->get('status') === '10'){ ?>
							<a href="<?php echo site_url('sampel/pengajuan/siapkan_sampel?id_uji='.$id_uji.'&status=11') ?>" class="btn btn-primary btn-md">ACC LHP</a>
							<a href="<?php echo site_url('sampel/pengajuan/siapkan_sampel?id_uji='.$id_uji.'&status=9') ?>" class="btn btn-warning btn-md">Kembalikan ke Penerima Sampel</a>
						<?php } ?>
            </div>

        </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>
