
<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 Invoice 
                </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">Tanggal</th>
                                <th class="text-left">No Invoice</th>
                                <th class="text-left">Deskripsi Invoice</th>
                                <th class="text-left">Tagihan</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php 
                            $ttl=0;
                            foreach ($this->M_general->get_query_pendapatan_pasien_lab($tgl, $tipe_pasien)->result() as $key ) { 
                            $price = ($key->qty * $key->price) - (($key->qty * $key->price) * $key->disc / 100);?>
                            <tr>
                                <td><?=$key->tgl?></td>
                                <td><?=$key->no_inv?></td>
                                <td><?=$key->desc?></td>
                                <td><?=$this->M_general->currency($price)?></td>
                            </tr>
                            <?php $ttl=$ttl+$price;} ?>
                        </tbody>
                        <tfoot>
                          <tr>
                            <td colspan ="3"></td>
                            <td><b><?=$this->M_general->currency($ttl)?></b></td>
                          </tr>
                        </tfoot>

                    </table>
                </div>

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





<script>
  $(document).ready( function () {
    var table=$('#<?=$controller?>_table').DataTable({
      "order": [[ 1, 'asc' ]],
      "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>
