<style type="text/css">
.col-md-4, .col-md-6, .col-md-8{padding: 0px}
.panel-body{padding: 0px}
.form-inline{padding-bottom: 25px}
.form-inline .form-control{width: 100%}
</style>


<div class="row" id="info-content" style="display:block">
    <div class="col-md-12">
        <div class="portlet box green-haze" style="position:relative">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-user"></i> Informasi Pasien
                </div>
            </div>

           <div class="portlet-body form">
                <form class="form-horizontal form-bordered form-row-stripped" role="form">
                    <div class="form-body">
                        <div class="form-group">
                            <div class="col-md-6">
                                <div class="row">
                                    <label class="form-control-static col-md-4">Nomor Rekam Medis </label>
                                    <p class="form-control-static col-md-8">
                                        : &nbsp; BBMC-<?=$this->Content_m->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'nrm')?> 
                                    </p>
                                </div>
                                <div class="row">
                                    <label class="form-control-static col-md-4">Nama Pasien </label>
                                    <p class="form-control-static col-md-8">
                                        : &nbsp; <?=strtoupper($this->Content_m->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'nama_pasien'))?>  / <?=$this->Content_m->get_tipe_pasien($id_re_pasien)?>
                                    </p>
                                </div>
                                <div class="row">
                                    <label class="form-control-static col-md-4">Umur  </label>
                                    <p class="form-control-static col-md-8">
                                        : &nbsp; <?=strtoupper($this->Content_m->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'umur_tahun'))?> TAHUN <?=strtoupper($this->Content_m->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'umur_bulan'))?> BULAN
                                    </p>
                                </div>
                                <div class="row">
                                     <div style="padding:0px; <?=$get_kunjungan->id_dokter_jaga!='-1'?'display: block':'display: none'?>">
                                          <label class="form-control-static col-md-4">Dokter </label>
                                          <p class="form-control-static col-md-8">
                                              : &nbsp; 
                                              <?php 
                                              $id_dokter_jaga = $this->Content_m->get_value('bbmc_tr_kunjungan','id_re_kunjungan',$id_re_kunjungan,'id_dokter_jaga');
                                              echo "<b>".$this->Content_m->get_value('bbmc_re_staff_medis','id_staff_medis',$id_dokter_jaga,'staff_medis')."</b>";
                                              ?>  
                                          </p>
                                      </div>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="row">
                                    <label class="form-control-static col-md-4">Pendidikan  </label>
                                    <p class="form-control-static col-md-8">
                                        <?php $id_pendidikan = $this->Content_m->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'id_pendidikan');
                                        $pendidikan = $this->Content_m->get_value('bbmc_re_jenjang_pendidikan','id_jenj_didik',$id_pendidikan,'nm_jenj_didik');
                                        ?>
                                        : &nbsp; <?=strtoupper($pendidikan)?> 
                                    </p>
                                </div>
                                <div class="row">
                                    <label class="form-control-static col-md-4">Pekerjaan  </label>
                                    <p class="form-control-static col-md-8">
                                        <?php $id_pekerjaan = $this->Content_m->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'id_pekerjaan');
                                        $pendidikan = $this->Content_m->get_value('bbmc_re_pekerjaan','id_pekerjaan',$id_pekerjaan,'nm_pekerjaan');
                                        ?>
                                        : &nbsp; <?=strtoupper($pendidikan)?> 
                                    </p>
                                </div>
                                <div class="row">
                                    <label class="form-control-static col-md-4">Alamat  </label>
                                    <p class="form-control-static col-md-8">
                                        : &nbsp; <?=strtoupper($this->Content_m->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'alamat'))?> 
                                    </p>
                                </div>
                            </div>
                        </div>                                    
                    </div>
                </form>
            </div>
            
        </div>
    </div>
</div>




