<style type="text/css">
  .width-td{width: 100px;}

  .table > thead > tr > th {
     vertical-align: middle;
     text-align: center;
  }
  .table > tbody > tr > td {
     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>
                </div>

                <?php $vget = $this->input->get(); ?>
                <?php if(in_array($jenis_uji, array('fosfor', 'ur', 'af', 'ca'))) { ?>
                    <form method="post" id="form1" action="<?php echo site_url('sampel/analis/form_uji/'.$jenis_uji); ?>">
                        <input type="hidden" name = "nomor_batch" value="<?php echo $vget['nomor_batch']; ?>">
                        <input type="hidden" name = "method" value="form_deret">
                        <div class="btn-group">
                            <a href="<?php echo site_url('sampel/analis/batch/'.$jenis_uji); ?>" class="btn btn-primary btn-md">Kembali</a>
                            <a href="<?php echo site_url('sampel/analis/kontrol_sampel/'.$jenis_uji.'?nomor_batch='.$vget['nomor_batch'].'&method='.$vget['method']); ?>" class="btn btn-warning btn-md active">Kontrol Sampel</a>
                            <button class="btn btn-warning" onclick="$('#form1').submit();">
                                Deret Standart <?php echo $jenis_uji; ?>
                            </button>
                        </div>
                    </form>
                <?php } else{ ?>
                    <a href="<?php echo site_url('sampel/analis/form_uji/'.$jenis_uji); ?>" class="btn btn-primary btn-md">Kembali</a>
                <?php } ?>
                <hr>

            </div>

            <div class="panel panel-body table-responsive">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>No.</th>
                            <th>Kontrol Sampel</th>
                            <th>Aksi</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php $i=1; foreach($data as $r){ ?>
                        <tr>
                            <td><?php echo $this->uri->segment(5) + $i++; ?></td>
                            <td><?php echo $r['kontrol_sampel']; ?></td>
                            <td>
                                <?php $k_sampel = str_replace('+', '|-|', $r['kontrol_sampel']); ?>
                                <a href="<?php echo site_url('sampel/analis/batch/'.$jenis_uji.'?nomor_batch='.$r['nomor_batch'].'&method=batch_sampel&kontrol_sampel='.$k_sampel); ?>" class="btn btn-primary btn-sm">Lihat Sampel</a>
                                <a href="<?php echo site_url('sampel/analis/form_uji/'.$jenis_uji.'?nomor_batch='.$r['nomor_batch'].'&method=kontrol_sampel&kontrol_sampel='.$k_sampel); ?>" class="btn btn-primary btn-sm">Tambah Sampel</a>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
