<link href="<?php echo base_url();?>resources/css/bootstrap.css" rel="stylesheet">
<link rel="stylesheet" href="<?php echo base_url('resources/css/AdminLTE.css') ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
<style type="text/css">
  #content{overflow: hidden;}
  .modal-besar{
    width: 98%;
  }
</style>
<body class="skin-blue layout-top-nav">
<style type="text/css">
  ul {
  font-size: 12px;
  font-style: normal;
  }
</style>

<div class="wrapper">
  <div class="content-wrapper">
    <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>
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Jumlah Perkara Putus</span>
                  <small class="label label-primary" style="font-size: 12px;"><i class="fa fa-balance-scale"></i> <?php echo number_format($putus,0,",","."); ?></small>
                  <div class="tools">
                    <i class="fa fa-eye putus_list" id="putus_list" nama="putus_list" value="1" ></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 Perkara Minutasi</span>
                  <small class="label label-danger" style="font-size: 12px;"><i class="fa fa-legal"></i> <?php echo number_format($minutasi,0,",","."); ?></small>
                  <div class="tools">
                    <i class="fa fa-eye putus_list" value="2"></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 Perkara Belum Minutasi</span>
                  <small class="label label-danger" style="font-size: 12px;"><i class="fa fa-legal"></i> <?php echo number_format($belumminutasi,0,",","."); ?></small>
                  <div class="tools">
                    <i class="fa fa-eye putus_list" value="3"></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: 12px;"><i class="fa fa-download"></i> <?php echo number_format($jumlah_edoc,0,",","."); ?> </small>
                  <div class="tools">
                    <i class="fa fa-eye putus_list" value="4"></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: 12px;"><i class="fa fa-file-pdf-o"></i> <?php echo number_format($jum_non_edoc,0,",",".") ?> </small>
                  <div class="tools">
                    <i class="fa fa-eye putus_list" value="5"></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 Tercatat pada Direktori Putusan (e-Docs)</span>
                  <small class="label label-success" style="font-size: 12px;"><i class="fa fa-paper-plane-o"></i> <?php echo number_format($jumlahDirput,0,",","."); ?> </small>
                  <div class="tools">
                    <i class="fa fa-eye dirput_list" value="6"></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: 12px;"><i class="fa fa-times-circle"></i> - </small>
                  <div class="tools">
                    <i class="fa fa-eye putus_list" value="7"></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 [AMBIGU] Pada Direktori Putusan (e-Docs)</span>
                  <small class="label label-primary" style="font-size: 12px;"><i class="fa fa-warning"></i>
                  <?php 
                    if($jumlahDirputAmbigu>0){
                      echo number_format($jumlahDirputAmbigu,0,",",".");
                    }else{
                      echo 'Tidak Ada Data';
                    }
                  ?>
                    </small>
                  <div class="tools">
                    <i class="fa fa-eye dirput_ambigu" value="8"></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: 12px;"><i class="fa fa-hourglass-half"></i> <?php echo $jumlah_row;?> </small>
                   Masuk <span class="badge bg-green"><?php echo $jml_antrian[0]['masuk'];?></span> Sukses <span class="badge bg-green"><?php echo $jml_antrian[0]['sukses'];?></span> Gagal <span class="badge bg-red"><?php echo $jml_antrian[0]['error'];?></span>
                  <div class="tools">
                    <i class="fa fa-eye antrian_list" value="9"></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-responsive no-padding">
              <table class="table table-hover" style="font-size: 13px;">
                <tr>
                  <th style="width: 10px">#</th>
                  <th>Task</th>
                  <th>Progress</th>
                  <th style="width: 40px">Label</th>
                </tr>
                <tr>
                  <td><a>1.</a></td>
                  <td ><a id="putusan_tk_1" href="#" value=1>e-Docs Putusan Akhir Tingkat Pertama</a></td>
                  <td>
                    <div class="progress progress-xs">
                      <?php 
                        if(number_format($rasioTK1,0,',','.')<=50){
                          $progressBar = 'progress-bar-danger';
                          $bg =  'bg-red';
                        }elseif (number_format($rasioTK1,0,',','.')>50 && number_format($rasioTK1,0,',','.')<90) {
                          $progressBar = 'progress-bar-yellow'; 
                          $bg =  'bg-yellow';
                        }else{
                          $progressBar = 'progress-bar-success';
                           $bg =  'bg-green'; 
                        }
                      ?>
                      <div class="progress-bar <?php echo $progressBar; ?>" style="width: <?php echo number_format($rasioTK1,0,',','.'); ?>%"></div>
                    </div>
                  </td>
                  <td><span class="badge <?php echo $bg; ?>"><?php echo $rasioTK1; ?> %</span></td>
                </tr>
                                <tr>
                  <td><a>1.</a></td>
                  <td ><a id="bdg" href="#" value=2>e-Docs Data Dukung Upaya Hukum Banding</a></td>
                  <td>
                    <div class="progress progress-xs">
                      <?php 
                        if(number_format($rasioBDG,0,',','.')<=50){
                          $progressBar = 'progress-bar-danger';
                          $bg =  'bg-red';
                        }elseif (number_format($rasioBDG,0,',','.')>50 && number_format($rasioBDG,0,',','.')<90) {
                          $progressBar = 'progress-bar-yellow'; 
                          $bg =  'bg-yellow';
                        }else{
                          $progressBar = 'progress-bar-success';
                           $bg =  'bg-green'; 
                        }
                      ?>
                      <div class="progress-bar <?php echo $progressBar; ?>" style="width: <?php echo number_format($rasioBDG,0,',','.'); ?>%"></div>
                    </div>
                  </td>
                  <td><span class="badge <?php echo $bg; ?>"><?php echo $rasioBDG ; ?> %</span></td>
                </tr>
                <tr>
                  <td><a>2.</a></td>
                  <td><a id="kssi" href="#" value=3>e-Docs Data Dukung Upaya Hukum Kasasi</a></td>
                  <td>
                    <div class="progress progress-xs">
                    <?php 
                        if(number_format($rasioKasasi,0,',','.')<=50){
                          $progressBar = 'progress-bar-danger';
                          $bg =  'bg-red';
                        }elseif (number_format($rasioKasasi,0,',','.')>50 && number_format($rasioKasasi,0,',','.')<90) {
                          $progressBar = 'progress-bar-yellow'; 
                          $bg =  'bg-yellow';
                        }else{
                          $progressBar = 'progress-bar-success';
                           $bg =  'bg-green'; 
                        }
                      ?>
                      <div class="progress-bar <?php echo $progressBar; ?>" style="width: <?php echo number_format($rasioKasasi,0,',','.'); ?>%"></div>
                    </div>
                  </td>
                  <td><span class="badge <?php echo $progressBar; ?>"><?php echo $rasioKasasi; ?> %</span></td>
                </tr>
                <tr>
                  <td><a>3.</a></td>
                  <td><a id="pk" href="#" value=4>e-Docs File Upaya Hukum Peninjauan Kembali</a></td>
                  <td>
                    <div class="progress progress-xs progress-striped active">
                    <?php 
                        if(number_format($rasioPK,0,',','.')<=50){
                          $progressBar = 'progress-bar-danger';
                          $bg =  'bg-red';
                        }elseif (number_format($rasioPK,0,',','.')>50 && number_format($rasioPK,0,',','.')<90) {
                          $progressBar = 'progress-bar-yellow'; 
                          $bg =  'bg-yellow';
                        }else{
                          $progressBar = 'progress-bar-success';
                           $bg =  'bg-green'; 
                        }
                      ?>
                      <div class="progress-bar <?php echo $progressBar; ?>" style="width: <?php echo number_format($rasioPK,0,',','.'); ?>%"></div>
                    </div>
                  </td>
                  <td><span class="badge <?php echo $bg; ?>"><?php echo $rasioPK; ?> %</span></td>
                </tr>
              </table>
            </div>
            <div class="box-footer clearfix">
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->

          <div class="box">
            <div class="box-header with-border">
              <h3 class="box-title">
              ANTRIAN SAAT INI!!!
              <small>Upload e-Docs Pada DIREKTORI PUTUSAN</small>
              </h3>
            </div>
            <div class="box-body" id ="antrian_saat_ini" style="font-size: 12;"><i class="fa fa-spinner fa-spin fa-3x fa-fw loader-antrian" style="display:none;position:relative; margin-top: -53px;margin-left: 400px;"></i>
              <ul class="todo-list">
                <li>
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Putusan Terupload :</span>
                  <small class="label label-primary" id="antrian_saat_ini" style="font-size: 12px;"><i class="fa fa-hourglass-half"></i> <?php echo $this->session->userdata('statusputusan');?> Status Antrian</small>
                  <div class="tools">
                    <i class="fa fa-refresh run_queue" id="run_queue" data-toggle="run_queue" title="Refresh Antrian" nama="run_queue" ></i>
                    <i class="fa fa-send-o run_send" id="run_send" data-toggle="run_send" title="Jalankan Antrian" nama="run_send"></i>
                    
                    <!-- <button class="btn bg-orange btn-flat margin" type="button">Jalankan Antrian</button> -->
                  </div>
                </li>
                <li>
                      <span class="handle">
                        <i class="fa fa-ellipsis-v"></i>
                        <i class="fa fa-ellipsis-v"></i>
                      </span>
                  <span class="text">Upaya Hukum</span>
                  <small class="label label-danger" id="upaya_hukum" style="font-size: 12px;"><i class="fa fa-hourglass-half"></i> <?php echo $this->session->userdata('statuspengajuan');?> Antrian</small>
                  <div class="tools">
                    <!-- <i class="fa fa-eye putus_list" value="2"></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">File Pendukung</span>
                  <small class="label label-danger" style="font-size: 12px;"><i class="fa fa-hourglass-half"></i> <?php echo $this->session->userdata('pendukungterupload');?> Antrian</small>
                  <div class="tools">
                    <!-- <i class="fa fa-eye putus_list" value="3"></i> -->
                  </div>
                </li>
              </ul>
              <div class="box-footer clearfix">
            </div>
            </div>
          </div>
          <div class="box"> </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>
    </div>
  </div>
