213 lines
7.9 KiB
PHP
213 lines
7.9 KiB
PHP
@extends('layouts.master')
|
|
|
|
@section('css')
|
|
@endsection
|
|
@section('content')
|
|
<div class="">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div id="toolbar">
|
|
<a href="{{route($route.'.create')}}" id="btn-add" class="btn btn-primary">
|
|
<i class="mdi mdi-plus"></i> Tambah Data
|
|
</a>
|
|
</div>
|
|
|
|
<table class="table w-100"
|
|
data-search="true"
|
|
data-toggle="table"
|
|
data-pagination="true"
|
|
data-toolbar="#toolbar"
|
|
data-show-refresh="false"
|
|
data-url="{{route($route.'.grid')}}"
|
|
data-ajax-options='{"xhrFields": {"withCredentials": true}}'
|
|
data-sort-name="ids"
|
|
data-sort-order="desc"
|
|
data-page-size="10"
|
|
data-id-field="id"
|
|
id="grid-data">
|
|
<thead class="table-secondary text-primary">
|
|
<tr>
|
|
<th data-width="15%" class="text-center" data-field="action">#</th>
|
|
<th data-field="agency">Instansi</th>
|
|
{{-- <th data-field="type">Jenis Pengesahan</th> --}}
|
|
{{-- <th data-field="data">Kegiatan/Sektor</th> --}}
|
|
<th data-field="file">File</th>
|
|
<th data-field="status">Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal fade" id="UploadModal" tabindex="-1" role="dialog" aria-labelledby="userActivityModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="userActivityModalLabel">Upload Dokumen Pengesahan</h5>
|
|
</div>
|
|
<form action="{{ route($route.'.upload') }}" method="POST" enctype="multipart/form-data">
|
|
{{ csrf_field() }}
|
|
<input type="hidden" name="secure_id" id="secure_id">
|
|
<div class="modal-body">
|
|
<div class="col-12 mb-3">
|
|
<div class="form-group">
|
|
<label class="col-xl-12 form-label">File Dokumen</label>
|
|
<div class="col-12 ">
|
|
<input type="file" name="file" accept=".pdf" class="form-control">
|
|
@error('file')
|
|
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
|
|
@enderror
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="submit" id="btnDownload" class="btn btn-primary submit d-flex justify-content-center align-items-center"><i class="bx bx-upload icon nav-icon"></i> Upload Dokumen</button>
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
@section('js')
|
|
<script type="text/javascript">
|
|
$("#grid-data").on("click", ".upload", function() {
|
|
$('#UploadModal').modal('show');
|
|
$('#secure_id').val($(this).attr('data-secure'));
|
|
});
|
|
|
|
$("#grid-data").on("click", ".remove_data", function() {
|
|
var base_url = $(this).attr('data-href');
|
|
var id = $(this).attr('data-id');
|
|
Swal.fire({
|
|
title: "Hapus Data!",
|
|
text: "Apa anda yakin ingin menghapus data ini ?",
|
|
icon: "warning",
|
|
showCancelButton: true,
|
|
confirmButtonColor: "#DD6B55",
|
|
confirmButtonText: "Ya Hapus Sekarang",
|
|
cancelButtonText: "Tidak"
|
|
}).then((result) => {
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
request = $.ajax({
|
|
url: base_url,
|
|
xhrFields: {
|
|
withCredentials: true
|
|
},
|
|
type: "GET",
|
|
});
|
|
|
|
// Callback handler that will be called on success
|
|
request.done(function(response, textStatus, jqXHR){
|
|
console.log(response);
|
|
alertify.success("Berhasil Menhapus Data");
|
|
$('#grid-data').bootstrapTable('refresh');
|
|
});
|
|
|
|
// Callback handler that will be called on failure
|
|
request.fail(function (jqXHR, textStatus, errorThrown){
|
|
alertify.error("Gagal " + textStatus, errorThrown);
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
});
|
|
|
|
$("#grid-data").on("click", ".verifikasi", function() {
|
|
var base_url = $(this).attr('data-href');
|
|
var id = $(this).attr('data-id');
|
|
Swal.fire({
|
|
title: "Verifikasi!",
|
|
text: "Apa anda yakin ingin verifikasi data ini ?",
|
|
icon: "warning",
|
|
showCancelButton: true,
|
|
confirmButtonColor: "#406AAF",
|
|
confirmButtonText: "Ya Verifikasi Sekarang",
|
|
cancelButtonText: "Tidak"
|
|
}).then((result) => {
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
request = $.ajax({
|
|
url: base_url,
|
|
xhrFields: {
|
|
withCredentials: true
|
|
},
|
|
type: "GET",
|
|
});
|
|
|
|
// Callback handler that will be called on success
|
|
request.done(function(response, textStatus, jqXHR){
|
|
console.log(response);
|
|
alertify.success("Berhasil Verifikasi Data");
|
|
$('#grid-data').bootstrapTable('refresh');
|
|
});
|
|
|
|
// Callback handler that will be called on failure
|
|
request.fail(function (jqXHR, textStatus, errorThrown){
|
|
alertify.error("Gagal " + textStatus, errorThrown);
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
});
|
|
|
|
$("#grid-data").on("click", ".tolak-verifikasi", function() {
|
|
var base_url = $(this).attr('data-href');
|
|
var id = $(this).attr('data-id');
|
|
Swal.fire({
|
|
title: "Tolak Verifikasi!",
|
|
text: "Apa anda yakin ingin tolak verifikasi data ini ?",
|
|
icon: "warning",
|
|
showCancelButton: true,
|
|
confirmButtonColor: "#FFC85C",
|
|
confirmButtonText: "Ya Tolak Sekarang",
|
|
cancelButtonText: "Tidak"
|
|
}).then((result) => {
|
|
|
|
if (result.isConfirmed) {
|
|
|
|
request = $.ajax({
|
|
url: base_url,
|
|
xhrFields: {
|
|
withCredentials: true
|
|
},
|
|
type: "GET",
|
|
});
|
|
|
|
// Callback handler that will be called on success
|
|
request.done(function(response, textStatus, jqXHR){
|
|
console.log(response);
|
|
alertify.success("Berhasil Tolak Verifikasi Data");
|
|
$('#grid-data').bootstrapTable('refresh');
|
|
});
|
|
|
|
// Callback handler that will be called on failure
|
|
request.fail(function (jqXHR, textStatus, errorThrown){
|
|
alertify.error("Gagal " + textStatus, errorThrown);
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
});
|
|
</script>
|
|
@endsection |