<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') ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.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>[Permohonan Bantuan Delegasi Relaas Panggilan Keluar]</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">MENU CARI DAN TAMBAH DELEGASI <small></small></h4>
                  <table class="table table-responsive"><tbody>
                      <tr>
                          <td>Cari Delegasi berdasarkan Nomor Perkara
                              <div class="input-group input-group-sm" style="width: 400px;">
                                <input type="text" id ="key_cari_delegasi" name="key_cari_delegasi" class="form-control pull-right" placeholder="Ketik Nomor Perkara atau Nama Pihak minimal 5 huruf">
                                <div class="input-group-btn">
                                  <button type="submit" id="key_c" class="btn btn-default"><i class="fa fa-search"></i></button>
                                </div>
                              </div>

                        </td>
                          <td><br>
                              <?php
                              if($this->session->userdata('is_logged_in')){
                                if($this->authorization->HasRuleDelegasiJurusita($iddelegasi) AND $this->session->userdata('idgroup')!=600){
                              ?>                            
                              <a href="#" onClick="popup_form('<?php echo base_url('manage_delegasi_perkara/tambah_delegasi_keluar');?>')" class="btn btn-success btn-md"><i class="fa fa-plus-square"></i> Tambah Delegasi</a>
                              <?php } } ?>
                              <a href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode(2)) ?>" class="btn btn-warning"><i class="fa fa-bars"></i> Daftar Delegasi Keluar</a>
                              <a href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode(1)) ?>" class="btn btn-danger"><i class="fa fa-bars"></i> Daftar Delegasi Masuk</a>
                              <a href="#" onClick="cek_delegasi_masuk()" class="btn btn-warning"><i class="fa fa-edit"></i> CEK DELEGASI MASUK</a><span id="load_delegasi"> <small><font color="red"><i class="fa fa-refresh fa-spin"></i> Proses..</span></font></small>
                            </td>
                      </tr>
                      </tbody>
                  </table>
              </div>
              
          </div> 
          <div class="box" id="hasil_cari_delegasi"></div>         
          <div class="box">
              <div class="box-header with-border">
              <h3 class="box-title">ANTRIAN DELEGASI KELUAR YANG BELUM DIKIRIM <small><br>Delegasi baru bisa dikirim setelah anda mengunggah dokumen</small></h3>
            </div>
            <div class="box-body ">
              <table class="table table-bordered table-hover" style="font-size: 14px;">
                <tr>
                  <th style="width: 3%;text-align:center">No.</th>
                  <th style="width: 30%">Nomor Perkara<br>Pihak</th>
                  <th style="width: 12%">Tanggal Delegasi</th>
                  <th style="width: 17%">Pengadilan Tujuan</th>
                  <th style="width: 10%">Status Dokumen</th>
                  <th style="width: 5%">Aksi</th>
                </tr>
                <?php 
                if($delegasi_blm_dikirim->num_rows()>0) {
                  $i=1;
                  foreach ($delegasi_blm_dikirim->result() as $row) {
                    $st_doc=$row->ada;
                    if($st_doc>0){
                      $stdoc=$row->ada." dokumen";
                    }else{
                      $stdoc="<font color=red>Belum ada dokumen</font>";
                    }
                      echo "
                          <tr>
                            <td>".$i."</td>
                            <td>".$row->nomor_perkara."<br>".$row->pihak."</td>
                            <td>".$this->tanggalhelper->convertDayDate($row->tgl_delegasi)."</td>
                            <td>".ucwords(strtolower($row->pn_tujuan_text))."</td>
                            <td>".$stdoc."</td>";
                      echo '<td><a class="btn btn-success btn-sm" href="'.base_url('manage_delegasi_perkara/detil_delegasi/'.base64_encode($this->encrypt->encode(2))."/".base64_encode($this->encrypt->encode($row->id))."/".base64_encode($this->encrypt->encode($row->id_pn_asal))."/".base64_encode($this->encrypt->encode($row->id_pn_tujuan))).'/2"><i class="fa fa-send"></i> Kirim</a></td>
                          </tr>
                      ';
                    $i++;
                  }
                }
                ?>
              </table>
            </div>

          </div>          
          <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">STATISTIK DELEGASI KELUAR BERDASARKAN TAHAPAN PROSES PELAKSANAAN</small></h3>
            </div>
            <div class="box-body" style="font-size: 12;">
              <ul class="todo-list">
                <a href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode('k_blm_k')) ?>"><li class="statistik"> 
                    <i class="fa fa-envelope"></i>
                  <span >Bantuan Delegasi Keluar Belum Terkirim</span>
                  <div class="tools"><?php echo $k_blm_kirim?> delegasi</div>
                </li>
                </a>
                <a href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode('k_sdh_k')) ?>"><li class="statistik">
                    <i class="fa fa-envelope"></i>
                  <span >Bantuan Delegasi Keluar Sudah Terkirim</span>
                  <div class="tools"><?php echo $k_sdh_kirim?> delegasi</div>
                </li>
                </a>
                <a href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode('k_sdh_l')) ?>"><li class="statistik" >
                    <i class="fa fa-envelope"></i>
                  <span>Bantuan Delegasi Keluar Sudah Dilaksanakan</span>
                  <div class="tools"><?php echo $k_sdh_dilaksanakan?> delegasi</div>
                </li>
                </a>
                <a  href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode('k_blm_l')) ?>"><li class="statistik">
                    <i class="fa fa-envelope"></i>
                  <span >Bantuan Delegasi Keluar Belum Dilaksanakan</span>
                  <div class="tools"><?php echo $k_blm_dilaksanakan?> delegasi</div>
                </li>
                </a>
                <a  href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode(2)) ?>"><li class="statistik">
                    <i class="fa fa-envelope"></i>
                  <span>Total Delegasi Keluar</span>
                  <div class="tools"><?php echo $k_total_k?> delegasi</div>
                </li>
                </a>

              </ul>
            </div>
          </div>
          <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">STATISTIK DELEGASI MASUK BERDASARKAN TAHAPAN PROSES PELAKSANAAN</small></h3>
            </div>
            <div class="box-body" style="font-size: 12;">
              <ul class="todo-list">
                <a href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode('m_sdh_l')) ?>"><li class="statistik" >
                    <i class="fa fa-envelope"></i>
                  <span>Bantuan Delegasi Masuk Sudah Dilaksanakan</span>
                  <div class="tools"><?php echo $m_sdh_dilaksanakan?> delegasi</div>
                </li>
                </a>
                <a  href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode('m_blm_l')) ?>"><li class="statistik">
                    <i class="fa fa-envelope"></i>
                  <span >Bantuan Delegasi Masuk Belum Dilaksanakan</span>
                  <div class="tools"><?php echo $m_blm_dilaksanakan?> delegasi</div>
                </li>
                </a>
                <a  href="<?php echo base_url();?>perkara_list_delegasi/type/<?php echo base64_encode($this->encrypt->encode(1)) ?>"><li class="statistik">
                    <i class="fa fa-envelope"></i>
                  <span>Total Delegasi Masuk</span>
                  <div class="tools"><?php echo $m_total_k?> delegasi</div>
                </li>
                </a>

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

