<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link href="<?php echo base_url();?>resources/css/bootstrap.css" rel="stylesheet">
<link href="<?php echo base_url();?>resources/css/jquery.smartmenus.bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="<?php echo base_url('resources/css/AdminLTE.min.css') ?>">
</head>
<style type="text/css">
  #content{overflow: hidden;}
  .modal-besar{
    width: 98%;
  }
</style>
<body class="hold-transition skin-blue layout-top-nav">
<style type="text/css">
  ul {
  font-size: 12px;
  font-style: normal;
  }
.red{
  color: red;
}
.statistik{
  line-height: 35px;
  background-color: #EEEEE6;
  padding-left: 10px;
  border-bottom: 1px dotted #B7B7AF;
  border-collapse: collapse;
  float: left;
  width: 99%;
  background: radial-gradient( 1px -10px, circle, white 18%, red 26px );
}
.statistik:hover{
  color: red;
  background-color: #FFFF99;
}
.tools{
  float: right;
  margin-right: 50px;
  color: red;
}
.col-md{
  padding-left: 15px;
  padding-right: 15px;
}
</style>

<div class="wrapper">
  <div class="content-wrapper">
    <!--button data-toggle="modal" data-target="#modalku">MODAR</button-->
    <section class="content-header">
      <h1>DASHBOARD
        <small>[Pembuatan Virtual Account]</small>
      </h1>
    </section>
  <div class="konten">
    <section class="content">
      <div class="row">
        <div class="col-md">
          <div class="box">
              <div class="box-header with-border">
                  <h4 class="box-title">Cari Pembuatan Virtual Account Yang Sudah Dibayarkan<small></small></h4>
                  <table class="table table-responsive"><tbody>
                      <tr>
                          <td>
                            <div class="col-md-7">
                              Cari dengan Nama Pemohon atau Nomor VA (4 digit dari belakang)
                              <div class="input-group input-group-sm" style="width: 400px;">
                                <input type="text" id ="key_cari_efiling" name="key_cari_efiling" class="form-control pull-right" placeholder="Nama Pemohon atau Nomor VA">
                                <div class="input-group-btn">
                                  <button type="submit" id="key_c" class="btn btn-default"><i class="fa fa-search"></i></button>
                                </div>
                              </div>
                            </div>
                            <div class="col-md-2">
                              <br>                              
                              <a href="#" onClick="cek_status_bayar()" class="btn btn-sm btn-warning"><i class="fa fa-building-o"></i> Cek Status Pembayaran</a>
							  <span id="load_status_bayar" style="display: none;"><small><font color="red"><i class="fa fa-refresh fa-spin"></i>&nbsp;Proses..</small></span>
                            </div>
                            <div class="col-md-2">
                              <br>                              
                              <a href="#" onClick="popup_form('<?php echo base_url('tambah_va');?>')" class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> Tambah Virtual Account</a>
                            </div>
                        </td>
                      </tr>
                      </tbody>
                  </table>
              </div>
              
          </div> 
          <div class="box" id="hasil_cari_efiling"></div>         
          <div class="box" id="hasil_efiling">
              <div class="box-header with-border">
              <h3 class="box-title">List Panjar Yang Sudah Dibayar</h3>
            </div>
            <div class="box-body ">
              <table class="table table-bordered table-hover  table-striped" style="font-size: 14px;">
                <tr>
                  <th style="width: 3%;text-align:center">No.</th>
                  <th style="width: 12%; text-align:center">Tanggal Pembuatan</th>
                  <th style="width: 12%; text-align:center">Tanggal Kedaluwarsa</th>
                  <th style="width: 17%; text-align:center">Data Pihak</th>
                  <th style="width: 17%; text-align:center">Nomor Virtual Account</th>
                  <th style="width: 10%; text-align:center">Jumlah Panjar</th>
                  <th style="width: 5%; text-align:center">Aksi</th>
                </tr>
                <?php 
                if($epayment_sudah_bayar->num_rows()>0) {
                  $i=1;
                  foreach ($epayment_sudah_bayar->result() as $row) {
                    if($row->perkara_id=='' AND $row->jenis_biaya==1 AND $row->is_jurnal!=1){
                      echo "
                          <tr>
                            <td>".$i."</td>
                            <td>".$this->tanggalhelper->convertDayDate($row->tgl_rekam)."<br> Jam :".$row->jam_rekam."</td>
                            <td>".$this->tanggalhelper->convertDayDate($row->tgl_hbs)."<br> Jam :".$row->jam_hbs."</td>
                            <td>".$row->customer_name."<br> ".$row->email."<br> ".$row->telepon."</td>
                            <td>".$row->va_id."</td>
                            <td> Rp. ".number_format($row->nominal,2,',','.')."</td>";
                            echo '<td><a href="'.base_url().'add_perdata_online/'.base64_encode($this->encrypt->encode($row->alur_perkara_id)).'/'.base64_encode($this->encrypt->encode($row->tahapan_id)).'/'.base64_encode($this->encrypt->encode($row->epayment_id)).'/'.$row->nominal.'/0" class="btn btn-success btn-sm" href=""><i class="fa fa-plus"></i> Tambah Perkara </a></td>
                          </tr>
                      ';
					  $i++;
                    }elseif(!empty($row->perkara_id) AND $row->jenis_biaya==2 AND $row->is_jurnal!=1){
                      echo "
                          <tr>
                            <td>".$i."</td>
                            <td>".$this->tanggalhelper->convertDayDate($row->tgl_rekam)."<br> Jam :".$row->jam_rekam."</td>
                            <td>".$this->tanggalhelper->convertDayDate($row->tgl_hbs)."<br> Jam :".$row->jam_hbs."</td>
                            <td>".$row->customer_name."<br> ".$row->email."<br> ".$row->telepon."</td>
                            <td>".$row->va_id."</td>
                            <td> Rp. ".number_format($row->nominal,2,',','.')."</td>";
                            echo '<td><a href="#" onClick="popup_form(\''.base_url('add_tambah_panjar/'.base64_encode($this->encrypt->encode($row->perkara_id)).'/'.base64_encode($this->encrypt->encode($row->alur_perkara_id)).'/'.base64_encode($this->encrypt->encode($row->tahapan_id))).'/'.$row->nominal.'/'.$row->va_id.'\')" class="btn btn-success btn-sm"><i class="fa fa-plus"></i> Tambah Jurnal </a> </td>
                          </tr>
                      ';
					  $i++;
                    }
                    
                  }
                }
                ?>
              </table>
            </div>

          </div>                
          <div class="box">
              <div class="box-header with-border">
              <h3 class="box-title">List Panjar Yang Belum Dibayar</h3>
            </div>
            <div class="box-body ">
              <table class="table table-bordered table-hover  table-striped" style="font-size: 14px;">
                <tr>
                  <th style="width: 3%;text-align:center">No.</th>
                  <th style="width: 12%">Tanggal Pembuatan</th>
                  <th style="width: 12%">Tanggal Kedaluwarsa</th>
                  <th style="width: 17%">Data Pihak</th>
                  <th style="width: 17%">Nomor Virtual Account</th>
                  <th style="width: 10%">Jumlah Panjar</th>
                  <th style="width: 5%">Aksi</th>
                </tr>
                <?php 
                if($epayment_blm_bayar->num_rows()>0) {
                  $i=1;
                  foreach ($epayment_blm_bayar->result() as $row) {                    
                      echo "
                          <tr>
                            <td>".$i."</td>
                            <td>".$this->tanggalhelper->convertDayDate($row->tgl_rekam)."<br> Jam :".$row->jam_rekam."</td>
                            <td>".$this->tanggalhelper->convertDayDate($row->tgl_hbs)."<br> Jam :".$row->jam_hbs."</td>
                            <td>".$row->customer_name."<br> ".$row->email."<br> ".$row->telepon."</td>
                            <td>".$row->va_id."</td>
                            <td> Rp. ".number_format($row->nominal,2,',','.')."</td>";
                            echo '<td><a href="" onclick="window.open(\''.base_url('c_payment/cetak_bayar/'.base64_encode($this->encrypt->encode($row->epayment_id))).'\')" class="btn btn-success btn-sm" href=""><i class="fa fa-send"></i> Cetak </a></td>                            
                          </tr>';
                    $i++;
                  }
                }
                ?>
              </table>
            </div>

          </div> 
                   



  <div class="control-sidebar-bg"></div>
  <div class="modal fade" id="modalku"  tabindex="-1" role="dialog">
    <div class="modal-dialog modal-besar">
        <div id='modalku_konten'class="modal-content">
            
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
</div>