<div class="row" id="portlet-content">
    <div class="col-md-12">

        <div class="portlet light" style="position:relative">
            <br>
            <div class="portlet-body" id="page-content" style="display:nonee">
               
                <?= form_open('#', array('class'=>"form-horizontal") ) ?>
                <div class="panel-body">
                  <div class="col-md-12">
                    <div class="form-group ">
    
                    <div class="form-group">

                      <label class="col-md-2 control-label"><br>Tanggal</label>
                      <div class="col-sm-3">
                        <span style="font-size:9px">Tanggal Tagihan</span><br>
                        <div class="input-group">    

                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>         
                        <?= form_input('tanggal', date('Y-m-d h:i:s'), array('class'=>'form-control datepicker', 'autocomplete'=>'off','readonly'=>'readonly')); ?>          
                        </div>
                      </div>
                    </div>

                    <div class="form-group">
                      <label class="col-md-2 control-label"><br> <?php echo "Deskripsi";?></label>
                      <div class="col-sm-4">
                        <span style="font-size:9px">Jenis Pelayanan</span><br>
                        <select class="form-control sel2_kebutuhan" requireds autocomplete="off" name="kebutuhan[]" style="width:100%">
                          <option value="1" selected>Administrasi</option>
                        </select>
                      </div>
                      <div class="col-sm-2" style="padding-left: 0px; padding-right: 10px">
                        <span style="font-size:9px">Biaya</span><br>
                        <?= form_input('biaya[]', $this->Content_m->currency_edit(25000), array('class'=>'formatWhileTypingJournalEntryDebit form-control text-right', 'autocomplete'=>'off','placeholder'=>'Biaya')); ?>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label"><br></label>
                      <div class="col-sm-4">
                        <select class="form-control sel2_kebutuhan" requireds autocomplete="off" name="kebutuhan[]" style="width:100%">
                          <option value="2" selected>Pemeriksaan Dokter Umum UGD</option>
                        </select>
                      </div>
                      <div class="col-sm-2" style="padding-left: 0px; padding-right: 10px">
                        <?= form_input('biaya[]', $this->Content_m->currency_edit(30000), array('class'=>'formatWhileTypingJournalEntryDebit form-control text-right', 'autocomplete'=>'off','placeholder'=>'Biaya')); ?>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label"><br></label>
                      <div class="col-sm-4">
                        <select class="form-control sel2_kebutuhan" requireds autocomplete="off" name="kebutuhan[]" style="width:100%">
                          <option value="3" selected>Perawatan</option>
                        </select>
                      </div>
                      <div class="col-sm-2" style="padding-left: 0px; padding-right: 10px">
                        <?= form_input('biaya[]', $this->Content_m->currency_edit(5000), array('class'=>'formatWhileTypingJournalEntryDebit form-control text-right', 'autocomplete'=>'off','placeholder'=>'Biaya')); ?>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label"><br></label>
                      <div class="col-sm-4">
                        <select class="form-control sel2_kebutuhan" requireds autocomplete="off" name="kebutuhan[]" style="width:100%">
                          <option value="4" selected>Sarana</option>
                        </select>
                      </div>
                      <div class="col-sm-2" style="padding-left: 0px; padding-right: 10px">
                        <?= form_input('biaya[]', $this->Content_m->currency_edit(20000), array('class'=>'formatWhileTypingJournalEntryDebit form-control text-right', 'autocomplete'=>'off','placeholder'=>'Biaya')); ?>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-2 control-label"><br></label>
                      <div class="col-sm-4">
                        <select class="form-control sel2_kebutuhan" requireds autocomplete="off" name="kebutuhan[]" style="width:100%">
                          <option value="5" selected>Obat</option>
                        </select>
                      </div>
                      <div class="col-sm-2" style="padding-left: 0px; padding-right: 10px">
                        <?= form_input('biaya[]', $this->Content_m->currency_edit(53000), array('class'=>'formatWhileTypingJournalEntryDebit form-control text-right', 'autocomplete'=>'off','placeholder'=>'Biaya')); ?>
                      </div>
                      <!--
                      <div class="col-sm-2" style="padding-left: 0px; padding-right: 10px; margin-top: 9px">
                      <a href="#" target="_Blank" style="color:blue; text-decoration: underline;">Detail Obat</a>
                      </div>
                      -->
                    </div>
               

                    <?php for ($i1=1; $i1 <= 5; $i1++) { ?>
                     <div class="form-group request_note_detail<?=$i1?>" style="<?=$i1==0?'display: block':'display: none'?>">
                     
                      <label class="col-md-2 control-label"><br> </label>

                      <div class="col-sm-4">
                        <select class="form-control sel2_kebutuhan kebutuhan<?=$i1?>" data-id="<?=$i1?>" requireds autocomplete="off" name="kebutuhan[]" style="width:100%">
                          <option value=""></option>
                          <option value="1">Administrasi</option>
                          <option value="2">Pemeriksaan Dokter Umum UGD</option>
                          <option value="3">Perawatan</option>
                          <option value="4">Sarana</option>
                        </select>
                      </div>
                     
                      <div class="col-sm-2" style="padding-left: 0px; padding-right: 10px">
                        <?= form_input('biaya[]', '', array('class'=>'formatWhileTypingJournalEntryDebit form-control text-right biaya'.$i1, 'autocomplete'=>'off','placeholder'=>'Biaya', 'data-id'=>$i1)); ?>
                      </div>

                      <?php if($i1 != 0){ ?>
                      <div class="col-sm-1" style="padding-left: 0px; ">
                        <span style="font-size:9px"></span>
                        <div style="border:0px solid black; padding-top: 9px">
                        <a href="javascript:;" class="del" data-id="<?=$i1?>" style="background: red; color:#fff; padding:5px 10px; "><i class="fa fa-times"></i></a>
                        </div>
                      </div>
                      <?php }?>

                    </div>
                    <?php }?>
                    
                    
                    

                    <div class="form-group">
                      <label class="col-md-2 control-label"><br></label>
                      <div class="col-sm-2" style="">
                          <a href="javascript:;" class="add" style="background: green; color:#fff; padding:5px 10px; "><i class="fa fa-plus"></i></a>
                          <br><br><br>
                          <button type="submit" class="btn btn-primary">Buat Tagihan</button>
                      </div>
                    </div>

                    
                    
                  </div>
                </div>
                
                <?= form_close() ?>
             
            </div>
            
        </div>
    </div>
</div>

<script>
$( "#loading-content,#loading" ).fadeOut( "fast", function() {
    $( "#page-content" ).fadeIn("fast");
});

var c=1;
$(".add").click(function(){
  //alert(1);
  $(".request_note_detail"+c).css('display','block');
  c++;

  if(c >= 7){
    //alert("Maksimal 6 Entry");
  }
});


$(".del").click(function(){
  var ID=$(this).attr('data-id');
  $(".request_note_detail"+ID).css('display','none');
  
});



$(".sel2_kebutuhan").select2({
    placeholder: "Pelayanan",
    language: "id"
});


</script>





