
<div class="row" id="portlet-content">
    <div class="col-md-12">
        <div class="portlet light" style="position:relative">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-laptop"></i>Detail Penggunaan 
                </div>
                <div class="actions">
                 <a class="btn blue btn-sm" href="<?=site_url()?>/front_office/ugd_dir/ugd/laboratorium_penggunaan_tambah">
                  <i class="fa fa-plus"></i> Tambah
                </a>   
                </div>
                          
              
            </div>



            <div class="portlet-body" id="page-content" style="display:nonee">
                <div class="table-responsive">
                    <table id="<?=$controller?>_table" class="table table-bordered table-striped table-hover" style="width:100%">
                        <thead>
                            <tr>
                                <th class="text-left"><i class="fa fa-th-large"></i></th>
                                <th class="text-left">Tanggal Stok Keluar</th>
                                <th class="text-left">Keterangan</th>
                                <th class="text-left">Nama Stok</th>
                                <th class="text-left">Jumlah Keluar</th>
                            </tr>
                        </thead>
                        <tbody>
                        	<?php 
                        	foreach ($this->M_general->select_db('bbmc_tr_laboratorium_pengeluaran_stok')->result() as $key ) { 
                        	$nama_bhp = $this->M_general->get_value('bbmc_re_bahan_habis_pakai','id_re_bahan_habis_pakai',$key->id_bhp,'nama_item');
                        	?>
                        	<tr>
                            <td>
                                <a href="<?=site_url()?>/front_office/ugd_dir/ugd/update_penggunaan/<?=$key->id_laboratorium_pengeluaran_stok?>" class="btn-xs btn-info tooltips" data-toogle="m-tooltip" title="edit"><i class="fa fa-edit"></i></a>
                                <a href="<?=site_url()?>/front_office/ugd_dir/ugd/del_penggunaan/<?=$key->id_laboratorium_pengeluaran_stok?>" class="btn-xs btn-danger tooltips" onclick="return confirm('Anda Yakin?');" data-toogle="m-tooltip" title="edit"><i class="fa fa-times"></i></a>
                            </td>
                        		<td><?=$key->tgl?></td>
                        		<td>
                        			<?php 
                        			if($key->id_re_kunjungan != '0'){ 
                        			$id_re_pasien = $this->M_general->get_value('bbmc_tr_kunjungan','id_re_kunjungan',$key->id_re_kunjungan,'id_re_pasien'); 
                        			$nama_pasien = $this->M_general->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'nama_pasien'); 
                        			?>
                              
                        			
                        			Tindakan Pasien <?=$nama_pasien?> Kunjungan no <?=$key->id_re_kunjungan?>
                        		
                        			<?php }else{ ?>
                              Pengeluaran Stok
                              <?php }?>

                        		</td>
                            <td><?=$nama_bhp?></td>
                            <td>
                             
                              <?=$key->qty?>

                            </td>
                        	</tr>
                        	<?php }?>
                         
                        </tbody>
                    </table>
                </div>

               
            </div>
           
        </div>
    </div>
</div>





<script>
  $(document).ready( function () {
    var table=$('#<?=$controller?>_table').DataTable({
      "order": [[ 0, 'desc' ]],
      "processing": false,
      "serverSide": false,
      "searching": true,
      "language": {
            "url": "<?=base_url('media/assets/global/plugins/datatables/media/js')?>/indonesian.json"
       },
      "columnDefs": [
        {"targets": [0],"bSortable": false}
      ],
    
      "fnInitComplete": function(oSettings, json) {
        $('.dataTables_processing').css('display','none');
        $( "#loading-content" ).fadeOut( "fast", function() {
          $( "#tombol-action" ).fadeIn("fast");
          $( "#page-content" ).fadeIn("fast");
        });
      }
    });

  });

  $('.hapusdata').click(function(){
    if(confirm("Apakah kamu yakin menghapus entry ini?")){
      return true;
    }
    else{
      return false;
    }
  });
</script>


<script>
  $(document).ready(function () {
    $('.datepickers').datepicker({
      format: 'dd-mm-yyyy' 
    });
  });
</script>
