<!DOCTYPE html>
<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 rel="stylesheet" href="<?php echo base_url('resources/css/bootstrap.min.css') ?>" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.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;
  }
</style>
<script type="text/javascript">
  var drz;
  function lihat(keyword){
    if(keyword.length==0){
      document.getElementById("suggest_box").style.Visibility="hidden";
    }else{
      drz = create_ajax();
      var url = "<?php echo base_url(); ?>antrian_dirput/cari/";
      drz.onreadystatechange=stateChanged;
      var params = "keyword="+keyword;
      //alert('params');
      drz.open("POST",url,true);
      drz.setRequestHeader("Content-type", "application/x-www-formurlencoded");
      drz.setRequestHeader("Content-length", params.length);
      drz.setRequestHeader("Connection", "close");
      drz.send(params);
    }
  }

  function create_ajax(){
    if (window.XMLHttpRequest){
      return new XMLHttpRequest();
    }
    if (window.ActiveXObject){
    return new ActiveXObject("Microsoft.XMLHTTP");
    }
  return null;
  }


  function stateChanged(){
  var data;
    if(drz.readyState==4 && drz.statu==200){
      data = drz.responseText;
      if(data.length>0){
        document.getElementById("suggest_box").innerHTML = data;
        document.getElementById("suggest_box").style.Visibility="";
      }else{
        document.getElementById("suggest_box").innerHTML ="";
        document.getElementById("suggest_box").style.Visibility="hidden";
      }
    }
  }

  function load(keyword){
    document.getElementById("keyword").value=keyword;
    document.getElementById("suggest_box").style.Visibility="hidden";
    document.getElementById("suggest_box").innerHTML="";
  }

</script>  