<!--         <div class="col-md">
  <div class="box">
    <div class="box-header with-border">
      <h3 class="box-title">STATISTIK DELEGASI MASUK BERDASARKAN TAHAPAN PROSES PELAKSANAAN</small></h3>
    </div>
    <div class="box-body" style="font-size: 12;">
      <ul class="todo-list">
        <li>
            <i class="fa fa-envelope"></i>
          <span class="text">Bantuan Delegasi Masuk Belum Terkirim </span>
          <div class="tools">
            <i class="fa fa-eye putus_list " value="2"></i>
          </div>
        </li>
        <li>
            <i class="fa fa-envelope"></i>
          <span class="text">Bantuan Delegasi Masuk Sudah Terkirim </span>
          <div class="tools">
            <i class="fa fa-eye putus_list " value="2"></i>
          </div>
        </li>
        <li>
            <i class="fa fa-envelope"></i>
          <span class="text">Bantuan Delegasi Masuk Sudah Dilaksanakan</span>
          <div class="tools">
            <i class="fa fa-eye putus_list " value="2"></i>
          </div>
        </li>
        <li>
            <i class="fa fa-envelope"></i>
          <span class="text">Bantuan Delegasi Masuk Belum Dilaksanakan</span>
          <div class="tools">
            <i class="fa fa-eye putus_list " value="2"></i>
          </div>
        </li>
        <li>
            <i class="fa fa-envelope"></i>
          <span class="text">Total Delegasi Masuk</span>
          <div class="tools">
            <i class="fa fa-eye putus_list " value="2"></i>
          </div>
        </li>

      </ul>
    </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 src="<?php echo base_url('resources/js/bootstrap.min.js') ?>"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#hasil_cari_delegasi").hide();
  $("#key_cari_delegasi").keyup(function(){
      var i = $(this).val();
      var i_leng = i.length;
      if(i.indexOf('/') >= 1 || i=="" || i_leng>=5){
        $.post('<?php echo base_url()?>c_delegasi/show_hasil_pencarian', {
          search:i
        }, function(response){
          var json = jQuery.parseJSON(response);
          events = '';
          if(json.st==1){
          $("#hasil_cari_delegasi").html(json.hasil_cari);
          $( "#hasil_cari_delegasi" ).slideDown( "slow", function() {
            $("#hasil_cari_delegasi").show();
            });            
          }else{
            $("#hasil_cari_delegasi").hide();
          }   
        });        
     }
      
  });
});
$('#load_delegasi').hide();
function cek_delegasi_masuk(){
  $('#load_delegasi').show();
   $.ajax({
       url: '<?php echo base_url('manage_delegasi_perkara/get_delegasi_masuk');?>',
       dataType: 'json',
       complete: function(){
           $('#load_delegasi').hide();
      },       
   })
}
$.ajax({
  url: '/path/to/file',
  type: 'default GET (Other values: POST)',
  dataType: 'default: Intelligent Guess (Other values: xml, json, script, or html)',
  data: {param1: 'value1'},
})

</script>
</body>
</html>
