first commit
This commit is contained in:
@@ -0,0 +1,278 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@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);">Laporan Kegiatan</a></li>
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">Pengajuan</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="card border text-center">
|
||||
<div class="card-header bg-primary text-white py-0">
|
||||
<h5>Total Biaya</h5>
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
<h2 id="totalBiaya">...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="card border text-center">
|
||||
<div class="card-header bg-success text-white py-0">
|
||||
<h5>Total Poin</h5>
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
<h2 id="totalPoin">...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border">
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
<a href="#anggotaSk" data-bs-toggle="tab" aria-expanded="true" class="nav-link rounded-0 active">
|
||||
<i class="mdi mdi-home-variant d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Anggota SK</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#p2PerOrang" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="mdi mdi-account-circle d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">P2 Per Orang</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#p2PerBulan" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="mdi mdi-settings-outline d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">P2 Per Bulan</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="anggotaSk">
|
||||
<table class="table table-bordered table-striped w-100" id="rekap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">No</th>
|
||||
<th>NIP</th>
|
||||
<th>Nama</th>
|
||||
<th>Poin</th>
|
||||
<th>Biaya</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="p2PerOrang">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 mb-2 mb-sm-0 px-0">
|
||||
<div class="border h-100" style="max-height: 700px;">
|
||||
<div class="px-2 py-1 bg-light border-bottom">
|
||||
<h5 class="mb-0 text-center" style="padding-bottom: 7px">Daftar Pegawai</h5>
|
||||
</div>
|
||||
<div style="height: calc(700px - 50px); overflow-y: auto; overflow-x: hidden;">
|
||||
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist"
|
||||
aria-orientation="vertical">
|
||||
@foreach ($kegiatan->syarats ?? [] as $syarat)
|
||||
<a @class(['nav-link text-start', 'active show' => $loop->first]) id="{{ $syarat->id_pelaksana }}-tab"
|
||||
data-bs-toggle="pill" href="#nav-{{ $syarat->id_pelaksana }}"
|
||||
role="tab" aria-controls="nav-{{ $syarat->id_pelaksana }}"
|
||||
aria-selected="{{ $loop->first ? 'true' : 'false' }}"
|
||||
style="display: block; word-wrap: break-word; white-space: normal;">
|
||||
<i class="mdi mdi-account d-inline-block me-1"></i>
|
||||
<span title="{{ $syarat?->pegawai?->nama }}">
|
||||
{{ $syarat?->pegawai?->nama }}
|
||||
</span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-9 px-0">
|
||||
<div class="border h-100">
|
||||
<div class="tab-content p-3" id="v-pills-tabContent">
|
||||
@foreach ($kegiatan->syarats ?? [] as $syarat)
|
||||
<div @class(['tab-pane fade', 'show active' => $loop->first]) id="nav-{{ $syarat->id_pelaksana }}"
|
||||
role="tabpanel" aria-labelledby="{{ $syarat->id_pelaksana }}-tab">
|
||||
<h5 class="mb-3 text-primary border-bottom pb-2">
|
||||
<i
|
||||
class="mdi mdi-account-circle me-2"></i>{{ $syarat?->pegawai?->nama }}
|
||||
</h5>
|
||||
<div class="accordion custom-accordion"
|
||||
id="accordion-{{ $syarat->id_pelaksana }}">
|
||||
@foreach ($p2[$syarat->id_pelaksana]['p2'] as $key => $detail)
|
||||
<div class="card mb-2">
|
||||
<div class="card-header"
|
||||
id="heading-month-{{ $syarat->id_pelaksana }}-{{ $key }}">
|
||||
<h5 class="m-0">
|
||||
<a class="custom-accordion-title d-block py-1"
|
||||
data-bs-toggle="collapse"
|
||||
href="#collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
aria-expanded="{{ $loop->first ? 'true' : 'false' }}"
|
||||
aria-controls="collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}">
|
||||
<span class="fw-bold">{{ $months[$key] }}
|
||||
{{ date('Y') }}</span>
|
||||
<span><i class="uil-arrow-right"></i></span>
|
||||
<span>{{ $detail['jumlah']['steps'][count($detail['jumlah']['steps']) - 1] }}</span>
|
||||
<i class="mdi mdi-chevron-down accordion-arrow"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
class="collapse @if ($loop->first) show @endif"
|
||||
aria-labelledby="heading-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
data-bs-parent="#accordion-{{ $syarat->id_pelaksana }}">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 border">
|
||||
<h5>Pemotongan Poin</h5>
|
||||
<ul>
|
||||
@foreach ($detail['poin']['steps'] as $step)
|
||||
<li @class(['text-primary fw-bold' => $loop->last])>
|
||||
{{ $step }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-9 border">
|
||||
<h5>Jumlah</h5>
|
||||
<ul>
|
||||
@foreach ($detail['jumlah']['steps'] as $step)
|
||||
<li @class(['text-primary fw-bold' => $loop->last])>
|
||||
{{ $step }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="p2PerBulan">
|
||||
<p>...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<!-- Sidebar Aktif -->
|
||||
<script>
|
||||
$('.si-laporan-kegiatan').addClass('menuitem-active');
|
||||
$('.ni-laporan-kegiatan').addClass('badge-primary-lighten');
|
||||
$('.li-laporan-kegiatan').addClass('show');
|
||||
$('.li-laporan-kegiatan-kompetisi').addClass('active badge-primary-lighten');
|
||||
</script>
|
||||
|
||||
<!-- Datatables -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var kegiatanId = {{ $kegiatan['id'] }};
|
||||
|
||||
if (dataTablez) {
|
||||
dataTablez.destroy();
|
||||
$('#totalBiaya').text('...');
|
||||
$('#totalPoin').text('...');
|
||||
}
|
||||
|
||||
var dataTablez = $('#rekap').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.kompetisi.data-biaya', ':id') }}".replace(':id',
|
||||
kegiatanId),
|
||||
dataSrc: function(json) {
|
||||
$('#totalBiaya').text('Rp. ' + json.total_biaya || 0);
|
||||
$('#totalPoin').text(json.total_poin || 0);
|
||||
|
||||
return json.data;
|
||||
},
|
||||
error: function(xhr, error, thrown) {
|
||||
console.error('DataTable Error:', error);
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: "id_pelaksana",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'nama',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
data: 'poin',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'biaya',
|
||||
name: 'biaya',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
}
|
||||
],
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
// Inisialisasi: sembunyikan semua chevron kecuali yang aktif
|
||||
$('.accordion .collapse').each(function() {
|
||||
var chevron = $(this).prev('.card-header').find('.accordion-arrow');
|
||||
|
||||
if ($(this).hasClass('show')) {
|
||||
chevron.show();
|
||||
} else {
|
||||
chevron.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Event listener untuk show/hide chevron saat accordion dibuka/ditutup
|
||||
$('.accordion .collapse').on('show.bs.collapse', function() {
|
||||
$(this).prev('.card-header').find('.accordion-arrow').show();
|
||||
});
|
||||
|
||||
$('.accordion .collapse').on('hide.bs.collapse', function() {
|
||||
$(this).prev('.card-header').find('.accordion-arrow').hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,562 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('css')
|
||||
<style>
|
||||
.tooltip-wide .tooltip-inner {
|
||||
max-width: 420px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* Context Menu */
|
||||
@keyframes rowMenuFadeIn {
|
||||
from { opacity: 0; transform: scale(0.92) translateY(-6px); }
|
||||
to { opacity: 1; transform: scale(1) translateY(0); }
|
||||
}
|
||||
#rowContextMenu { display: none; }
|
||||
|
||||
#rowContextMenu.arrow-top-left { transform-origin: top left; }
|
||||
#rowContextMenu.arrow-top-left::before,
|
||||
#rowContextMenu.arrow-top-left::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-top-left::before { top: -16px; border-bottom-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-top-left::after { top: -15px; border-bottom-color: #fff; }
|
||||
|
||||
#rowContextMenu.arrow-top-right { transform-origin: top right; }
|
||||
#rowContextMenu.arrow-top-right::before,
|
||||
#rowContextMenu.arrow-top-right::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-top-right::before { top: -16px; border-bottom-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-top-right::after { top: -15px; border-bottom-color: #fff; }
|
||||
|
||||
#rowContextMenu.arrow-bottom-left { transform-origin: bottom left; }
|
||||
#rowContextMenu.arrow-bottom-left::before,
|
||||
#rowContextMenu.arrow-bottom-left::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-bottom-left::before { bottom: -16px; border-top-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-bottom-left::after { bottom: -15px; border-top-color: #fff; }
|
||||
|
||||
#rowContextMenu.arrow-bottom-right { transform-origin: bottom right; }
|
||||
#rowContextMenu.arrow-bottom-right::before,
|
||||
#rowContextMenu.arrow-bottom-right::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-bottom-right::before { bottom: -16px; border-top-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-bottom-right::after { bottom: -15px; border-top-color: #fff; }
|
||||
|
||||
.row-context-item:hover {
|
||||
background-color: #eef2ff !important;
|
||||
color: #3b5bdb !important;
|
||||
}
|
||||
.row-context-item:hover i { color: #3b5bdb; }
|
||||
</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);">Laporan Kegiatan</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if ($periode && !$periode->canVerifyLaporanKegiatan() && Auth::user()->id != 1)
|
||||
<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->getVerificationErrorMessage() ?? 'Periode verifikasi laporan kegiatan tidak aktif.' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card border">
|
||||
<div class="card-body">
|
||||
@include('components.datatable-header', [
|
||||
'title' => 'Daftar Laporan Kegiatan Kompetisi',
|
||||
'description' => 'Berikut adalah daftar laporan kegiatan kompetisi yang telah diajukan'
|
||||
])
|
||||
|
||||
@if (count($unitKerjas) > 0)
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-6">
|
||||
<div class="mb-2">
|
||||
<label for="unitKerjaFilter" class="form-label">Unit Kerja</label>
|
||||
<select class="form-select select2" id="unitKerjaFilter" name="unitKerjaFilter"
|
||||
data-placeholder="Pilih Unit Kerja...">
|
||||
<option value=""></option>
|
||||
@foreach ($unitKerjas as $unit)
|
||||
<option value="{{ $unit->id }}" {{ request('unit_id') == $unit->id ? 'selected' : '' }}>{{ $unit->nama }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3" id="category-tabs">
|
||||
<li class="nav-item">
|
||||
<a href="#belum-diverifikasi" data-bs-toggle="tab" aria-expanded="true"
|
||||
class="nav-link rounded-0 active">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Belum Diverifikasi</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#diterima" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Diterima</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#ditolak" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Ditolak</span>
|
||||
</a>
|
||||
</li>
|
||||
{{-- <li class="nav-item">
|
||||
<a href="#kegiatan-duplikat" data-bs-toggle="tab" aria-expanded="false"
|
||||
class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Kegiatan Duplikat</span>
|
||||
</a>
|
||||
</li> --}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="belum-diverifikasi">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="belum-diverifikasi-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="diterima">
|
||||
<div class="d-flex justify-content-end mb-2">
|
||||
<button type="button" class="btn btn-success btn-sm" id="btn-export-diterima">
|
||||
<i class="bx bx-download"></i> Export Excel
|
||||
</button>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="diterima-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="ditolak">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="ditolak-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="kegiatan-duplikat">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="kegiatan-duplikat-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Jumlah Kegiatan</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Context Menu Row -->
|
||||
<ul id="rowContextMenu" style="position:absolute;z-index:999;background:#fff;border:1px solid #dee2e6;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.12);padding:4px 0;min-width:160px;list-style:none;margin:0">
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="row-context-item row-detail-btn d-flex align-items-center gap-2 px-3 py-2 text-decoration-none" style="font-size:14px;color:#212529;border-radius:6px;margin:2px 4px;transition:background .15s ease,color .15s ease">
|
||||
<i class="uil-info-circle" style="font-size:16px"></i> Detail
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="row-context-item row-biaya-btn d-flex align-items-center gap-2 px-3 py-2 text-decoration-none" style="font-size:14px;color:#212529;border-radius:6px;margin:2px 4px;transition:background .15s ease,color .15s ease">
|
||||
<i class="uil-bill" style="font-size:16px"></i> Biaya
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<!-- Sidebar Aktif -->
|
||||
<script>
|
||||
$('.si-laporan-kegiatan').addClass('menuitem-active');
|
||||
$('.ni-laporan-kegiatan').addClass('badge-primary-lighten');
|
||||
$('.li-laporan-kegiatan').addClass('show');
|
||||
$('.li-laporan-kegiatan-kompetisi').addClass('active badge-primary-lighten');
|
||||
</script>
|
||||
|
||||
<!-- Datatable & Row Click -->
|
||||
<script>
|
||||
var detailBaseUrl = "{{ url('/laporan-kegiatan/kompetisi/detail') }}";
|
||||
var biayaBaseUrl = "{{ url('/laporan-kegiatan/kompetisi/biaya') }}";
|
||||
var currentRowId = null;
|
||||
|
||||
function navigateToDetail(id, url) {
|
||||
@if (Auth::user()->id == 1)
|
||||
var unitId = $('#unitKerjaFilter').val();
|
||||
if (!unitId) {
|
||||
showWarning('Peringatan!', 'Pilih Unit Kerja terlebih dahulu sebelum melihat detail.');
|
||||
return;
|
||||
}
|
||||
window.location.href = url + '?unit_id=' + unitId;
|
||||
@else
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.href = url;
|
||||
} else {
|
||||
showWarning('Peringatan', response.message || 'Periode verifikasi tidak aktif');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
var message = 'Periode verifikasi tidak aktif';
|
||||
if (xhr.responseJSON && xhr.responseJSON.message) {
|
||||
message = xhr.responseJSON.message;
|
||||
}
|
||||
showError('Error', message);
|
||||
}
|
||||
});
|
||||
@endif
|
||||
}
|
||||
|
||||
function navigateToBiaya(id, url) {
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var actionSuccess = sessionStorage.getItem('kompetisi_terima_success');
|
||||
if (actionSuccess) {
|
||||
sessionStorage.removeItem('kompetisi_terima_success');
|
||||
showSuccess('Berhasil!', actionSuccess);
|
||||
}
|
||||
|
||||
var dataTable = null;
|
||||
var duplicateDataTable = null;
|
||||
|
||||
function initDataTable(category) {
|
||||
var status = null;
|
||||
|
||||
if (dataTable) {
|
||||
$('[data-bs-toggle="tooltip"]', dataTable.table().node()).each(function() {
|
||||
var tip = bootstrap.Tooltip.getInstance(this);
|
||||
if (tip) { tip.dispose(); }
|
||||
});
|
||||
dataTable.destroy();
|
||||
}
|
||||
|
||||
if (category === 'belum-diverifikasi') {
|
||||
status = 'belum_verifikasi';
|
||||
} else if (category === 'diterima') {
|
||||
status = 'diterima';
|
||||
} else if (category === 'ditolak') {
|
||||
status = 'ditolak';
|
||||
} else {
|
||||
status = category;
|
||||
}
|
||||
|
||||
dataTable = $(`#${category}-content`).DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.kompetisi.data') }}/?status=" + status,
|
||||
data: function(d) {
|
||||
d.status = status;
|
||||
d.unit_kerja_filter = $('#unitKerjaFilter').val();
|
||||
},
|
||||
},
|
||||
columns: [{
|
||||
data: 'nama_kegiatan',
|
||||
name: 'nama_kegiatan',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
render: function(data) {
|
||||
var escaped = $('<div>').text(data).html();
|
||||
return '<div data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="' + escaped + '" data-bs-custom-class="tooltip-wide" style="display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-height:3em">' + escaped + '</div>';
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'tanggal_kegiatan',
|
||||
name: 'tanggal_kegiatan',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center',
|
||||
},
|
||||
{
|
||||
data: 'duplikat',
|
||||
name: 'duplikat',
|
||||
searchable: false,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'status',
|
||||
name: 'status',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center',
|
||||
width: '180px'
|
||||
}
|
||||
],
|
||||
order: [
|
||||
[0, 'asc']
|
||||
],
|
||||
autoWidth: false,
|
||||
createdRow: function(row, data) {
|
||||
$(row).css('cursor', 'pointer').attr('data-id', data.id);
|
||||
},
|
||||
drawCallback: function() {
|
||||
document.querySelectorAll('body > .tooltip').forEach(function(el) { el.remove(); });
|
||||
$('[data-bs-toggle="tooltip"]', this.api().table().node()).each(function() {
|
||||
var tip = bootstrap.Tooltip.getInstance(this);
|
||||
if (tip) { tip.dispose(); }
|
||||
bootstrap.Tooltip.getOrCreateInstance(this, {
|
||||
trigger: 'hover',
|
||||
container: 'body'
|
||||
});
|
||||
});
|
||||
},
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initDuplicateDataTable() {
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.destroy();
|
||||
}
|
||||
|
||||
duplicateDataTable = $('#kegiatan-duplikat-content').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.kompetisi.data-duplikat') }}",
|
||||
data: function(d) {
|
||||
d.unit_kerja_filter = $('#unitKerjaFilter').val();
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: "nama_kegiatan",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
data: 'jumlah',
|
||||
searchable: false,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'action',
|
||||
name: 'action',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center',
|
||||
visible: false
|
||||
}
|
||||
],
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#category-tabs a[data-bs-toggle="tab"]').on('shown.bs.tab', function(e) {
|
||||
var target = $(e.target).attr('href');
|
||||
var category = target.replace('#', '');
|
||||
|
||||
if (category === 'kegiatan-duplikat') {
|
||||
// Clear other datatable if exists
|
||||
if (dataTable) {
|
||||
dataTable.clear();
|
||||
}
|
||||
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.clear();
|
||||
}
|
||||
// Initialize duplicate datatable
|
||||
initDuplicateDataTable();
|
||||
} else {
|
||||
// Clear duplicate datatable if exists
|
||||
if (dataTable) {
|
||||
dataTable.clear();
|
||||
}
|
||||
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.clear();
|
||||
}
|
||||
// Initialize regular datatable
|
||||
initDataTable(category);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize default tab
|
||||
initDataTable('belum-diverifikasi');
|
||||
|
||||
$('#unitKerjaFilter').on('select2:select select2:clear change', function() {
|
||||
var activeTab = $('#category-tabs .nav-link.active').attr('href').replace('#', '');
|
||||
if (activeTab === 'kegiatan-duplikat') {
|
||||
if (duplicateDataTable) { duplicateDataTable.ajax.reload(); }
|
||||
} else {
|
||||
if (dataTable) { dataTable.ajax.reload(); }
|
||||
}
|
||||
});
|
||||
|
||||
$('#btn-export-diterima').on('click', function() {
|
||||
var button = $(this);
|
||||
var originalHtml = button.html();
|
||||
|
||||
var url = "{{ route('laporan-kegiatan.kompetisi.export-excel') }}";
|
||||
var unitKerjaFilter = $('#unitKerjaFilter').val();
|
||||
if (unitKerjaFilter) {
|
||||
url += "?unit_kerja_filter=" + encodeURIComponent(unitKerjaFilter);
|
||||
}
|
||||
|
||||
button.prop('disabled', true).html('<span class="spinner-border spinner-border-sm me-1"></span> Exporting...');
|
||||
|
||||
fetch(url)
|
||||
.then(function(response) {
|
||||
if (!response.ok) { throw new Error('gagal'); }
|
||||
var filename = 'laporan-kegiatan-kompetisi-diterima.xlsx';
|
||||
var disposition = response.headers.get('Content-Disposition');
|
||||
if (disposition) {
|
||||
var match = disposition.match(/filename[^;=\n]*=['"]?([^'"\n]+)['"]?/);
|
||||
if (match) { filename = match[1]; }
|
||||
}
|
||||
return response.blob().then(function(blob) {
|
||||
return { blob: blob, filename: filename };
|
||||
});
|
||||
})
|
||||
.then(function(data) {
|
||||
var downloadUrl = URL.createObjectURL(data.blob);
|
||||
var a = document.createElement('a');
|
||||
a.href = downloadUrl;
|
||||
a.download = data.filename;
|
||||
a.style.display = 'none';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(downloadUrl);
|
||||
button.prop('disabled', false).html(originalHtml);
|
||||
showSuccess('Berhasil!', 'File Excel berhasil didownload');
|
||||
})
|
||||
.catch(function() {
|
||||
button.prop('disabled', false).html(originalHtml);
|
||||
showError('Gagal', 'Terjadi kesalahan saat export Excel');
|
||||
});
|
||||
});
|
||||
|
||||
var $contextMenu = $('#rowContextMenu').appendTo('body');
|
||||
var MENU_W = 168;
|
||||
var MENU_H = 90;
|
||||
|
||||
function showContextMenu(e, id) {
|
||||
currentRowId = id;
|
||||
var flipH = (e.clientX + MENU_W + 8 > window.innerWidth);
|
||||
var flipV = (e.clientY + MENU_H + 8 > window.innerHeight);
|
||||
var x = flipH ? e.pageX - MENU_W : e.pageX;
|
||||
var y = flipV ? e.pageY - MENU_H : e.pageY;
|
||||
var arrowClass = 'arrow-' + (flipV ? 'bottom' : 'top') + '-' + (flipH ? 'right' : 'left');
|
||||
|
||||
$contextMenu
|
||||
.removeClass('arrow-top-left arrow-top-right arrow-bottom-left arrow-bottom-right')
|
||||
.addClass(arrowClass)
|
||||
.css({ top: y, left: x, display: 'block', animation: 'none' });
|
||||
|
||||
$contextMenu[0].offsetWidth;
|
||||
$contextMenu.css('animation', 'rowMenuFadeIn 0.2s ease forwards');
|
||||
}
|
||||
|
||||
function hideContextMenu() {
|
||||
$contextMenu.css('display', 'none');
|
||||
currentRowId = null;
|
||||
}
|
||||
|
||||
$(document).on('click', '#belum-diverifikasi-content tbody tr, #diterima-content tbody tr, #ditolak-content tbody tr', function(e) {
|
||||
e.stopPropagation();
|
||||
var id = $(this).data('id');
|
||||
if (!id) { return; }
|
||||
showContextMenu(e, id);
|
||||
});
|
||||
|
||||
$(document).on('click', '#kegiatan-duplikat-content tbody tr', function(e) {
|
||||
var id = $(this).data('id');
|
||||
if (!id) { return; }
|
||||
navigateToDetail(id, detailBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.row-detail-btn', function() {
|
||||
var id = currentRowId;
|
||||
hideContextMenu();
|
||||
if (!id) { return; }
|
||||
navigateToDetail(id, detailBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.row-biaya-btn', function() {
|
||||
var id = currentRowId;
|
||||
hideContextMenu();
|
||||
if (!id) { return; }
|
||||
navigateToBiaya(id, biayaBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
$(document).on('click', function(e) {
|
||||
if (!$(e.target).closest('#rowContextMenu').length) {
|
||||
hideContextMenu();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,288 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@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);">Laporan Kegiatan</a></li>
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">MBKM</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="card border text-center">
|
||||
<div class="card-header bg-primary text-white py-0">
|
||||
<h5>Total Biaya</h5>
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
<h2 id="totalBiaya">...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="card border text-center">
|
||||
<div class="card-header bg-success text-white py-0">
|
||||
<h5>Total Poin</h5>
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
<h2 id="totalPoin">...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border">
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
<a href="#anggotaSk" data-bs-toggle="tab" aria-expanded="true" class="nav-link rounded-0 active">
|
||||
<i class="mdi mdi-home-variant d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Anggota SK</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#p2PerOrang" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="mdi mdi-account-circle d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">P2 Per Orang</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#p2PerBulan" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="mdi mdi-settings-outline d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">P2 Per Bulan</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="anggotaSk">
|
||||
<table class="table table-bordered table-striped w-100" id="rekap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">No</th>
|
||||
<th>NIP</th>
|
||||
<th>Nama</th>
|
||||
<th>Poin</th>
|
||||
<th>Biaya</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="p2PerOrang">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 mb-2 mb-sm-0 px-0">
|
||||
<div class="border h-100" style="max-height: 700px;">
|
||||
<div class="px-2 py-1 bg-light border-bottom">
|
||||
<h5 class="mb-0 text-center" style="padding-bottom: 7px">Daftar Pegawai</h5>
|
||||
</div>
|
||||
<div style="height: calc(700px - 50px); overflow-y: auto; overflow-x: hidden;">
|
||||
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist"
|
||||
aria-orientation="vertical">
|
||||
@if(isset($kegiatan->syarats))
|
||||
@foreach ($kegiatan->syarats as $syarat)
|
||||
<a @class(['nav-link text-start', 'active show' => $loop->first]) id="{{ $syarat->id_pelaksana }}-tab"
|
||||
data-bs-toggle="pill" href="#nav-{{ $syarat->id_pelaksana }}"
|
||||
role="tab" aria-controls="nav-{{ $syarat->id_pelaksana }}"
|
||||
aria-selected="{{ $loop->first ? 'true' : 'false' }}"
|
||||
style="display: block; word-wrap: break-word; white-space: normal;">
|
||||
<i class="mdi mdi-account d-inline-block me-1"></i>
|
||||
<span title="{{ $syarat?->pegawai?->nama }}">
|
||||
{{ $syarat?->pegawai?->nama }}
|
||||
</span>
|
||||
</a>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-9 px-0">
|
||||
<div class="border h-100">
|
||||
<div class="tab-content p-3" id="v-pills-tabContent">
|
||||
@if(isset($kegiatan->syarats))
|
||||
@foreach ($kegiatan->syarats as $syarat)
|
||||
<div @class(['tab-pane fade', 'show active' => $loop->first]) id="nav-{{ $syarat->id_pelaksana }}"
|
||||
role="tabpanel" aria-labelledby="{{ $syarat->id_pelaksana }}-tab">
|
||||
<h5 class="mb-3 text-primary border-bottom pb-2">
|
||||
<i class="mdi mdi-account-circle me-2"></i>{{ $syarat?->pegawai?->nama }}
|
||||
</h5>
|
||||
<div class="accordion custom-accordion"
|
||||
id="accordion-{{ $syarat->id_pelaksana }}">
|
||||
@if(isset($p2[$syarat->id_pelaksana]['p2']))
|
||||
@foreach ($p2[$syarat->id_pelaksana]['p2'] as $key => $detail)
|
||||
<div class="card mb-2">
|
||||
<div class="card-header"
|
||||
id="heading-month-{{ $syarat->id_pelaksana }}-{{ $key }}">
|
||||
<h5 class="m-0">
|
||||
<a class="custom-accordion-title d-block py-1"
|
||||
data-bs-toggle="collapse"
|
||||
href="#collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
aria-expanded="{{ $loop->first ? 'true' : 'false' }}"
|
||||
aria-controls="collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}">
|
||||
<span class="fw-bold">{{ $months[$key] ?? 'Bulan ' . $key }}
|
||||
{{ date('Y') }}</span>
|
||||
<span><i class="uil-arrow-right"></i></span>
|
||||
<span>{{ $detail['jumlah']['steps'][count($detail['jumlah']['steps']) - 1] ?? '0' }}</span>
|
||||
<i class="mdi mdi-chevron-down accordion-arrow"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
class="collapse @if ($loop->first) show @endif"
|
||||
aria-labelledby="heading-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
data-bs-parent="#accordion-{{ $syarat->id_pelaksana }}">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 border">
|
||||
<h5>Pemotongan Poin</h5>
|
||||
<ul>
|
||||
@foreach ($detail['poin']['steps'] ?? [] as $step)
|
||||
<li @class(['text-primary fw-bold' => $loop->last])>
|
||||
{{ $step }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-9 border">
|
||||
<h5>Jumlah</h5>
|
||||
<ul>
|
||||
@foreach ($detail['jumlah']['steps'] ?? [] as $step)
|
||||
<li @class(['text-primary fw-bold' => $loop->last])>
|
||||
{{ $step }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<p class="text-muted">Tidak ada data P2 untuk pegawai ini.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<p class="text-muted">Tidak ada data pegawai.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="p2PerBulan">
|
||||
<p class="text-muted">Data P2 per bulan akan ditampilkan di sini.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<!-- Sidebar Aktif -->
|
||||
<script>
|
||||
$('.si-laporan-kegiatan').addClass('menuitem-active');
|
||||
$('.ni-laporan-kegiatan').addClass('badge-primary-lighten');
|
||||
$('.li-laporan-kegiatan').addClass('show');
|
||||
$('.li-laporan-kegiatan-mbkm').addClass('active badge-primary-lighten');
|
||||
</script>
|
||||
|
||||
<!-- Datatables -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var kegiatanId = {{ $kegiatan['id'] ?? 0 }};
|
||||
|
||||
if (typeof dataTablez !== 'undefined' && dataTablez) {
|
||||
dataTablez.destroy();
|
||||
$('#totalBiaya').text('...');
|
||||
$('#totalPoin').text('...');
|
||||
}
|
||||
|
||||
var dataTablez = $('#rekap').DataTable({
|
||||
processing: true,
|
||||
serverSide: false, // Changed to false for simplicity
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.mbkm.data-biaya', ':id') }}".replace(':id', kegiatanId),
|
||||
dataSrc: function(json) {
|
||||
$('#totalBiaya').text('Rp. ' + (json.total_biaya || 0));
|
||||
$('#totalPoin').text(json.total_poin || 0);
|
||||
|
||||
return json.data || [];
|
||||
},
|
||||
error: function(xhr, error, thrown) {
|
||||
console.error('DataTable Error:', error);
|
||||
$('#totalBiaya').text('Rp. 0');
|
||||
$('#totalPoin').text('0');
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: "id_pelaksana",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'nama',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
data: 'poin',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'biaya',
|
||||
name: 'biaya',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
}
|
||||
],
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
// Inisialisasi: sembunyikan semua chevron kecuali yang aktif
|
||||
$('.accordion .collapse').each(function() {
|
||||
var chevron = $(this).prev('.card-header').find('.accordion-arrow');
|
||||
|
||||
if ($(this).hasClass('show')) {
|
||||
chevron.show();
|
||||
} else {
|
||||
chevron.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Event listener untuk show/hide chevron saat accordion dibuka/ditutup
|
||||
$('.accordion .collapse').on('show.bs.collapse', function() {
|
||||
$(this).prev('.card-header').find('.accordion-arrow').show();
|
||||
});
|
||||
|
||||
$('.accordion .collapse').on('hide.bs.collapse', function() {
|
||||
$(this).prev('.card-header').find('.accordion-arrow').hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,561 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('css')
|
||||
<style>
|
||||
.tooltip-wide .tooltip-inner {
|
||||
max-width: 420px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@keyframes rowMenuFadeIn {
|
||||
from { opacity: 0; transform: scale(0.92) translateY(-6px); }
|
||||
to { opacity: 1; transform: scale(1) translateY(0); }
|
||||
}
|
||||
#rowContextMenu { display: none; }
|
||||
|
||||
#rowContextMenu.arrow-top-left { transform-origin: top left; }
|
||||
#rowContextMenu.arrow-top-left::before,
|
||||
#rowContextMenu.arrow-top-left::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-top-left::before { top: -16px; border-bottom-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-top-left::after { top: -15px; border-bottom-color: #fff; }
|
||||
|
||||
#rowContextMenu.arrow-top-right { transform-origin: top right; }
|
||||
#rowContextMenu.arrow-top-right::before,
|
||||
#rowContextMenu.arrow-top-right::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-top-right::before { top: -16px; border-bottom-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-top-right::after { top: -15px; border-bottom-color: #fff; }
|
||||
|
||||
#rowContextMenu.arrow-bottom-left { transform-origin: bottom left; }
|
||||
#rowContextMenu.arrow-bottom-left::before,
|
||||
#rowContextMenu.arrow-bottom-left::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-bottom-left::before { bottom: -16px; border-top-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-bottom-left::after { bottom: -15px; border-top-color: #fff; }
|
||||
|
||||
#rowContextMenu.arrow-bottom-right { transform-origin: bottom right; }
|
||||
#rowContextMenu.arrow-bottom-right::before,
|
||||
#rowContextMenu.arrow-bottom-right::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-bottom-right::before { bottom: -16px; border-top-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-bottom-right::after { bottom: -15px; border-top-color: #fff; }
|
||||
|
||||
.row-context-item:hover {
|
||||
background-color: #eef2ff !important;
|
||||
color: #3b5bdb !important;
|
||||
}
|
||||
.row-context-item:hover i { color: #3b5bdb; }
|
||||
</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);">Laporan Kegiatan</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if ($periode && !$periode->canVerifyLaporanKegiatan() && Auth::user()->id != 1)
|
||||
<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->getVerificationErrorMessage() ?? 'Periode verifikasi laporan kegiatan tidak aktif.' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card border">
|
||||
<div class="card-body">
|
||||
@include('components.datatable-header', [
|
||||
'title' => 'Daftar Laporan Kegiatan MBKM',
|
||||
'description' => 'Berikut adalah daftar laporan kegiatan MBKM yang telah diajukan'
|
||||
])
|
||||
|
||||
@if (count($unitKerjas) > 0)
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-6">
|
||||
<div class="mb-2">
|
||||
<label for="unitKerjaFilter" class="form-label">Unit Kerja</label>
|
||||
<select class="form-select select2" id="unitKerjaFilter" name="unitKerjaFilter"
|
||||
data-placeholder="Pilih Unit Kerja...">
|
||||
<option value=""></option>
|
||||
@foreach ($unitKerjas as $unit)
|
||||
<option value="{{ $unit->id }}" {{ request('unit_id') == $unit->id ? 'selected' : '' }}>{{ $unit->nama }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3" id="category-tabs">
|
||||
<li class="nav-item">
|
||||
<a href="#belum-diverifikasi" data-bs-toggle="tab" aria-expanded="true"
|
||||
class="nav-link rounded-0 active">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Belum Diverifikasi</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#diterima" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Diterima</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#ditolak" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Ditolak</span>
|
||||
</a>
|
||||
</li>
|
||||
{{-- <li class="nav-item">
|
||||
<a href="#kegiatan-duplikat" data-bs-toggle="tab" aria-expanded="false"
|
||||
class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Kegiatan Duplikat</span>
|
||||
</a>
|
||||
</li> --}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="belum-diverifikasi">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="belum-diverifikasi-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="diterima">
|
||||
<div class="d-flex justify-content-end mb-2">
|
||||
<button type="button" class="btn btn-success btn-sm" id="btn-export-diterima">
|
||||
<i class="bx bx-download"></i> Export Excel
|
||||
</button>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="diterima-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="ditolak">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="ditolak-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="kegiatan-duplikat">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="kegiatan-duplikat-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Jumlah Kegiatan</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Context Menu Row -->
|
||||
<ul id="rowContextMenu" style="position:absolute;z-index:999;background:#fff;border:1px solid #dee2e6;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.12);padding:4px 0;min-width:160px;list-style:none;margin:0">
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="row-context-item row-detail-btn d-flex align-items-center gap-2 px-3 py-2 text-decoration-none" style="font-size:14px;color:#212529;border-radius:6px;margin:2px 4px;transition:background .15s ease,color .15s ease">
|
||||
<i class="uil-info-circle" style="font-size:16px"></i> Detail
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="row-context-item row-biaya-btn d-flex align-items-center gap-2 px-3 py-2 text-decoration-none" style="font-size:14px;color:#212529;border-radius:6px;margin:2px 4px;transition:background .15s ease,color .15s ease">
|
||||
<i class="uil-bill" style="font-size:16px"></i> Biaya
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<!-- Sidebar Aktif -->
|
||||
<script>
|
||||
$('.si-laporan-kegiatan').addClass('menuitem-active');
|
||||
$('.ni-laporan-kegiatan').addClass('badge-primary-lighten');
|
||||
$('.li-laporan-kegiatan').addClass('show');
|
||||
$('.li-laporan-kegiatan-mbkm').addClass('active badge-primary-lighten');
|
||||
</script>
|
||||
|
||||
<!-- Datatable & Row Click -->
|
||||
<script>
|
||||
var detailBaseUrl = "{{ url('/laporan-kegiatan/mbkm/detail') }}";
|
||||
var biayaBaseUrl = "{{ url('/laporan-kegiatan/mbkm/biaya') }}";
|
||||
var currentRowId = null;
|
||||
|
||||
function navigateToDetail(id, url) {
|
||||
@if (Auth::user()->id == 1)
|
||||
var unitId = $('#unitKerjaFilter').val();
|
||||
if (!unitId) {
|
||||
showWarning('Peringatan!', 'Pilih Unit Kerja terlebih dahulu sebelum melihat detail.');
|
||||
return;
|
||||
}
|
||||
window.location.href = url + '?unit_id=' + unitId;
|
||||
@else
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.href = url;
|
||||
} else {
|
||||
showWarning('Peringatan', response.message || 'Periode verifikasi tidak aktif');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
var message = 'Periode verifikasi tidak aktif';
|
||||
if (xhr.responseJSON && xhr.responseJSON.message) {
|
||||
message = xhr.responseJSON.message;
|
||||
}
|
||||
showError('Error', message);
|
||||
}
|
||||
});
|
||||
@endif
|
||||
}
|
||||
|
||||
function navigateToBiaya(id, url) {
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var actionSuccess = sessionStorage.getItem('mbkm_terima_success');
|
||||
if (actionSuccess) {
|
||||
sessionStorage.removeItem('mbkm_terima_success');
|
||||
showSuccess('Berhasil!', actionSuccess);
|
||||
}
|
||||
|
||||
var dataTable = null;
|
||||
var duplicateDataTable = null;
|
||||
|
||||
function initDataTable(category) {
|
||||
var status = null;
|
||||
|
||||
if (dataTable) {
|
||||
$('[data-bs-toggle="tooltip"]', dataTable.table().node()).each(function() {
|
||||
var tip = bootstrap.Tooltip.getInstance(this);
|
||||
if (tip) { tip.dispose(); }
|
||||
});
|
||||
dataTable.destroy();
|
||||
}
|
||||
|
||||
if (category === 'belum-diverifikasi') {
|
||||
status = 'belum_verifikasi';
|
||||
} else if (category === 'diterima') {
|
||||
status = 'diterima';
|
||||
} else if (category === 'ditolak') {
|
||||
status = 'ditolak';
|
||||
} else {
|
||||
status = category;
|
||||
}
|
||||
|
||||
dataTable = $(`#${category}-content`).DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.mbkm.data') }}/?status=" + status,
|
||||
data: function(d) {
|
||||
d.status = status;
|
||||
d.unit_kerja_filter = $('#unitKerjaFilter').val();
|
||||
},
|
||||
},
|
||||
columns: [{
|
||||
data: 'nama_kegiatan',
|
||||
name: 'nama_kegiatan',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
render: function(data) {
|
||||
var escaped = $('<div>').text(data).html();
|
||||
return '<div data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="' + escaped + '" data-bs-custom-class="tooltip-wide" style="display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-height:3em">' + escaped + '</div>';
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'tanggal_kegiatan',
|
||||
name: 'tanggal_kegiatan',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center',
|
||||
},
|
||||
{
|
||||
data: 'duplikat',
|
||||
name: 'duplikat',
|
||||
searchable: false,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'status',
|
||||
name: 'status',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center',
|
||||
width: '180px'
|
||||
}
|
||||
],
|
||||
order: [
|
||||
[0, 'asc']
|
||||
],
|
||||
autoWidth: false,
|
||||
createdRow: function(row, data) {
|
||||
$(row).css('cursor', 'pointer').attr('data-id', data.id);
|
||||
},
|
||||
drawCallback: function() {
|
||||
document.querySelectorAll('body > .tooltip').forEach(function(el) { el.remove(); });
|
||||
$('[data-bs-toggle="tooltip"]', this.api().table().node()).each(function() {
|
||||
var tip = bootstrap.Tooltip.getInstance(this);
|
||||
if (tip) { tip.dispose(); }
|
||||
bootstrap.Tooltip.getOrCreateInstance(this, {
|
||||
trigger: 'hover',
|
||||
container: 'body'
|
||||
});
|
||||
});
|
||||
},
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initDuplicateDataTable() {
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.destroy();
|
||||
}
|
||||
|
||||
duplicateDataTable = $('#kegiatan-duplikat-content').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.mbkm.data-duplikat') }}",
|
||||
data: function(d) {
|
||||
d.unit_kerja_filter = $('#unitKerjaFilter').val();
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: "nama_kegiatan",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
data: 'jumlah',
|
||||
searchable: false,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'action',
|
||||
name: 'action',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center',
|
||||
visible: false
|
||||
}
|
||||
],
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#category-tabs a[data-bs-toggle="tab"]').on('shown.bs.tab', function(e) {
|
||||
var target = $(e.target).attr('href');
|
||||
var category = target.replace('#', '');
|
||||
|
||||
if (category === 'kegiatan-duplikat') {
|
||||
// Clear other datatable if exists
|
||||
if (dataTable) {
|
||||
dataTable.clear();
|
||||
}
|
||||
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.clear();
|
||||
}
|
||||
// Initialize duplicate datatable
|
||||
initDuplicateDataTable();
|
||||
} else {
|
||||
// Clear duplicate datatable if exists
|
||||
if (dataTable) {
|
||||
dataTable.clear();
|
||||
}
|
||||
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.clear();
|
||||
}
|
||||
// Initialize regular datatable
|
||||
initDataTable(category);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize default tab
|
||||
initDataTable('belum-diverifikasi');
|
||||
|
||||
$('#unitKerjaFilter').on('select2:select select2:clear change', function() {
|
||||
var activeTab = $('#category-tabs .nav-link.active').attr('href').replace('#', '');
|
||||
if (activeTab === 'kegiatan-duplikat') {
|
||||
if (duplicateDataTable) { duplicateDataTable.ajax.reload(); }
|
||||
} else {
|
||||
if (dataTable) { dataTable.ajax.reload(); }
|
||||
}
|
||||
});
|
||||
|
||||
$('#btn-export-diterima').on('click', function() {
|
||||
var button = $(this);
|
||||
var originalHtml = button.html();
|
||||
|
||||
var url = "{{ route('laporan-kegiatan.mbkm.export-excel') }}";
|
||||
var unitKerjaFilter = $('#unitKerjaFilter').val();
|
||||
if (unitKerjaFilter) {
|
||||
url += "?unit_kerja_filter=" + encodeURIComponent(unitKerjaFilter);
|
||||
}
|
||||
|
||||
button.prop('disabled', true).html('<span class="spinner-border spinner-border-sm me-1"></span> Exporting...');
|
||||
|
||||
fetch(url)
|
||||
.then(function(response) {
|
||||
if (!response.ok) { throw new Error('gagal'); }
|
||||
var filename = 'laporan-kegiatan-mbkm-diterima.xlsx';
|
||||
var disposition = response.headers.get('Content-Disposition');
|
||||
if (disposition) {
|
||||
var match = disposition.match(/filename[^;=\n]*=['"]?([^'"\n]+)['"]?/);
|
||||
if (match) { filename = match[1]; }
|
||||
}
|
||||
return response.blob().then(function(blob) {
|
||||
return { blob: blob, filename: filename };
|
||||
});
|
||||
})
|
||||
.then(function(data) {
|
||||
var downloadUrl = URL.createObjectURL(data.blob);
|
||||
var a = document.createElement('a');
|
||||
a.href = downloadUrl;
|
||||
a.download = data.filename;
|
||||
a.style.display = 'none';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(downloadUrl);
|
||||
button.prop('disabled', false).html(originalHtml);
|
||||
showSuccess('Berhasil!', 'File Excel berhasil didownload');
|
||||
})
|
||||
.catch(function() {
|
||||
button.prop('disabled', false).html(originalHtml);
|
||||
showError('Gagal', 'Terjadi kesalahan saat export Excel');
|
||||
});
|
||||
});
|
||||
|
||||
var $contextMenu = $('#rowContextMenu').appendTo('body');
|
||||
var MENU_W = 168;
|
||||
var MENU_H = 90;
|
||||
|
||||
function showContextMenu(e, id) {
|
||||
currentRowId = id;
|
||||
var flipH = (e.clientX + MENU_W + 8 > window.innerWidth);
|
||||
var flipV = (e.clientY + MENU_H + 8 > window.innerHeight);
|
||||
var x = flipH ? e.pageX - MENU_W : e.pageX;
|
||||
var y = flipV ? e.pageY - MENU_H : e.pageY;
|
||||
var arrowClass = 'arrow-' + (flipV ? 'bottom' : 'top') + '-' + (flipH ? 'right' : 'left');
|
||||
|
||||
$contextMenu
|
||||
.removeClass('arrow-top-left arrow-top-right arrow-bottom-left arrow-bottom-right')
|
||||
.addClass(arrowClass)
|
||||
.css({ top: y, left: x, display: 'block', animation: 'none' });
|
||||
|
||||
$contextMenu[0].offsetWidth;
|
||||
$contextMenu.css('animation', 'rowMenuFadeIn 0.2s ease forwards');
|
||||
}
|
||||
|
||||
function hideContextMenu() {
|
||||
$contextMenu.css('display', 'none');
|
||||
currentRowId = null;
|
||||
}
|
||||
|
||||
$(document).on('click', '#belum-diverifikasi-content tbody tr, #diterima-content tbody tr, #ditolak-content tbody tr', function(e) {
|
||||
e.stopPropagation();
|
||||
var id = $(this).data('id');
|
||||
if (!id) { return; }
|
||||
showContextMenu(e, id);
|
||||
});
|
||||
|
||||
$(document).on('click', '#kegiatan-duplikat-content tbody tr', function(e) {
|
||||
var id = $(this).data('id');
|
||||
if (!id) { return; }
|
||||
navigateToDetail(id, detailBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.row-detail-btn', function() {
|
||||
var id = currentRowId;
|
||||
hideContextMenu();
|
||||
if (!id) { return; }
|
||||
navigateToDetail(id, detailBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.row-biaya-btn', function() {
|
||||
var id = currentRowId;
|
||||
hideContextMenu();
|
||||
if (!id) { return; }
|
||||
navigateToBiaya(id, biayaBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
$(document).on('click', function(e) {
|
||||
if (!$(e.target).closest('#rowContextMenu').length) {
|
||||
hideContextMenu();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,280 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@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);">Laporan Kegiatan</a></li>
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">Pengajuan</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="card border text-center">
|
||||
<div class="card-header bg-primary text-white py-0">
|
||||
<h5>Total Biaya</h5>
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
<h2 id="totalBiaya">...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="card border text-center">
|
||||
<div class="card-header bg-success text-white py-0">
|
||||
<h5>Total Poin</h5>
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
<h2 id="totalPoin">...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border">
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
<a href="#anggotaSk" data-bs-toggle="tab" aria-expanded="true" class="nav-link rounded-0 active">
|
||||
<i class="mdi mdi-home-variant d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Anggota SK</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#p2PerOrang" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="mdi mdi-account-circle d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">P2 Per Orang</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="anggotaSk">
|
||||
<table class="table table-bordered table-striped w-100" id="rekap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>NIP</th>
|
||||
<th>Nama</th>
|
||||
<th>Poin</th>
|
||||
<th>Biaya</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="p2PerOrang">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 mb-2 mb-sm-0 px-0">
|
||||
<div class="border h-100" style="max-height: 700px;">
|
||||
<div class="px-2 py-1 bg-light border-bottom">
|
||||
<h5 class="mb-0 text-center" style="padding-bottom: 7px">Daftar Pegawai</h5>
|
||||
</div>
|
||||
<div style="height: calc(700px - 50px); overflow-y: auto; overflow-x: hidden;">
|
||||
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist"
|
||||
aria-orientation="vertical">
|
||||
@foreach ($kegiatan->syarats ?? [] as $syarat)
|
||||
<a @class(['nav-link text-start', 'active show' => $loop->first]) id="{{ $syarat->id_pelaksana }}-tab"
|
||||
data-bs-toggle="pill" href="#nav-{{ $syarat->id_pelaksana }}"
|
||||
role="tab" aria-controls="nav-{{ $syarat->id_pelaksana }}"
|
||||
aria-selected="{{ $loop->first ? 'true' : 'false' }}"
|
||||
title="{{ $syarat?->pegawai?->nama }}"
|
||||
style="display:flex;align-items:center;gap:4px;width:100%;overflow:hidden">
|
||||
<i class="mdi mdi-account flex-shrink-0"></i>
|
||||
<span style="flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">
|
||||
{{ $syarat?->pegawai?->nama }}
|
||||
</span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-9 px-0">
|
||||
<div class="border h-100">
|
||||
<div class="tab-content p-3" id="v-pills-tabContent">
|
||||
@foreach ($kegiatan->syarats ?? [] as $syarat)
|
||||
<div @class(['tab-pane fade', 'show active' => $loop->first]) id="nav-{{ $syarat->id_pelaksana }}"
|
||||
role="tabpanel" aria-labelledby="{{ $syarat->id_pelaksana }}-tab">
|
||||
<h5 class="mb-3 text-primary border-bottom pb-2">
|
||||
<i
|
||||
class="mdi mdi-account-circle me-2"></i>{{ $syarat?->pegawai?->nama }}
|
||||
</h5>
|
||||
<div class="accordion custom-accordion"
|
||||
id="accordion-{{ $syarat->id_pelaksana }}">
|
||||
@foreach ($p2[$syarat->id_pelaksana]['p2'] as $key => $detail)
|
||||
<div class="card mb-2">
|
||||
<div class="card-header"
|
||||
id="heading-month-{{ $syarat->id_pelaksana }}-{{ $key }}">
|
||||
<h5 class="m-0">
|
||||
<a class="custom-accordion-title d-block py-1"
|
||||
data-bs-toggle="collapse"
|
||||
href="#collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
aria-expanded="{{ $loop->first ? 'true' : 'false' }}"
|
||||
aria-controls="collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}">
|
||||
<span class="fw-bold">{{ $months[$key] }}
|
||||
{{ date('Y') }}</span>
|
||||
<span><i class="uil-arrow-right"></i></span>
|
||||
<span>{{ $detail['jumlah']['steps'][count($detail['jumlah']['steps']) - 1] }}</span>
|
||||
<i class="mdi mdi-chevron-down accordion-arrow"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
class="collapse @if ($loop->first) show @endif"
|
||||
aria-labelledby="heading-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
data-bs-parent="#accordion-{{ $syarat->id_pelaksana }}">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 border">
|
||||
<h5>Pemotongan Poin</h5>
|
||||
<ul>
|
||||
@foreach ($detail['poin']['steps'] as $step)
|
||||
<li @class(['text-primary fw-bold' => $loop->last])>
|
||||
{{ $step }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-9 border">
|
||||
<h5>Jumlah</h5>
|
||||
<ul>
|
||||
@foreach ($detail['jumlah']['steps'] as $step)
|
||||
<li @class(['text-primary fw-bold' => $loop->last])>
|
||||
{{ $step }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<!-- Sidebar Aktif -->
|
||||
<script>
|
||||
$('.si-laporan-kegiatan').addClass('menuitem-active');
|
||||
$('.ni-laporan-kegiatan').addClass('badge-primary-lighten');
|
||||
$('.li-laporan-kegiatan').addClass('show');
|
||||
$('.li-laporan-kegiatan-penunjang').addClass('active badge-primary-lighten');
|
||||
</script>
|
||||
|
||||
<!-- Datatables -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var kegiatanId = {{ $kegiatan['id'] }};
|
||||
|
||||
if (dataTablez) {
|
||||
dataTablez.destroy();
|
||||
$('#totalBiaya').text('...');
|
||||
$('#totalPoin').text('...');
|
||||
}
|
||||
|
||||
var dataTablez = $('#rekap').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.penunjang.data-biaya', ':id') }}".replace(':id',
|
||||
kegiatanId),
|
||||
dataSrc: function(json) {
|
||||
$('#totalBiaya').text('Rp. ' + json.total_biaya || 0);
|
||||
$('#totalPoin').text(json.total_poin || 0);
|
||||
|
||||
return json.data;
|
||||
},
|
||||
error: function(xhr, error, thrown) {
|
||||
console.error('DataTable Error:', error);
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: "id_pelaksana",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center nominal-cell'
|
||||
},
|
||||
{
|
||||
data: 'nama',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
data: 'poin',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center nominal-cell',
|
||||
render: function(data) {
|
||||
if (data === null || data === undefined) { return '-'; }
|
||||
return parseFloat(data).toLocaleString('id-ID', {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'biaya',
|
||||
name: 'biaya',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
render: function(data) {
|
||||
if (!data) {
|
||||
return '<div class="d-flex justify-content-between gap-1 nominal-cell"><span>Rp.</span><span>0</span></div>';
|
||||
}
|
||||
if (!data.toString().startsWith('Rp')) {
|
||||
return data;
|
||||
}
|
||||
var parts = data.split(' ');
|
||||
var number = parts.slice(1).join(' ');
|
||||
return '<div class="d-flex justify-content-between gap-1 nominal-cell"><span>Rp.</span><span>' + number + '</span></div>';
|
||||
}
|
||||
}
|
||||
],
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
// Inisialisasi: sembunyikan semua chevron kecuali yang aktif
|
||||
$('.accordion .collapse').each(function() {
|
||||
var chevron = $(this).prev('.card-header').find('.accordion-arrow');
|
||||
|
||||
if ($(this).hasClass('show')) {
|
||||
chevron.show();
|
||||
} else {
|
||||
chevron.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Event listener untuk show/hide chevron saat accordion dibuka/ditutup
|
||||
$('.accordion .collapse').on('show.bs.collapse', function() {
|
||||
$(this).prev('.card-header').find('.accordion-arrow').show();
|
||||
});
|
||||
|
||||
$('.accordion .collapse').on('hide.bs.collapse', function() {
|
||||
$(this).prev('.card-header').find('.accordion-arrow').hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,512 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('css')
|
||||
<style>
|
||||
.tooltip-wide .tooltip-inner {
|
||||
max-width: 420px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* Context Menu */
|
||||
@keyframes rowMenuFadeIn {
|
||||
from { opacity: 0; transform: scale(0.92) translateY(-6px); }
|
||||
to { opacity: 1; transform: scale(1) translateY(0); }
|
||||
}
|
||||
#rowContextMenu { display: none; }
|
||||
|
||||
/* Arrow - top left (default) */
|
||||
#rowContextMenu.arrow-top-left { transform-origin: top left; }
|
||||
#rowContextMenu.arrow-top-left::before,
|
||||
#rowContextMenu.arrow-top-left::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-top-left::before { top: -16px; border-bottom-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-top-left::after { top: -15px; border-bottom-color: #fff; }
|
||||
|
||||
/* Arrow - top right */
|
||||
#rowContextMenu.arrow-top-right { transform-origin: top right; }
|
||||
#rowContextMenu.arrow-top-right::before,
|
||||
#rowContextMenu.arrow-top-right::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-top-right::before { top: -16px; border-bottom-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-top-right::after { top: -15px; border-bottom-color: #fff; }
|
||||
|
||||
/* Arrow - bottom left */
|
||||
#rowContextMenu.arrow-bottom-left { transform-origin: bottom left; }
|
||||
#rowContextMenu.arrow-bottom-left::before,
|
||||
#rowContextMenu.arrow-bottom-left::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-bottom-left::before { bottom: -16px; border-top-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-bottom-left::after { bottom: -15px; border-top-color: #fff; }
|
||||
|
||||
/* Arrow - bottom right */
|
||||
#rowContextMenu.arrow-bottom-right { transform-origin: bottom right; }
|
||||
#rowContextMenu.arrow-bottom-right::before,
|
||||
#rowContextMenu.arrow-bottom-right::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
border: 8px solid transparent;
|
||||
}
|
||||
#rowContextMenu.arrow-bottom-right::before { bottom: -16px; border-top-color: #dee2e6; }
|
||||
#rowContextMenu.arrow-bottom-right::after { bottom: -15px; border-top-color: #fff; }
|
||||
|
||||
.row-context-item:hover {
|
||||
background-color: #eef2ff !important;
|
||||
color: #3b5bdb !important;
|
||||
}
|
||||
.row-context-item:hover i { color: #3b5bdb; }
|
||||
</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);">Laporan Kegiatan</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@if ($periode && !$periode->canVerifyLaporanKegiatan() && Auth::user()->id != 1)
|
||||
<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->getVerificationErrorMessage() ?? 'Periode verifikasi laporan kegiatan tidak aktif.' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card border">
|
||||
<div class="card-body">
|
||||
@include('components.datatable-header', [
|
||||
'title' => 'Daftar Laporan Kegiatan Penunjang',
|
||||
'description' => 'Berikut adalah daftar laporan kegiatan penunjang yang telah diajukan',
|
||||
])
|
||||
|
||||
@if ($team->id == 1 && count($unitKerjas) > 0)
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-6">
|
||||
<div class="mb-2">
|
||||
<label for="unitKerjaFilter" class="form-label">Unit Kerja</label>
|
||||
<select class="form-select select2" id="unitKerjaFilter" name="unitKerjaFilter"
|
||||
data-placeholder="Pilih Unit Kerja...">
|
||||
<option value=""></option>
|
||||
@foreach ($unitKerjas as $unit)
|
||||
<option value="{{ $unit->id }}" {{ request('unit_id') == $unit->id ? 'selected' : '' }}>{{ $unit->nama }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3" id="category-tabs">
|
||||
<li class="nav-item">
|
||||
<a href="#belum-diverifikasi" data-bs-toggle="tab" aria-expanded="true"
|
||||
class="nav-link rounded-0 active">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Belum Diverifikasi</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#diterima" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Diterima</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#ditolak" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Ditolak</span>
|
||||
</a>
|
||||
</li>
|
||||
{{-- <li class="nav-item">
|
||||
<a href="#kegiatan-duplikat" data-bs-toggle="tab" aria-expanded="false"
|
||||
class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Kegiatan Duplikat</span>
|
||||
</a>
|
||||
</li> --}}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="belum-diverifikasi">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="belum-diverifikasi-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="diterima">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="diterima-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="ditolak">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="ditolak-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th style="width:180px;min-width:180px;max-width:180px">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="kegiatan-duplikat">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered w-100 dt-styled" id="kegiatan-duplikat-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Jumlah Kegiatan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Context Menu Row -->
|
||||
<ul id="rowContextMenu" style="position:absolute;z-index:999;background:#fff;border:1px solid #dee2e6;border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.12);padding:4px 0;min-width:160px;list-style:none;margin:0">
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="row-context-item row-detail-btn d-flex align-items-center gap-2 px-3 py-2 text-decoration-none" style="font-size:14px;color:#212529;border-radius:6px;margin:2px 4px;transition:background .15s ease,color .15s ease">
|
||||
<i class="uil-info-circle" style="font-size:16px"></i> Detail
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="row-context-item row-biaya-btn d-flex align-items-center gap-2 px-3 py-2 text-decoration-none" style="font-size:14px;color:#212529;border-radius:6px;margin:2px 4px;transition:background .15s ease,color .15s ease">
|
||||
<i class="uil-bill" style="font-size:16px"></i> Biaya
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<!-- Sidebar Aktif -->
|
||||
<script>
|
||||
$('.si-laporan-kegiatan').addClass('menuitem-active');
|
||||
$('.ni-laporan-kegiatan').addClass('badge-primary-lighten');
|
||||
$('.li-laporan-kegiatan').addClass('show');
|
||||
$('.li-laporan-kegiatan-penunjang').addClass('active badge-primary-lighten');
|
||||
</script>
|
||||
|
||||
<!-- Datatable & Row Click -->
|
||||
<script>
|
||||
var detailBaseUrl = "{{ url('/laporan-kegiatan/penunjang/detail') }}";
|
||||
var biayaBaseUrl = "{{ url('/laporan-kegiatan/penunjang/biaya') }}";
|
||||
var currentRowId = null;
|
||||
|
||||
function navigateToDetail(id, url) {
|
||||
@if (Auth::user()->id == 1)
|
||||
var unitId = $('#unitKerjaFilter').val();
|
||||
if (!unitId) {
|
||||
showWarning('Peringatan!', 'Pilih Unit Kerja terlebih dahulu sebelum melihat detail.');
|
||||
return;
|
||||
}
|
||||
window.location.href = url + '?unit_id=' + unitId;
|
||||
@else
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.href = url;
|
||||
} else {
|
||||
showWarning('Peringatan', response.message || 'Periode verifikasi tidak aktif');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
var message = 'Periode verifikasi tidak aktif';
|
||||
if (xhr.responseJSON && xhr.responseJSON.message) {
|
||||
message = xhr.responseJSON.message;
|
||||
}
|
||||
showWarning('Peringatan', message);
|
||||
}
|
||||
});
|
||||
@endif
|
||||
}
|
||||
|
||||
function navigateToBiaya(id, url) {
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var actionSuccess = sessionStorage.getItem('penunjang_terima_success');
|
||||
if (actionSuccess) {
|
||||
sessionStorage.removeItem('penunjang_terima_success');
|
||||
showSuccess('Berhasil!', actionSuccess);
|
||||
}
|
||||
|
||||
var dataTable = null;
|
||||
var duplicateDataTable = null;
|
||||
|
||||
function initDataTable(category) {
|
||||
var status = null;
|
||||
|
||||
if (dataTable) {
|
||||
$('[data-bs-toggle="tooltip"]', dataTable.table().node()).each(function() {
|
||||
var tip = bootstrap.Tooltip.getInstance(this);
|
||||
if (tip) { tip.dispose(); }
|
||||
});
|
||||
dataTable.destroy();
|
||||
}
|
||||
|
||||
if (category === 'belum-diverifikasi') {
|
||||
status = 'belum_verifikasi';
|
||||
} else if (category === 'diterima') {
|
||||
status = 'diterima';
|
||||
} else if (category === 'ditolak') {
|
||||
status = 'ditolak';
|
||||
} else {
|
||||
status = category;
|
||||
}
|
||||
|
||||
dataTable = $(`#${category}-content`).DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.penunjang.data') }}/?status=" + status,
|
||||
data: function(d) {
|
||||
d.status = status;
|
||||
@if (Auth::user()->id == 1)
|
||||
d.unit_kerja_filter = $('#unitKerjaFilter').val();
|
||||
@endif
|
||||
},
|
||||
},
|
||||
columns: [{
|
||||
data: 'nama_kegiatan',
|
||||
name: 'nama_kegiatan',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
render: function(data) {
|
||||
var escaped = $('<div>').text(data).html();
|
||||
return '<div data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="' + escaped + '" data-bs-custom-class="tooltip-wide" style="display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-height:3em">' + escaped + '</div>';
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'tanggal_kegiatan',
|
||||
name: 'tanggal_kegiatan',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center',
|
||||
},
|
||||
{
|
||||
data: 'duplikat',
|
||||
name: 'duplikat',
|
||||
searchable: false,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'status',
|
||||
name: 'status',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center',
|
||||
width: '180px'
|
||||
}
|
||||
],
|
||||
order: [
|
||||
[0, 'asc']
|
||||
],
|
||||
autoWidth: false,
|
||||
createdRow: function(row, data) {
|
||||
$(row).css('cursor', 'pointer').attr('data-id', data.id);
|
||||
},
|
||||
drawCallback: function() {
|
||||
document.querySelectorAll('body > .tooltip').forEach(function(el) { el.remove(); });
|
||||
$('[data-bs-toggle="tooltip"]', this.api().table().node()).each(function() {
|
||||
var tip = bootstrap.Tooltip.getInstance(this);
|
||||
if (tip) { tip.dispose(); }
|
||||
bootstrap.Tooltip.getOrCreateInstance(this, {
|
||||
trigger: 'hover',
|
||||
container: 'body'
|
||||
});
|
||||
});
|
||||
},
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initDuplicateDataTable() {
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.destroy();
|
||||
}
|
||||
|
||||
duplicateDataTable = $('#kegiatan-duplikat-content').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.penunjang.data-duplikat') }}",
|
||||
data: function(d) {
|
||||
@if (Auth::user()->id == 1)
|
||||
d.unit_kerja_filter = $('#unitKerjaFilter').val();
|
||||
@endif
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: "nama_kegiatan",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
data: 'jumlah',
|
||||
searchable: false,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
}
|
||||
],
|
||||
createdRow: function(row, data) {
|
||||
$(row).css('cursor', 'pointer').attr('data-id', data.id);
|
||||
},
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#category-tabs a[data-bs-toggle="tab"]').on('shown.bs.tab', function(e) {
|
||||
var target = $(e.target).attr('href');
|
||||
var category = target.replace('#', '');
|
||||
|
||||
if (category === 'kegiatan-duplikat') {
|
||||
if (dataTable) { dataTable.clear(); }
|
||||
if (duplicateDataTable) { duplicateDataTable.clear(); }
|
||||
initDuplicateDataTable();
|
||||
} else {
|
||||
if (dataTable) { dataTable.clear(); }
|
||||
if (duplicateDataTable) { duplicateDataTable.clear(); }
|
||||
initDataTable(category);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize default tab
|
||||
initDataTable('belum-diverifikasi');
|
||||
|
||||
@if (Auth::user()->id == 1)
|
||||
$('#unitKerjaFilter').on('select2:select select2:clear change', function() {
|
||||
var activeTab = $('#category-tabs .nav-link.active').attr('href').replace('#', '');
|
||||
|
||||
if (activeTab === 'kegiatan-duplikat') {
|
||||
if (duplicateDataTable) { duplicateDataTable.ajax.reload(); }
|
||||
} else {
|
||||
if (dataTable) { dataTable.ajax.reload(); }
|
||||
}
|
||||
});
|
||||
@endif
|
||||
|
||||
var $contextMenu = $('#rowContextMenu').appendTo('body');
|
||||
|
||||
var MENU_W = 168;
|
||||
var MENU_H = 90;
|
||||
|
||||
function showContextMenu(e, id) {
|
||||
currentRowId = id;
|
||||
|
||||
var flipH = (e.clientX + MENU_W + 8 > window.innerWidth);
|
||||
var flipV = (e.clientY + MENU_H + 8 > window.innerHeight);
|
||||
var x = flipH ? e.pageX - MENU_W : e.pageX;
|
||||
var y = flipV ? e.pageY - MENU_H : e.pageY;
|
||||
var arrowClass = 'arrow-' + (flipV ? 'bottom' : 'top') + '-' + (flipH ? 'right' : 'left');
|
||||
|
||||
// Reset animasi: set animation none dulu, force reflow, lalu set ulang
|
||||
$contextMenu
|
||||
.removeClass('arrow-top-left arrow-top-right arrow-bottom-left arrow-bottom-right')
|
||||
.addClass(arrowClass)
|
||||
.css({ top: y, left: x, display: 'block', animation: 'none' });
|
||||
|
||||
$contextMenu[0].offsetWidth; // force reflow agar animasi restart
|
||||
|
||||
$contextMenu.css('animation', 'rowMenuFadeIn 0.2s ease forwards');
|
||||
}
|
||||
|
||||
function hideContextMenu() {
|
||||
$contextMenu.css('display', 'none');
|
||||
currentRowId = null;
|
||||
}
|
||||
|
||||
// Row click - main tables
|
||||
$(document).on('click', '#belum-diverifikasi-content tbody tr, #diterima-content tbody tr, #ditolak-content tbody tr', function(e) {
|
||||
e.stopPropagation();
|
||||
var id = $(this).data('id');
|
||||
if (!id) { return; }
|
||||
showContextMenu(e, id);
|
||||
});
|
||||
|
||||
// Row click - duplicate table
|
||||
$(document).on('click', '#kegiatan-duplikat-content tbody tr', function(e) {
|
||||
var id = $(this).data('id');
|
||||
if (!id) { return; }
|
||||
navigateToDetail(id, detailBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
// Context menu action buttons
|
||||
$(document).on('click', '.row-detail-btn', function() {
|
||||
var id = currentRowId;
|
||||
hideContextMenu();
|
||||
if (!id) { return; }
|
||||
navigateToDetail(id, detailBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
$(document).on('click', '.row-biaya-btn', function() {
|
||||
var id = currentRowId;
|
||||
hideContextMenu();
|
||||
if (!id) { return; }
|
||||
navigateToBiaya(id, biayaBaseUrl + '/' + id);
|
||||
});
|
||||
|
||||
// Close context menu when clicking elsewhere
|
||||
$(document).on('click', function(e) {
|
||||
if (!$(e.target).closest('#rowContextMenu').length) {
|
||||
hideContextMenu();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,278 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@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);">Laporan Kegiatan</a></li>
|
||||
<li class="breadcrumb-item"><a href="javascript:void(0);">Pengajuan</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="card border text-center">
|
||||
<div class="card-header bg-primary text-white py-0">
|
||||
<h5>Total Biaya</h5>
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
<h2 id="totalBiaya">...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="card border text-center">
|
||||
<div class="card-header bg-success text-white py-0">
|
||||
<h5>Total Poin</h5>
|
||||
</div>
|
||||
<div class="card-body py-1">
|
||||
<h2 id="totalPoin">...</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border">
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3">
|
||||
<li class="nav-item">
|
||||
<a href="#anggotaSk" data-bs-toggle="tab" aria-expanded="true" class="nav-link rounded-0 active">
|
||||
<i class="mdi mdi-home-variant d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Anggota SK</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#p2PerOrang" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="mdi mdi-account-circle d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">P2 Per Orang</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#p2PerBulan" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="mdi mdi-settings-outline d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">P2 Per Bulan</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane show active" id="anggotaSk">
|
||||
<table class="table table-bordered table-striped w-100" id="rekap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">No</th>
|
||||
<th>NIP</th>
|
||||
<th>Nama</th>
|
||||
<th>Poin</th>
|
||||
<th>Biaya</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="p2PerOrang">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 mb-2 mb-sm-0 px-0">
|
||||
<div class="border h-100" style="max-height: 700px;">
|
||||
<div class="px-2 py-1 bg-light border-bottom">
|
||||
<h5 class="mb-0 text-center" style="padding-bottom: 7px">Daftar Pegawai</h5>
|
||||
</div>
|
||||
<div style="height: calc(700px - 50px); overflow-y: auto; overflow-x: hidden;">
|
||||
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist"
|
||||
aria-orientation="vertical">
|
||||
@foreach ($kegiatan->syarats ?? [] as $syarat)
|
||||
<a @class(['nav-link text-start', 'active show' => $loop->first]) id="{{ $syarat->id_pelaksana }}-tab"
|
||||
data-bs-toggle="pill" href="#nav-{{ $syarat->id_pelaksana }}"
|
||||
role="tab" aria-controls="nav-{{ $syarat->id_pelaksana }}"
|
||||
aria-selected="{{ $loop->first ? 'true' : 'false' }}"
|
||||
style="display: block; word-wrap: break-word; white-space: normal;">
|
||||
<i class="mdi mdi-account d-inline-block me-1"></i>
|
||||
<span title="{{ $syarat?->pegawai?->nama }}">
|
||||
{{ $syarat?->pegawai?->nama }}
|
||||
</span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-9 px-0">
|
||||
<div class="border h-100">
|
||||
<div class="tab-content p-3" id="v-pills-tabContent">
|
||||
@foreach ($kegiatan->syarats ?? [] as $syarat)
|
||||
<div @class(['tab-pane fade', 'show active' => $loop->first]) id="nav-{{ $syarat->id_pelaksana }}"
|
||||
role="tabpanel" aria-labelledby="{{ $syarat->id_pelaksana }}-tab">
|
||||
<h5 class="mb-3 text-primary border-bottom pb-2">
|
||||
<i
|
||||
class="mdi mdi-account-circle me-2"></i>{{ $syarat?->pegawai?->nama }}
|
||||
</h5>
|
||||
<div class="accordion custom-accordion"
|
||||
id="accordion-{{ $syarat->id_pelaksana }}">
|
||||
@foreach ($p2[$syarat->id_pelaksana]['p2'] as $key => $detail)
|
||||
<div class="card mb-2">
|
||||
<div class="card-header"
|
||||
id="heading-month-{{ $syarat->id_pelaksana }}-{{ $key }}">
|
||||
<h5 class="m-0">
|
||||
<a class="custom-accordion-title d-block py-1"
|
||||
data-bs-toggle="collapse"
|
||||
href="#collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
aria-expanded="{{ $loop->first ? 'true' : 'false' }}"
|
||||
aria-controls="collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}">
|
||||
<span class="fw-bold">{{ $months[$key] }}
|
||||
{{ date('Y') }}</span>
|
||||
<span><i class="uil-arrow-right"></i></span>
|
||||
<span>{{ $detail['jumlah']['steps'][count($detail['jumlah']['steps']) - 1] }}</span>
|
||||
<i class="mdi mdi-chevron-down accordion-arrow"></i>
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
|
||||
<div id="collapse-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
class="collapse @if ($loop->first) show @endif"
|
||||
aria-labelledby="heading-month-{{ $syarat->id_pelaksana }}-{{ $key }}"
|
||||
data-bs-parent="#accordion-{{ $syarat->id_pelaksana }}">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 border">
|
||||
<h5>Pemotongan Poin</h5>
|
||||
<ul>
|
||||
@foreach ($detail['poin']['steps'] as $step)
|
||||
<li @class(['text-primary fw-bold' => $loop->last])>
|
||||
{{ $step }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-9 border">
|
||||
<h5>Jumlah</h5>
|
||||
<ul>
|
||||
@foreach ($detail['jumlah']['steps'] as $step)
|
||||
<li @class(['text-primary fw-bold' => $loop->last])>
|
||||
{{ $step }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="p2PerBulan">
|
||||
<p>...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<!-- Sidebar Aktif -->
|
||||
<script>
|
||||
$('.si-laporan-kegiatan').addClass('menuitem-active');
|
||||
$('.ni-laporan-kegiatan').addClass('badge-primary-lighten');
|
||||
$('.li-laporan-kegiatan').addClass('show');
|
||||
$('.li-laporan-kegiatan-prestasi').addClass('active badge-primary-lighten');
|
||||
</script>
|
||||
|
||||
<!-- Datatables -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var kegiatanId = {{ $kegiatan['id'] }};
|
||||
|
||||
if (dataTablez) {
|
||||
dataTablez.destroy();
|
||||
$('#totalBiaya').text('...');
|
||||
$('#totalPoin').text('...');
|
||||
}
|
||||
|
||||
var dataTablez = $('#rekap').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.prestasi.data-biaya', ':id') }}".replace(':id',
|
||||
kegiatanId),
|
||||
dataSrc: function(json) {
|
||||
$('#totalBiaya').text('Rp. ' + json.total_biaya || 0);
|
||||
$('#totalPoin').text(json.total_poin || 0);
|
||||
|
||||
return json.data;
|
||||
},
|
||||
error: function(xhr, error, thrown) {
|
||||
console.error('DataTable Error:', error);
|
||||
}
|
||||
},
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: "id_pelaksana",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'nama',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
data: 'poin',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'biaya',
|
||||
name: 'biaya',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
}
|
||||
],
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
// Inisialisasi: sembunyikan semua chevron kecuali yang aktif
|
||||
$('.accordion .collapse').each(function() {
|
||||
var chevron = $(this).prev('.card-header').find('.accordion-arrow');
|
||||
|
||||
if ($(this).hasClass('show')) {
|
||||
chevron.show();
|
||||
} else {
|
||||
chevron.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Event listener untuk show/hide chevron saat accordion dibuka/ditutup
|
||||
$('.accordion .collapse').on('show.bs.collapse', function() {
|
||||
$(this).prev('.card-header').find('.accordion-arrow').show();
|
||||
});
|
||||
|
||||
$('.accordion .collapse').on('hide.bs.collapse', function() {
|
||||
$(this).prev('.card-header').find('.accordion-arrow').hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,452 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@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);">Laporan Kegiatan</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ $title }}</li>
|
||||
</ol>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="card border">
|
||||
<div class="card-body">
|
||||
@include('components.datatable-header', [
|
||||
'title' => 'Daftar Laporan Kegiatan Prestasi',
|
||||
'description' => 'Berikut adalah daftar laporan kegiatan prestasi yang telah diajukan'
|
||||
])
|
||||
|
||||
<ul class="nav nav-pills bg-nav-pills nav-justified mb-3" id="category-tabs">
|
||||
<li class="nav-item">
|
||||
<a href="#belum-diajukan" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Belum Diajukan</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#belum-diverifikasi" data-bs-toggle="tab" aria-expanded="true"
|
||||
class="nav-link rounded-0 active">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Belum Diverifikasi</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#diterima" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Diterima</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#ditolak" data-bs-toggle="tab" aria-expanded="false" class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Ditolak</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="#kegiatan-duplikat" data-bs-toggle="tab" aria-expanded="false"
|
||||
class="nav-link rounded-0">
|
||||
<i class="uil-clipboard-alt d-md-none d-block"></i>
|
||||
<span class="d-none d-md-block">Kegiatan Duplikat</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane" id="belum-diajukan">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped w-100" id="belum-diajukan-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>Unit Kerja</th>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane show active" id="belum-diverifikasi">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped w-100" id="belum-diverifikasi-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>Unit Kerja</th>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="diterima">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped w-100" id="diterima-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>Unit Kerja</th>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="ditolak">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped w-100" id="ditolak-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>Unit Kerja</th>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Duplikat</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="kegiatan-duplikat">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped w-100" id="kegiatan-duplikat-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>Nama Kegiatan</th>
|
||||
<th>Jumlah Kegiatan</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('js')
|
||||
<!-- Sidebar Aktif -->
|
||||
<script>
|
||||
$('.si-laporan-kegiatan').addClass('menuitem-active');
|
||||
$('.ni-laporan-kegiatan').addClass('badge-primary-lighten');
|
||||
$('.li-laporan-kegiatan').addClass('show');
|
||||
$('.li-laporan-kegiatan-prestasi').addClass('active badge-primary-lighten');
|
||||
</script>
|
||||
|
||||
<!-- Datatable Detail -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var dataTable = null;
|
||||
var duplicateDataTable = null;
|
||||
|
||||
function initDataTable(category) {
|
||||
var status = null;
|
||||
|
||||
if (dataTable) {
|
||||
dataTable.destroy();
|
||||
}
|
||||
|
||||
if (category === 'belum-diajukan') {
|
||||
status = 'belum_diajukan';
|
||||
} else if (category === 'belum-diverifikasi') {
|
||||
status = 'belum_verifikasi';
|
||||
} else if (category === 'diterima') {
|
||||
status = 'diterima';
|
||||
} else if (category === 'ditolak') {
|
||||
status = 'ditolak';
|
||||
} else {
|
||||
status = category;
|
||||
}
|
||||
|
||||
dataTable = $(`#${category}-content`).DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "{{ route('laporan-kegiatan.prestasi.data') }}/?status=" + status,
|
||||
data: function(d) {
|
||||
d.status = status;
|
||||
},
|
||||
},
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
name: 'DT_RowIndex',
|
||||
className: 'text-center',
|
||||
orderable: true,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
data: 'unit_kerja',
|
||||
name: 'unit_kerja',
|
||||
searchable: true,
|
||||
orderable: true
|
||||
},
|
||||
{
|
||||
data: 'nama_kegiatan',
|
||||
name: 'nama_kegiatan',
|
||||
searchable: true,
|
||||
orderable: true
|
||||
},
|
||||
{
|
||||
data: 'tanggal_kegiatan',
|
||||
name: 'tanggal_kegiatan',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
className: 'text-center',
|
||||
},
|
||||
{
|
||||
data: 'duplikat',
|
||||
name: 'duplikat',
|
||||
searchable: false,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'status',
|
||||
name: 'status',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'action',
|
||||
name: 'action',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
}
|
||||
],
|
||||
order: [
|
||||
[2, 'asc']
|
||||
],
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initDuplicateDataTable() {
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.destroy();
|
||||
}
|
||||
|
||||
duplicateDataTable = $('#kegiatan-duplikat-content').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: "{{ route('laporan-kegiatan.prestasi.data-duplikat') }}",
|
||||
columns: [{
|
||||
data: 'DT_RowIndex',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: "nama_kegiatan",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
data: 'jumlah',
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
className: 'text-center'
|
||||
},
|
||||
{
|
||||
data: 'action',
|
||||
name: 'action',
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
className: 'text-center',
|
||||
visible: false
|
||||
}
|
||||
],
|
||||
language: {
|
||||
processing: "<div class='spinner'></div> Sedang Memuat...",
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#category-tabs a[data-bs-toggle="tab"]').on('shown.bs.tab', function(e) {
|
||||
var target = $(e.target).attr('href');
|
||||
var category = target.replace('#', '');
|
||||
|
||||
if (category === 'kegiatan-duplikat') {
|
||||
// Clear other datatable if exists
|
||||
if (dataTable) {
|
||||
dataTable.clear();
|
||||
}
|
||||
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.clear();
|
||||
}
|
||||
// Initialize duplicate datatable
|
||||
initDuplicateDataTable();
|
||||
} else {
|
||||
// Clear duplicate datatable if exists
|
||||
if (dataTable) {
|
||||
dataTable.clear();
|
||||
}
|
||||
|
||||
if (duplicateDataTable) {
|
||||
duplicateDataTable.clear();
|
||||
}
|
||||
// Initialize regular datatable
|
||||
initDataTable(category);
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize default tab
|
||||
initDataTable('belum-diverifikasi');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Detail Button -->
|
||||
<script>
|
||||
$(document).on('click', '.detail-btn', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var id_kegiatan = $(this).data('id');
|
||||
var url = $(this).data('url');
|
||||
var button = $(this);
|
||||
|
||||
if (!id_kegiatan || !url) {
|
||||
showError('Error', 'Laporan Kegiatan atau URL tidak valid');
|
||||
return;
|
||||
}
|
||||
|
||||
button.prop('disabled', true).text('Loading...');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
data: {
|
||||
id_kegiatan: id_kegiatan,
|
||||
ajax: true
|
||||
},
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.href = url;
|
||||
} else {
|
||||
showError('Error', 'Terjadi kesalahan: ' + (response.message ||
|
||||
'Unknown error'));
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var errorResponse = JSON.parse(xhr.responseText);
|
||||
var errorMessage = errorResponse.message || 'Terjadi kesalahan tidak diketahui';
|
||||
} catch (e) {
|
||||
var errorMessage = 'Terjadi kesalahan saat memuat data';
|
||||
}
|
||||
|
||||
if (xhr.status === 403) {
|
||||
showWarning('Warning',
|
||||
'Anda tidak memiliki akses untuk melakukan verifikasi SK ini');
|
||||
} else if (xhr.status === 422) {
|
||||
showInfo('Info', errorMessage);
|
||||
} else if (xhr.status === 404) {
|
||||
showError('Error', 'Halaman tidak ditemukan');
|
||||
} else if (xhr.status === 500) {
|
||||
showError('Error', 'Terjadi kesalahan pada server');
|
||||
} else {
|
||||
showError('Error', 'Terjadi kesalahan: ' + errorMessage);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
button.prop('disabled', false).text('Detail');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Biaya Button -->
|
||||
<script>
|
||||
$(document).on('click', '.biaya-btn', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var id_kegiatan = $(this).data('id');
|
||||
var url = $(this).data('url');
|
||||
var button = $(this);
|
||||
|
||||
if (!id_kegiatan || !url) {
|
||||
showError('Error', 'Laporan Kegiatan atau URL tidak valid');
|
||||
return;
|
||||
}
|
||||
|
||||
button.prop('disabled', true).text('Loading...');
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
data: {
|
||||
id_kegiatan: id_kegiatan,
|
||||
ajax: true
|
||||
},
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.href = url;
|
||||
} else {
|
||||
showError('Error', 'Terjadi kesalahan: ' + (response.message ||
|
||||
'Unknown error'));
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
try {
|
||||
var errorResponse = JSON.parse(xhr.responseText);
|
||||
var errorMessage = errorResponse.message || 'Terjadi kesalahan tidak diketahui';
|
||||
} catch (e) {
|
||||
var errorMessage = 'Terjadi kesalahan saat memuat data';
|
||||
}
|
||||
|
||||
if (xhr.status === 403) {
|
||||
showWarning('Warning',
|
||||
'Anda tidak memiliki akses untuk melakukan verifikasi SK ini');
|
||||
} else if (xhr.status === 422) {
|
||||
showInfo('Info', errorMessage);
|
||||
} else if (xhr.status === 404) {
|
||||
showError('Error', 'Halaman tidak ditemukan');
|
||||
} else if (xhr.status === 500) {
|
||||
showError('Error', 'Terjadi kesalahan pada server');
|
||||
} else {
|
||||
showError('Error', 'Terjadi kesalahan: ' + errorMessage);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
button.prop('disabled', false).text('Detail');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user