Files
verifikator/resources/views/verifikasi/sk/perlu-perbaikan/index.blade.php
T

189 lines
6.7 KiB
PHP

@extends('layouts.main')
@section('css')
<style>
#perlu-perbaikan tbody tr {
cursor: pointer;
}
#perlu-perbaikan tbody tr > * {
transition: background-color 0.25s ease;
}
#perlu-perbaikan tbody tr:hover > * {
background-color: rgba(13, 110, 253, 0.08) !important;
}
#perlu-perbaikan tbody tr:active > * {
background-color: rgba(13, 110, 253, 0.22) !important;
transition: background-color 0s;
}
#perlu-perbaikan td, #perlu-perbaikan th {
border-color: #ced4da !important;
}
#perlu-perbaikan thead th {
background: #2563eb !important; background-color: #2563eb !important;
color: #fff !important;
border-color: #2563eb !important;
white-space: nowrap;
}
#perlu-perbaikan tbody .btn-primary {
transition: transform 0.1s ease, box-shadow 0.1s ease;
}
#perlu-perbaikan tbody .btn-primary:active {
transform: scale(0.88);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
</style>
@endsection
@section('breadcrumb')
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript:void(0);">Verifikasi</a></li>
<li class="breadcrumb-item"><a href="javascript:void(0);">SK</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
</ol>
@endsection
@section('content')
@if ($periode && !$periode->canVerifySk() && !auth()->user()->hasRole('Superuser'))
<div class="row">
<div class="col-12">
<div class="alert alert-warning" role="alert">
<i class="fas fa-exclamation-triangle me-2"></i>
<strong>Perhatian!</strong> {{ $periode->getSkVerificationErrorMessage() ?? 'Periode verifikasi SK tidak aktif.' }}
</div>
</div>
</div>
@endif
@include('verifikasi.sk._filter_unit_kerja')
<div class="card border">
<div class="card-body">
@include('components.datatable-header', [
'title' => 'Daftar SK Perlu Perbaikan',
'description' => 'Berikut adalah daftar Surat Keputusan (SK) yang perlu diperbaiki'
])
<div class="table-responsive">
<table class="table table-bordered w-100" id="perlu-perbaikan">
<thead>
<tr>
<th>SK</th>
<th>Nomor SK</th>
<th>Tentang</th>
<th>Tanggal</th>
<th>Status</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
@endsection
@section('js')
<script>
$('.si-sk').addClass('menuitem-active');
$('.ni-sk').addClass('badge-primary-lighten');
$('.li-sk').addClass('show');
$('.li-sk-perlu-perbaikan').addClass('active badge-primary-lighten');
var table = $('#perlu-perbaikan').DataTable({
processing: true,
serverSide: true,
ajax: {
url: "{{ route('sk.perlu-perbaikan.data') }}",
data: function (d) {
d.unit_id = $('#unit_kerja_filter').val();
}
},
columns: [
{
data: 'pdf',
name: 'pdf',
className: 'text-center',
orderable: false,
searchable: false
},
{
data: 'no_sk',
name: 'no_sk',
className: 'text-center'
},
{
data: 'tentang',
name: 'tentang'
},
{
data: 'tanggal_sk',
name: 'tanggal_sk',
className: 'text-center',
width: '100px'
},
{
data: 'status_verifikator',
name: 'status_verifikator',
className: 'text-center'
},
],
createdRow: function(row, data) {
var title = data.no_anggota
? '⚠️ SK ini tidak memiliki anggota — harap tambahkan anggota terlebih dahulu'
: 'Klik untuk verifikasi';
$(row).attr('data-url', data.url_detail)
.attr('data-no-anggota', data.no_anggota ? '1' : '0')
.attr('data-bs-toggle', 'tooltip')
.attr('data-bs-placement', 'top')
.attr('title', title);
},
drawCallback: function() {
document.querySelectorAll('body > .tooltip').forEach(function(el) { el.remove(); });
document.querySelectorAll('#perlu-perbaikan tbody [data-bs-toggle="tooltip"]').forEach(function(el) {
var existing = bootstrap.Tooltip.getInstance(el);
if (existing) { existing.dispose(); }
new bootstrap.Tooltip(el, { trigger: 'hover', container: 'body' });
});
},
order: [[2, 'asc']],
language: {
processing: "<div class='spinner'></div>&nbsp; Sedang Memuat...",
}
});
@include('verifikasi.sk._filter_unit_kerja_js')
$('#perlu-perbaikan').on('click', 'tbody tr', function(e) {
if ($(e.target).closest('a, button').length) { return; }
var url = $(this).data('url');
if (!url) { return; }
var unitId = $('#unit_kerja_filter').val();
if ($('#unit_kerja_filter').length > 0 && !unitId) {
showWarning('Peringatan!', 'Pilih Unit Kerja terlebih dahulu sebelum melakukan verifikasi.');
return;
}
if (unitId) { url += '?unit_id=' + unitId; }
var noAnggota = $(this).data('no-anggota') == '1';
if (noAnggota) {
var tooltipInstance = bootstrap.Tooltip.getInstance(this);
if (tooltipInstance) { tooltipInstance.dispose(); }
showWarning('Perhatian', 'SK ini tidak memiliki anggota.');
return;
}
var tooltipInstance = bootstrap.Tooltip.getInstance(this);
if (tooltipInstance) { tooltipInstance.dispose(); }
$('body').css('cursor', 'wait');
$(this).css('cursor', 'wait');
window.location.href = url;
});
</script>
@endsection