<!-- Page Heading -->

          <div class="d-sm-flex align-items-center justify-content-between mb-4">

            <h1 class="h3 mb-0 text-gray-800">FILE PKA</h1>

            <!-- <a href="#" class="d-none d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Generate Report</a> -->
            <a href="javascript:void(0)" class="d-none d-sm-inline-block btn btn-sm btn-danger shadow-sm" onclick="getcontens('page/sampah_file_pka');"><i class="fas fa-trash-alt fa-sm text-white-50"></i>  Lihat Sampah</a>
          </div>



          <!-- Content Row -->

          <div class="row" id="file">



          </div>



<script type="text/javascript">

  $(document).ready(function(){

    var base_url = "<?=base_url()?>";

    var file = function(){

      $.ajax({

                url             : base_url + 'Save_pka/select_data_save', 

                type            : "POST",

                dataType        : 'json',

                mimeType        : 'multipart/form-data',

                // data            : form_data,

                contentType     : false,

                cache           : false,

                processData     : false,

                success         : function(result){

                  // alert(JSON.stringify(result))

                  for ( var i=0 ; i<result.length ; i++ ) {

                    var no = i+1;

                    $("#file").append(`

                      <div class="col-xl-3 col-md-6 mb-4">

                        <a href='javascript:void(0)' onclick="getcontens('page/file_read','`+result[i].ks+`','`+result[i].nama_save+`');">

                        <div class="card shadow h-100 py-2" style="border-left: 5px solid #`+randomColor()+`">

                          <div class="card-body">

                            <div class="row no-gutters align-items-center">

                              <div class="col mr-2">

                                <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">`+result[i].nama_save+`</div>

                                <div class="h5 mb-0 font-weight-bold text-gray-800">`+result[i].jumlah+` Page </div>

                              </div>

                              <div class="col-auto">

                                <i class="fas fa-file-alt fa-2x text-gray-300"></i>

                              </div>

                            </div>

                          </div>

                        </div>

                        </a>

                      </div>

                    `)

                  }

                },

                error: function(jqXHR, textStatus, errorThrown) {

                  swal.close();

                    Command: toastr["error"](errorThrown, "Error");

                }

          });

    }

    file();

  });

</script>