Penambahan Data P1 Dawai di Remunerasi Keseluruhan
This commit is contained in:
@@ -55,11 +55,15 @@
|
||||
@php
|
||||
$actionButtons = '<button type="button" class="btn btn-sm btn-outline-success me-2" id="btn-export">
|
||||
<i class="uil-file-download-alt"></i> Export
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary me-2" id="btnPerbaruiData">
|
||||
</button>';
|
||||
|
||||
if (Auth::user()->id == 1) {
|
||||
$actionButtons .= '<button type="button" class="btn btn-sm btn-outline-primary me-2" id="btnPerbaruiData">
|
||||
<i class="mdi mdi-database-refresh-outline"></i> Perbarui Data
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" id="btnRefresh">
|
||||
</button>';
|
||||
}
|
||||
|
||||
$actionButtons .= '<button type="button" class="btn btn-sm btn-outline-secondary" id="btnRefresh">
|
||||
<i class="uil-refresh"></i>
|
||||
Refresh
|
||||
</button>';
|
||||
@@ -80,16 +84,18 @@
|
||||
<option value="dosen">Dosen</option>
|
||||
<option value="tendik">Tendik</option>
|
||||
</select>
|
||||
<div class="d-flex align-items-center gap-3 mt-1">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="include_pppk_2025">
|
||||
<label class="form-check-label" for="include_pppk_2025">PPPK 2025</label>
|
||||
@if (Auth::user()->id == 1)
|
||||
<div class="d-flex align-items-center gap-3 mt-1">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="include_pppk_2025">
|
||||
<label class="form-check-label" for="include_pppk_2025">PPPK 2025</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="include_p1_zero">
|
||||
<label class="form-check-label" for="include_p1_zero">P1 = 0</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="include_p1_zero">
|
||||
<label class="form-check-label" for="include_p1_zero">P1 = 0</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
@@ -117,6 +123,26 @@
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@if (Auth::user()->id == 1)
|
||||
<div class="col-sm-3">
|
||||
<label class="form-label">Sumber Jumlah P1</label>
|
||||
<div class="d-flex align-items-center gap-3 mt-1">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="sumber_p1" id="sumber_p1_db" value="db">
|
||||
<label class="form-check-label" for="sumber_p1_db">Database</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" name="sumber_p1" id="sumber_p1_dawai" value="dawai" checked>
|
||||
<label class="form-check-label" for="sumber_p1_dawai">JSON Dawai</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-check mt-1">
|
||||
<input class="form-check-input" type="checkbox" id="compare_p1">
|
||||
<label class="form-check-label" for="compare_p1" title="Berlaku untuk Export Excel">Bandingkan Database vs Dawai (Export)</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Tabel Data -->
|
||||
@@ -205,6 +231,7 @@
|
||||
d.tahun = $('#filter-tahun').val();
|
||||
d.include_pppk_2025 = $('#include_pppk_2025').is(':checked') ? 1 : 0;
|
||||
d.include_p1_zero = $('#include_p1_zero').is(':checked') ? 1 : 0;
|
||||
d.sumber_p1 = $('input[name="sumber_p1"]:checked').val();
|
||||
}
|
||||
},
|
||||
columns: [
|
||||
@@ -250,10 +277,17 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('#filter-jenis-pegawai, #filter-unit, #filter-tahun, #include_pppk_2025, #include_p1_zero').on('change', function() {
|
||||
$('#filter-jenis-pegawai, #filter-unit, #filter-tahun, #include_pppk_2025, #include_p1_zero, input[name="sumber_p1"]').on('change', function() {
|
||||
table.draw();
|
||||
});
|
||||
|
||||
// Tampilkan pesan dari server (mis. file JSON P1 Dawai belum ada) alih-alih alert bawaan DataTables.
|
||||
$.fn.dataTable.ext.errMode = 'none';
|
||||
$('#keseluruhan-table').on('error.dt', function(e, settings, techNote, message) {
|
||||
var xhr = settings.jqXHR;
|
||||
showError('Gagal', (xhr && xhr.responseJSON && xhr.responseJSON.message) || 'Terjadi kesalahan saat memuat data.');
|
||||
});
|
||||
|
||||
$('#btnRefresh').on('click', function() {
|
||||
var button = $(this);
|
||||
var originalText = button.html();
|
||||
@@ -293,7 +327,7 @@
|
||||
$.ajax({
|
||||
url: "{{ route('remunerasi.keseluruhan.refresh') }}",
|
||||
method: 'POST',
|
||||
data: { tahun: $('#filter-tahun').val() }
|
||||
data: { tahun: $('#filter-tahun').val(), sumber_p1: $('input[name="sumber_p1"]:checked').val() }
|
||||
}).done(function(res) {
|
||||
clearInterval(timer);
|
||||
setPct(100);
|
||||
@@ -327,6 +361,8 @@
|
||||
if (tahun) { params.push('tahun=' + tahun); }
|
||||
params.push('include_pppk_2025=' + includePppk2025);
|
||||
params.push('include_p1_zero=' + includeP1Zero);
|
||||
params.push('sumber_p1=' + $('input[name="sumber_p1"]:checked').val());
|
||||
params.push('compare=' + ($('#compare_p1').is(':checked') ? 1 : 0));
|
||||
|
||||
var url = "{{ route('remunerasi.keseluruhan.export') }}";
|
||||
if (params.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user