<script type="text/javascript">
$(document).ready(function(){
  $("#hasil_cari_efiling").hide();
  $("#key_cari_efiling").keyup(function(){
      var i = $(this).val();
      var i_leng = i.length;
      if(i.indexOf('/') >= 1 || i=="" || i_leng>=3){
        $.post('<?php echo base_url()?>cari_epayment', {
          search:i, status:1
        }, function(response){
          var json = jQuery.parseJSON(response);
          events = '';
          if(json.st==1){
            $("#hasil_efiling").hide();
            $("#hasil_cari_efiling").html(json.hasil_cari);
            $("#hasil_cari_efiling" ).slideDown( "slow", function() {
              $("#hasil_cari_efiling").show();
              });            
          }else{
            $("#hasil_cari_efiling").hide();
			$("#hasil_efiling").show();
          }   
        });        
     }else{
        $("#hasil_cari_efiling").hide();
        $("#hasil_efiling").show();
     }
      
  });
  $('#load_status_bayar').hide();
  
});
function cek_status_bayar(){
  $('#load_status_bayar').show();
	$.ajax({
	   url: '<?php echo base_url('cek_status_pembayaran_va');?>',
	   dataType: 'json',
	   complete: function(){
		   $('#load_status_bayar').hide();
		   location.reload();
	  },       
	})
	}
</script>
</body>
</html>
