<style type="text/css">
  .hasil:hover{text-decoration: none;}
  .blink_me {
    animation: blinker 1s linear infinite;
  }

  @keyframes blinker {
    50% {
      opacity: 0;
    }
  }

</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">
                    NO KUNJUNGAN : <b><?=$id_re_kunjungan?></b>
                </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">           
            <div class="portlet-body form" id="page-content" style="display:none">
              
              <form action="<?= site_url('front_office/'.$controller_dir.$controller.'/update_data_kunjungan_penunjang') ?>" method="post" id="<?=$controller?>" enctype="multipart/form-data" class="horizontal-form">
                <input type="hidden" name="id_re_kunjungan" value="<?=$id_re_kunjungan?>">
                <input type="hidden" name="id_staff_medis" value="<?=$id_dokter_jaga?>">
                <input type="hidden" name="id_re_pasien" value="<?=$id_re_pasien?>" >
                <div class="form-body">
                  <div class="alert alert-danger display-hide" style="display:none;" id="error">
                    <button class="close" data-close="alert"></button>
                    <span id="error-text"></span>
                  </div>

                  <?php $cek = $get_kunjungan->pemeriksaan_khusus;
                  $cek = explode(",", $cek);
                  $cek_lab = '';
                  $cek_rad = '';
                  if(@$cek[0] == 'cek_laboratorium'){
                    $cek_lab = 'true';
                  }
                  if(@$cek[0] == 'cek_radiologi'){
                    $cek_rad = 'true';
                  }

                  if(@$cek[1] == 'cek_laboratorium'){
                    $cek_lab = 'true';
                  }
                  if(@$cek[1] == 'cek_radiologi'){
                    $cek_rad = 'true';
                  }

                  //echo $cek_lab."asd";

                  //$cek_lab = 'true';
                  if( $this->session->userdata('id_jabatan') != '7' ){
                    $cek_lab = 'true';
                  }

                  ?>



                  <h4 class="form-section" style="<?=$cek_lab=='true'?'display:block;':'display:none;'?> margin:0px 0px 5px 0px !important; padding-bottom:10px !important; font-size:13px !important"><i class="fa fa-flask"></i><strong> Data Pemeriksaan Laboratorium </strong><hr style="margin:10px 0px 0px 0px !important"> </h4>
                   <div class="row" style="<?=$cek_lab=='true'?'display:block;':'display:none;'?>">
                    <div class="col-md-12">
                      <div class="form-group" id="icd">
                        <div class="table-responsive">
                          <?php 
                          $this->db->where('id_re_kunjungan',$id_re_kunjungan);
                          $q = $this->Content_m->select_db('bbmc_tr_laboratorium'); ?>
                          <table id="<?= $controller ?>_table" class="table table-bordered table-striped table-hover" style="margin-bottom:0px; width:100%; font-size:11px !important">
                              <thead>
                                <tr>
                                  <?php if($q->num_rows() == 0){ ?>
                                  <th colspan="2" class="text-right col-md-4" style="font-size:10px !important">Tgl Periksa&nbsp;&nbsp;</th>
                                  <?php }else{ ?>
                                  <th class="text-center col-md-1" style="font-size:10px !important">No</th>
                                  <th class="text-left col-md-2" style="font-size:10px !important">Tgl Periksa</th>
                                  <?php }?>
                                  
                                  <th class="text-left col-md-2" style="font-size:10px !important">Tindakan Lab</th>
                                  <th class="text-left col-md-2" style="font-size:10px !important">Hasil Lab (Foto)</th>
                                  <th class="text-left col-md-2" style="font-size:10px !important">Hasil Lab (Text)</th>
                                  <th class="text-center col-md-1" style="font-size:10px !important">Aksi</th>
                                </tr>
                              </thead>
                              <tbody>
                                <?php 
                                $i=1;
                                $selupload=0;
                                foreach ($q->result() as $key ) { ?>
                                <tr style="" class="pemeriksaan_lab<?=$i?>">   
                                  <input type="hidden" name="id_re_laboratorium[]" value="<?=$key->id_re_laboratorium?>">
                                  <td align="center"><?=$i?></td>
                                  <td align="left">
                                      <?=$key->tgl_periksa?>
                                      <input type="hidden" name="tgl_periksa[]" value="<?=$key->tgl_periksa?>">
                                  </td>
                                
                                
                                  <td align="left">
                                      <?=$this->Content_m->get_value('siak_re_account_chart','id',$key->tindakan_lab,'name')?>
                                      <input type="hidden" name="tindakan_lab[]" value="<?=$key->tindakan_lab?>">  

                                  </td>
                                  <td align="left">

                                      <?php 
                                      $cek=0;
                                      
                                      $data['id_re_laboratorium'] = $key->id_re_laboratorium;
                                      $data['tindakan_lab'] = $key->tindakan_lab;
                                      $data['id_kunjungan'] = $id_re_kunjungan;
                                      $data['id_reg_pd'] = $id_re_pasien;
                                      $this->db->where('tindakan_lab',$key->tindakan_lab);
                                      $aa = $this->Content_m->select_db('bbmc_re_laboratorium_paket');

                                      foreach ($aa->result() as $keybb ) { 
                                          $data['tindakan_lab'] = $keybb->item_paket;
                                          $data['selupload'] = $selupload;

                                          $q = $this->Content_m->get_file($data['tindakan_lab'], $data['id_kunjungan']);
                                          $file = @$q->row()->file;
                                          $data['file'] = $file;

                                          echo $this->Content_m->get_value('siak_re_account_chart','id',$keybb->item_paket,'name');
                                          echo "<br>";
                                          $this->load->view('front_office/ugd/periksa/hasil_lab/hasil_pemeriksaan_lab_foto',$data);
                                          echo "<br>";

                                          if($file == ''){
                                            $selupload++; 
                                          }
                                          
                                          
                                      $cek++; }
                                      

                                      if($cek == 0){
                                          $q = $this->Content_m->get_file($data['tindakan_lab'], $data['id_kunjungan']);
                                          //echo $this->db->last_query();
                                          $file = @$q->row()->file;
                                          $data['file'] = $file;
                                          $data['selupload'] = $selupload;
                                          $this->load->view('front_office/ugd/periksa/hasil_lab/hasil_pemeriksaan_lab_foto',$data);
                                          if($file == ''){
                                            $selupload++; 
                                          }
                                      }?>
                                      
                                    



                                  </td>
                                  <td>
                                  
                                      <?php 
                                      foreach ($aa->result() as $keybb ) { 
                                          $data['tindakan_lab'] = $keybb->item_paket;
                                          echo $this->Content_m->get_value('siak_re_account_chart','id',$keybb->item_paket,'name');
                                          echo "<br>";
                                          $this->load->view('front_office/ugd/periksa/hasil_lab/hasil_pemeriksaan_lab_text',$data);
                                          echo "<br>";
                                          echo "<br>";
                                         
                                      }

                                      if($cek == 0){
                                          $this->load->view('front_office/ugd/periksa/hasil_lab/hasil_pemeriksaan_lab_text',$data);
                                         
                                      }?>


                                  </td>

                                  <td align="center"><a data-toggle="tooltip" data-placement="top" title="Hapus Tindakan Lab" href="<?=site_url()?>/front_office/ugd_dir/ugd/del_pemeriksaan_lab/<?=$key->id_re_laboratorium?>/<?=$id_re_kunjungan?>" onclick="return confirm('Apakah anda yakin menghapus entry ini?')" data-id="<?=$i?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a></td>
                                </tr>
                                <?php $i++; $id_lab = $key->id_re_laboratorium; }?>


                                <?php for ($ii=$i; $ii < 30; $ii++) { ?>
                                <tr style="border-top:0px; <?=$ii=='1'?'display: table-row':'display: none'?>" class="pemeriksaan_lab<?=$ii?>">   
                                  <input type="hidden" name="id_re_laboratorium[]" value="tidakada">
                                  <td colspan="2" class="col-md-4" align="center" style="text-align: right; vertical-align: middle;">
                                    <?=date('Y-m-d h:i:s')?>&nbsp;&nbsp;
                                    <input type="hidden" name="tgl_periksa[]" value="<?=date('Y-m-d h:i:s')?>">
                                  </td>

                                  <!--
                                  <td class="col-md-1" align="left">
                                    <select name="no_lab[]" class="sel2" style="padding: 0px; width: 100%;">
                                        <option value=""></option>
                                        <?php foreach ($this->Content_m->select_db('bbmc_re_tempat_lab')->result() as $key ) { ?>
                                        <option value="<?=$key->no_lab?>"><?=$key->no_lab?></option>
                                        <?php }?>
                                    </select>
                                  </td>
                                  -->
                                  <td colspan="3" class="col-md-4" align="left">
                                      <select name="tindakan_lab[]" class="form-control sel2">
                                        <option value=""></option>
                                        <?php 
                                        $id_tipe_pasien = $this->Content_m->get_value('bbmc_tr_pasien','id_re_pasien',$id_re_pasien,'id_type_pasien');
        
                                        if($id_tipe_pasien == '1'){
                                            $this->db->where('id_tindakan','2');
                                        }else if($id_tipe_pasien == '2'){
                                            $this->db->where('id_tindakan','14');
                                        }else if($id_tipe_pasien == '3'){
                                            $this->db->where('id_tindakan','15');
                                        }else if($id_tipe_pasien == '4'){
                                            $this->db->where('id_tindakan','17');
                                        }else if($id_tipe_pasien == '5'){
                                            $this->db->where('id_tindakan','16');
                                        }
                                        
                                        foreach ($this->Content_m->select_db('siak_re_account_chart')->result() as $key ) { ?>
                                         <option value="<?=$key->id?>"><?=$key->name?></option>
                                        <?php }?>
                                        
                                      </select>     
                                      <input style="display: none;" type="text" class="form-control" name="hasil_lab[]" value="" placeholder="Ketik hasil ..">
                                      
                                  </td>
                                 
                                  <td class="col-md-1" align="center" style="text-align: center; vertical-align: middle;"><a data-toggle="tooltip" data-placement="top" title="Hapus Tindakan Lab" href="javascript:;" class="del_pemeriksaan_lab" data-id="<?=$ii?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a></td>
                                </tr>
                                <?php }?>
                                
                              </tbody>
                            </table>

                          
                            
                            <a class="btn btn-xs blue add_pemeriksaan_lab" href="javascript:;" style="margin-top:10px !important">
                              <i class="fa fa-plus"></i>
                            </a>                           
                        </div>
                      </div> 
                    </div>
                  </div>
                  <br>
                  
                  <script type="text/javascript">

                    var a="<?=$i=='1'?'2':$i?>";
                    $(".add_pemeriksaan_lab").click(function(){
                        $(".pemeriksaan_lab"+a).css('display','table-row');
                        a++;
                    });

                    $(".del_pemeriksaan_lab").click(function(){
                        var b= $(this).attr('data-id');
                        $(".pemeriksaan_lab"+b).css('display','none');
                        if(confirm("Hapus entry ini?")){
                          return true;
                        }
                    });

                  </script>           
                    

                  <h4 class="form-section" style="<?=$cek_rad=='true'?'display:block;':'display:none;'?> margin:0px 0px 5px 0px !important; padding-bottom:10px !important; font-size:13px !important"><i class="fa fa-desktop"></i><strong> Data Pemeriksaan Radiologi </strong><hr style="margin:10px 0px 0px 0px !important"> </h4>
                           
                  <div class="row" style="margin-top:0px !important; <?=$cek_rad=='true'?'display:block;':'display:none;'?>">
                    
                    <div class="col-md-12">
                      <div class="form-group" id="form_konsul_spesialis">
                          <div class="table-responsive">
                          <?php 
                          $this->db->where('id_re_kunjungan',$id_re_kunjungan);
                          $q = $this->Content_m->select_db('bbmc_tr_radiologi'); ?>
                          <table id="<?= $controller ?>_table" class="table table-bordered table-striped table-hover" style="margin-bottom:0px; width:100%; font-size:11px !important">
                              <thead>
                                <tr>
                                  <?php if($q->num_rows() == 0){ ?>
                                  <th colspan="3" class="text-right col-md-4" style="font-size:10px !important">Tgl Periksa&nbsp;&nbsp;</th>
                                  <?php }else{ ?>
                                  <th class="text-center col-md-1" style="font-size:10px !important">No</th>
                                  <th class="text-left col-md-2" style="font-size:10px !important">Tgl Periksa</th>
                                  <th class="text-left col-md-1" style="font-size:10px !important">No. Periksa</th>
                                  <?php }?>
                                  
                                  <th class="text-left col-md-5" style="font-size:10px !important">Tindakan Radiologi</th>
                                  <th class="text-left col-md-2" style="font-size:10px !important">Hasil Radiologi</th>
                                  <th class="text-center col-md-1" style="font-size:10px !important">Aksi</th>
                                </tr>
                              </thead>
                              <tbody>
                                <?php 
                                $i=1;
                                foreach ($q->result() as $key ) { ?>
                                <tr style="" class="pemeriksaan_rad<?=$i?>">   
                                  <input type="hidden" name="id_re_radiologi[]" value="<?=$key->id_re_radiologi?>">
                                  <td align="center"><?=$i?></td>
                                  <td align="left">
                                      <?=$key->tgl_periksa?>
                                      <input type="hidden" name="tgl_periksa[]" value="<?=$key->tgl_periksa?>">
                                  </td>
                                  <td align="left">
                                      RAD-<?=$key->id_re_radiologi?>
                                  </td>
                                 
                                  <td align="left">
                                      <?=$this->Content_m->get_value('siak_re_account_chart','id',$key->tindakan_radiologi,'name')?>
                                      <input type="hidden" name="tindakan_radiologi[]" value="<?=$key->tindakan_radiologi?>">        
                                  </td>
                                  <td align="left">
                                      <?=$key->hasil_radiologi?>
                                      <input type="hidden" name="hasil_radiologi[]" value="<?=$key->hasil_radiologi?>">      
                                  </td>
                                  <td align="center"><a data-toggle="tooltip" data-placement="top" title="Hapus Tindakan Radiologi" href="<?=site_url()?>/front_office/ugd_dir/ugd/del_pemeriksaan_radiologi/<?=$key->id_re_radiologi?>/<?=$id_re_kunjungan?>" onclick="return confirm('Apakah anda yakin menghapus entry ini?')" data-id="<?=$i?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a></td>
                                </tr>
                                <?php $i++; $id_radiologi = $key->id_re_radiologi; }?>


                                <?php for ($ii=$i; $ii < 10; $ii++) { ?>
                                <tr style="border-top:0px; <?=$ii=='1'?'display: table-row':'display: none'?>" class="pemeriksaan_radiologi<?=$ii?>">   
                                  <input type="hidden" name="id_re_radiologi[]" value="tidakada">
                                  <td colspan="3" class="col-md-4" align="center" style="text-align: right; vertical-align: middle;">
                                    <?=date('Y-m-d h:i:s')?>&nbsp;&nbsp;
                                    <input type="hidden" name="tgl_periksa[]" value="<?=date('Y-m-d h:i:s')?>">
                                  </td>
                                 
                                  <td class="col-md-4" align="left">
                                      <select name="tindakan_radiologi[]" class="form-control sel2">
                                        <option value=""></option>
                                        <?php 
                                        $this->db->where('id_tindakan','4');
                                        foreach ($this->Content_m->select_db('siak_re_account_chart')->result() as $key ) { ?>
                                         <option value="<?=$key->id?>"><?=$key->name?></option>
                                        <?php }?>
                                      </select>     
                                  </td>

                                  <td class="col-md-2" align="left">
                                      <input type="text" class="form-control" name="hasil_radiologi[]" value="" placeholder="Ketik hasil ..">
                                  </td>
                                  <td class="col-md-1" align="center" style="text-align: center; vertical-align: middle;"><a data-toggle="tooltip" data-placement="top" title="Hapus Tindakan Lab" href="javascript:;" class="del_pemeriksaan_radiologi" data-id="<?=$ii?>"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></a></td>
                                </tr>
                                <?php }?>
                                
                              </tbody>
                            </table>
                            <a class="btn btn-xs blue add_pemeriksaan_radiologi" href="javascript:;" style="margin-top:10px !important">
                              <i class="fa fa-plus"></i>
                            </a>  
                          </div>                           
                      </div>
                    </div>           
                  </div>               
                  <br>    


                  <script type="text/javascript">

                    var a2="<?=$i=='1'?'2':$i?>";
                    $(".add_pemeriksaan_radiologi").click(function(){
                        $(".pemeriksaan_radiologi"+a2).css('display','table-row');
                        a2++;
                    });

                    $(".del_pemeriksaan_radiologi").click(function(){
                        var b2= $(this).attr('data-id');
                        $(".pemeriksaan_radiologi"+b2).css('display','none');
                        if(confirm("Hapus entry ini?")){
                          return true;
                        }
                    });

                  </script>           
                    

                  <div style="display: none;">
                  <h4 class="form-section" style="margin:0px 0px 0px 0px !important; padding-bottom:0px !important; font-size:13px !important"><i class="fa fa-stethoscope"></i><strong> Hasil Pemeriksaan UGD </strong><hr style="margin-top:10px !important"> </h4>
                  <div class="row">
                    <div class="col-md-12">
                      <div class="form-group" id="form_tndk_lnjt_pemeriksaan">
                        <label for="tndk_lnjt_pemeriksaan" class="control-label">Tindak Lanjut Pemeriksaan Penunjang </label>
                        <textarea id="tndk_lnjt_pemeriksaan" name="tindak_lanjut_pemeriksaan" cols="30" rows="2" class="form-control"><?=$get_kunjungan->tindak_lanjut_pemeriksaan?></textarea>                 
                        <span id="error_tndk_lnjt_pemeriksaan" class="help-block"></span>
                      </div> 
                    </div>
                    <div class="col-md-12">
                      <div class="form-group" id="form_hsl_observasi_ugd">
                        <label for="hsl_observasi_ugd" class="control-label">Hasil Observasi di UGD </label>
                        <textarea id="hsl_observasi_ugd" name="hasil_ovservasi_ugd" cols="30" rows="2" class="form-control"><?=$get_kunjungan->hasil_ovservasi_ugd?></textarea>                 
                        <span id="error_hsl_observasi_ugd" class="help-block"></span>
                      </div>       
                    </div>
                  </div>   
                  </div>              

                </div>
                <div class="form-actions right">
                  <a type="button" class="btn default" href="<?= site_url('front_office/'.$controller_dir.$controller) ?>">Kembali</a>
                  <button type="submit" class="btn blue"><i class="fa fa-check"></i> Simpan</button>
                </div>
              </form>
            </div>
            <?php $this->load->view('front_office/include/loading');?>
        </div>
    </div>