<div class="wrapper">
  <div class="content-wrapper">
    <!--button data-toggle="modal" data-target="#modalku">MODAR</button-->
    <section class="content-header">
      <h1>LAPORAN UPLOAD
        <small>Dokumen Elektronik (d-Docs) Direktori Putusan Mahkamah Agung</small>
      </h1>
    </section>
  <div class="konten">
    <section class="content">
      <div class="row">
        <div class="col-md-6">
          <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">ANTRIAN E-DOC's PUTUSAN AKHIR UPLOAD <small>Upload e-Docs Pada DIREKTORI PUTUSAN</small></h3>
            </div>
            <div class="box-body" style="font-size: 12;">
              <ul class="todo-list">
                <li>
                  <!-- drag handle -->
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <!-- checkbox -->
                  <!-- todo text -->
                  <span class="text">Jumlah Perkara Putus</span>
                  <!-- Emphasis label -->
                  <small class="label label-primary" style="font-size: 13px;"><i class="fa fa-balance-scale"></i> <?php echo $putus ;?></small>
                  <!-- General tools such as edit or delete-->
                  <div class="tools">
                    <!--i class="fa fa-eye" id="putus_list" nama="putus_list" value="1" data-toggle="modal" data-target="#modalku"></i-->
                    <i class="fa fa-eye putus_list" id="putus_list" nama="putus_list" value="1" ></i>
                  </div>
                </li>
                <li>
                  <!-- drag handle -->
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <!-- checkbox -->
                  <!-- todo text -->
                  <span class="text">Jumlah Perkara Minutasi</span>
                  <!-- Emphasis label -->
                  <small class="label label-danger" style="font-size: 13px;"><i class="fa fa-legal"></i> <?php echo $minutasi ?></small>
                  <!-- General tools such as edit or delete-->
                  <div class="tools">
                    <i class="fa fa-eye putus_list " value="2"></i>
                  </div>
                </li>
                <li>
                  <!-- drag handle -->
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <!-- checkbox -->
                  <!-- todo text -->
                  <span class="text">Jumlah Perkara Belum Minutasi</span>
                  <!-- Emphasis label -->
                  <small class="label label-danger" style="font-size: 13px;"><i class="fa fa-legal"></i> <?php echo $belumminutasi ?></small>
                  <!-- General tools such as edit or delete-->
                  <div class="tools">
                    <i class="fa fa-eye"></i>
                  </div>
                </li>
                <li>
                  <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Jumlah File Putusan yang diupload (lokal)</span>
                  <small class="label label-info" style="font-size: 13px;"><i class="fa fa-download"></i> <?php echo $jumlah_edoc ?> </small>
                  <div class="tools">
                    <i class="fa fa-eye"></i>
                  </div>
                </li>
                <li>
                  <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Jumlah File Putusan yang Belum diupload (lokal)</span>
                  <small class="label label-info" style="font-size: 13px;"><i class="fa fa-file-pdf-o"></i> <?php echo $jum_non_edoc ?> </small>
                  <div class="tools">
                    <i class="fa fa-eye"></i>
                  </div>
                </li>
                <li>
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Jumlah Putusan yang sudah diupload ke Direktori Putusan (e-Docs)</span>
                  <small class="label label-success" style="font-size: 13px;"><i class="fa fa-paper-plane-o"></i> - </small>
                  <div class="tools">
                    <i class="fa fa-eye"></i>
                  </div>
                </li>
                <li>
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Jumlah Putusan yang belum diupload ke Direktori Putusan (e-Docs)</span>
                  <small class="label label-success" style="font-size: 13px;"><i class="fa fa-times-circle"></i> - </small>
                  <div class="tools">
                    <i class="fa fa-eye"></i>
                  </div>
                </li>
                <li>
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Jumlah Putusan yang gagal upload ke Direktori Putusan (e-Docs)</span>
                  <small class="label label-primary" style="font-size: 13px;"><i class="fa fa-warning"></i> - </small>
                  <div class="tools">
                    <i class="fa fa-eye"></i>
                  </div>
                </li>
                <li>
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Jumlah Antrian Saat ini</span>
                  <small class="label label-warning" style="font-size: 13px;"><i class="fa  fa-hourglass-half"></i> 1 </small>
                  <div class="tools">
                    <i class="fa fa-eye"></i>
                  </div>
                </li>
              </ul>
            </div>
          </div>
          <div class="box">
          </div>
        </div>
        <div class="col-md-6">
          <div class="box">
                        <div class="box-header with-border">
              <h3 class="box-title">ANTRIAN E-DOC's UPAYA HUKUM UPLOAD <small>BANDING,KASASI,PENINJAUAN KEMABALI</small></h3>
            </div>
            <div class="box-body ">
              <table class="table table-bordered" style="font-size: 14px;">
                <tr>
                  <th style="width: 10px">#</th>
                  <th>Task</th>
                  <th>Progress</th>
                  <th style="width: 40px">Label</th>
                </tr>
                <tr>
                  <td>1.</td>
                  <td>Uploading Putusan Akhir (TK I)</td>
                  <td>
                    <div class="progress progress-xs">
                      <div class="progress-bar progress-bar-danger" style="width: 55%"></div>
                    </div>
                  </td>
                  <td><span class="badge bg-red">55%</span></td>
                </tr>
                <tr>
                  <td>2.</td>
                  <td>Uploading File Upaya Hukum Kasasi</td>
                  <td>
                    <div class="progress progress-xs">
                      <div class="progress-bar progress-bar-yellow" style="width: 70%"></div>
                    </div>
                  </td>
                  <td><span class="badge bg-yellow">70%</span></td>
                </tr>
                <tr>
                  <td>3.</td>
                  <td>Uploading File Upaya Hukum Peninjauan Kembali</td>
                  <td>
                    <div class="progress progress-xs progress-striped active">
                      <div class="progress-bar progress-bar-primary" style="width: 30%"></div>
                    </div>
                  </td>
                  <td><span class="badge bg-light-blue">30%</span></td>
                </tr>
                <tr>
                  <td>4.</td>
                  <td>Uploading File Pendukung Lainnya</td>
                  <td>
                    <div class="progress progress-xs progress-striped active">
                      <div class="progress-bar progress-bar-success" style="width: 90%"></div>
                    </div>
                  </td>
                  <td><span class="badge bg-green">90%</span></td>
                </tr>
              </table>
            </div>
            <div class="box-footer clearfix">
              <ul class="pagination pagination-sm no-margin pull-right">
                <li><a href="#">&laquo;</a></li>
                <li><a href="#">1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">&raquo;</a></li>
              </ul>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->

          <div class="box">
          </div>
          <!-- /.box -->
        </div>
        <!-- /.col -->
      </div>
      <!-- /.row -->
      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">DETIL LAPORAN UPLOAD E-DOC PUTUSAN AKHIR</h3>

              <div class="box-tools">
                <form method="post" action="<?php echo base_url(); ?>antrian_dirput/cari/" >
                <div class="input-group input-group-sm" style="width: 400px;">
                  <input type="text" id ="keyword" name="keyword" class="form-control pull-right" placeholder="Search" onkeyup=lihat(this.value)>
                  <div class="input-group-btn">
                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                  </div>
                </div>
                </form>
              </div>
              <div id="suggest_box" style="position:absolute;top:36;left:15;backgroundcolor:lightblue;width:200;visibility:hidden;z-index:100">
              <?php 
                echo $ls_noperkara;
              ?>
            </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <table class="table table-hover" style="font-size: 13px;">
                <tr>
                  <th>NO</th>
                  <th>Jenis Perkara</th>
                  <th>Nomor Perkara</th>
                  <th>Status</th>
                  <th>Tanggal Masuk Antrian</th>
                  <th>Percobaan Terakhir</th>
                  <th>Status Upload</th>
                </tr>
                <?php 
                //echo $jlhpage;
                if(!$jlhpage){ 
                      $no=1;
                }else{
                      $no=$jlhpage+1;
                }
                if(count($data_antrian)>0){
                    foreach ($data_antrian as $row) {
                    //print_r($data_antrian->result());
                      echo "<tr>";
                        echo '<td align="center">'.$no++.'</td>';
                        echo '<td>'.$row->nama.'</td>';
                        echo '<td align="left">'.$row->nomor_perkara.'</td>';
                        if($row->status=='0'){
                          $label = 'label-warning" style="font-size: 12px;"> Pending Queuee</span></td>';
                        }else if($row->status=='1'){
                          $label = 'label-success" style="font-size: 12px;"> Delivered</span></td>';
                        }else if($row->status=='-1'){
                          $label = 'label-danger" style="font-size: 12px;"> Error Queuee</span></td>';
                        }
                        echo '<td align="left"><span class="label '.$label;
                          $tanggalinput=explode(" ",$row->tgl_masuk);
                          if(count($tanggalinput)>1){
                              $tanggal=$this->tanggalhelper->convertDayDate($tanggalinput[0]);
                              $tglinputprint = $tanggalinput[1];
                          }else{
                              $tanggal='';
                              $tglinputprint = '';
                          }
                        echo '<td align="left">'.$tanggal." ".$tglinputprint.'</td>';
                          $tanggalinput=explode(" ",$row->last_tried);
                          if(count($tanggalinput)>1){
                              $tanggal=$this->tanggalhelper->convertDayDate($tanggalinput[0]);
                              $tglinputprint = $tanggalinput[1];
                          }else{
                              $tanggal='';
                              $tglinputprint = '';
                          }
                        echo '<td align="left">'.$tanggal." ".$tglinputprint.'</td>';
                        if($row->status=='0'){
                          echo '<td align="left">Masuk Antrian</td>';
                        }else{
                          echo '<td align="left">'.$row->keterangan.'</td>';
                        }
                        
                        echo "</tr>";
                      $con++;
                    }
                  }else{
                    echo "<tr><td colspan='7' align='center'>Tidak Ada Data</td></tr>";
                  }
                ?>
              </table>
            </div>
            <div class="box-footer clearfix">
              <?php echo $paginator; ?>
            </div>
          </div>
        </div>
      </div>
    </section>
  </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/jquery-2.2.3.min.js') ?>"></script>
<script src="<?php echo base_url('resources/js/bootstrap.min.js') ?>"></script>
<script type="text/javascript">

$(document).ready(function(){   
    $(".putus_list").click(function()
    {       
     $.ajax({
         type: "POST",
         url: '<?php echo base_url()?>antrian_dirput/ajax_list', 
         data: {idlist: $(this).attr('value')},
         dataType: "text",  
         cache:false,
         success: 
              function(data){
                //alert(data);  //as a debugging message.
                //$('#modalku').load('<?php echo base_url()?>antrian_dirput/show_list/');
                $('#modalku_konten').empty();
                $('#modalku_konten').append(data);
                $("#modalku").modal('show');
                //$("#modalku").fadeIn();
              }
          });// you have missed this bracket
     return false;
 });
 });

$(function(){
   $("#pagination-div-id a").click(function(){
   $.ajax({
   type: "POST",
   url: $(this).attr("href"),
   data:"q=<?php echo $searchString; ?>",
   success: function(res){
      $("#containerid").html(res);
   }
   });
   return false;
   });
});
</script>
</body>
</html>