</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(){   
    $("#antrian_saat_ini").on("click","#run_send",function()
    {       
      $('.loader-antrian').show();
      //$("#antrian_saat_ini").fadeOut('slow');
      $("#antrian_saat_ini").load('<?php echo base_url('/api/Putusan/antrian_upload_to_send');?>');
      //$("#antrian_saat_ini").fadeIn('slow');
    });

    $("#antrian_saat_ini").on("click","#run_queue",function()
    {       
      $('.loader-antrian').show();
      $("#antrian_saat_ini").fadeOut('slow');
      $("#antrian_saat_ini").load('<?php echo base_url('/api/Putusan/statusputusan');?>');
      $("#antrian_saat_ini").fadeIn('slow');
    });

    $(".putus_list").click(function(){
      id = $(this).attr('value');
      $('body').append("<form method='post' id='hidden_form' hidden action='<?php echo base_url(); ?>antrian_dirput/show_list'><input name='idRow' value='"+id+"'></form>")
      $('#hidden_form').submit();
      return false;
    });

    $(".antrian_list").click(function(){
      id = $(this).attr('value');
      $('body').append("<form method='post' id='hidden_form' hidden action='<?php echo base_url(); ?>antrian_dirput/antrian_list'><input name='idRow' value='"+id+"'></form>")
      $('#hidden_form').submit();
      return false;
    });

    $(".dirput_list").click(function(){
      id = $(this).attr('value');
      $('body').append("<form method='post' id='hidden_form' hidden action='<?php echo base_url(); ?>antrian_dirput/dirput_list'><input name='idRow' value='"+id+"'></form>")
      $('#hidden_form').submit();
      return false;
    });

    $(".dirput_ambigu").click(function(){
      id = $(this).attr('value');
      $('body').append("<form method='post' id='hidden_form' hidden action='<?php echo base_url(); ?>antrian_dirput/dirput_ambigu'><input name='idRow' value='"+id+"'></form>")
      $('#hidden_form').submit();
      return false;
    });
    
    $("#putusan_tk_1").click(function(){
      id = $(this).attr('value');
      $('body').append("<form method='post' id='hidden_form' hidden action='<?php echo base_url(); ?>antrian_dirput/upaya_hukum_list'><input name='idRow' value='"+id+"'></form>")
      $('#hidden_form').submit();
      return false;
    });

    $("#bdg").click(function(){
      id = $(this).attr('value');
      $('body').append("<form method='post' id='hidden_form' hidden action='<?php echo base_url(); ?>antrian_dirput/upaya_hukum_list'><input name='idRow' value='"+id+"'></form>")
      $('#hidden_form').submit();
      return false;
    });

    $("#kssi").click(function(){
      id = $(this).attr('value');
      $('body').append("<form method='post' id='hidden_form' hidden action='<?php echo base_url(); ?>antrian_dirput/upaya_hukum_list'><input name='idRow' value='"+id+"'></form>")
      $('#hidden_form').submit();
      return false;
    });

    $("#pk").click(function(){
      id = $(this).attr('value');
      $('body').append("<form method='post' id='hidden_form' hidden action='<?php echo base_url(); ?>antrian_dirput/upaya_hukum_list'><input name='idRow' value='"+id+"'></form>")
      $('#hidden_form').submit();
      return false;
    });

    $('[data-toggle="run_queue"]').tooltip();   
    $('[data-toggle="run_send"]').tooltip();   

 });


</script>