</div>
<script type="text/javascript">
	$(document).ready(function() {
     /*-------------Datepicker-------------*/
     $('#datepicker_keluar_ugd').datepicker({
      format: "yyyy-mm-dd",
      clearBtn: true,
      language: 'id',
      autoclose: true,
      todayHighlight: true
    });


    $(".sel2").select2({
      placeholder: "Pilih ..",
      language: "id"
    });


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

  });
</script>
<?php $this->load->view('front_office/script/form_data'); ?>


<script type="text/javascript">
    jQuery( document ).ready( function (){

       var id_reg_pd = "<?=@$id_re_pasien?>";
       
       $('.sel-file').change(function(){
            var dok = $(this).attr('data-dokumen');
            var id_kunjungan = $(this).attr('data-kunjungan');
            var id_tindakan = $(this).attr('data-tindakan');

            var i = $(this).attr('data-id');
            //alert(i);
            var file = $( '.sel-file' ).get( i ).files[0],
            formData = new FormData();

            //alert(i);
            //alert(file);
            
            //if(file.size > 1000000){
            if(file.size > 100000000){

                alert('File size melebihi kapasitas standar'); 
                //alert(file.size);
            }else{
                
                var newFileName = dok+"_"+id_reg_pd+".jpg";
                formData.append('file', file, newFileName);
                console.log( file );
                $.ajax( {
                    url        : "<?=site_url('front_office/ajax/upload_file')?>"+'/'+id_reg_pd+'/'+id_kunjungan+'/'+id_tindakan,
                    type       : 'POST',
                    contentType: false,
                    cache      : false,
                    processData: false,
                    data       : formData,
                    xhr        : function ()
                    {
                        var jqXHR = null;
                        if ( window.ActiveXObject )
                        {
                            jqXHR = new window.ActiveXObject( "Microsoft.XMLHTTP" );
                        }
                        else
                        {
                            jqXHR = new window.XMLHttpRequest();
                        }

                        //Upload progress
                        jqXHR.upload.addEventListener( "progress", function ( evt )
                        {
                            if ( evt.lengthComputable )
                            {
                                var percentComplete = Math.round( (evt.loaded * 100) / evt.total );
                                //Do something with upload progress
                                $('.progres_bar1_div_'+dok).css('display','block');
                                //$('.ket1_'+dok).css('display','none');
                                //alert(dok);
                                $('.progress-bar_'+dok).css('width',percentComplete+'%');
                                $('.progress-bar_'+dok).css('border','5px solid green');
                                $('.text_hasil_'+dok).text('Hasil berhasil di upload');
                                
                                console.log( 'Uploaded percent', percentComplete );
                            }
                        }, false );

                        //Download progress
                        jqXHR.addEventListener( "progress", function ( evt )
                        {
                            if ( evt.lengthComputable )
                            {
                                var percentComplete = Math.round( (evt.loaded * 100) / evt.total );
                                //Do something with download progress
                                console.log( 'Downloaded percent', percentComplete );
                            }
                        }, false );

                        return jqXHR;
                    },
                    success    : function ( data )
                    {


                        //$('.sukses').css('display','block');
                        $('.sedang_diperiksa1_'+dok).css('display','table-cell');
                        $('.belum_diupload1_'+dok).css('display','none');
                        
                        
                        console.log( 'Completed.' );
                    }
                } );
            }
        });

    } );

</script>

