Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/Enums/Modul.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ final class Modul extends Enum
'url' => 'data-presisi/adat',
'permission' => 'datapresisi-adat',
],
[
'icon' => 'far fa-fw fa-circle',
'text' => 'Laporan Pengisian',
'url' => 'data-presisi/laporan',
'permission' => 'datapresisi-laporan',
],
[
'icon' => 'far fa-fw fa-circle',
'text' => 'Laporan Pengisian Perdesa',
'url' => 'data-presisi/laporan/perdesa',
'permission' => 'datapresisi-laporan',
],
],
],
[
Expand Down
40 changes: 40 additions & 0 deletions app/Http/Controllers/DataPresisiLaporanController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class DataPresisiLaporanController extends Controller
{
public function index()
{
$title = 'Data Presisi Pengisian Laporan Semua Desa';

return view('data_pokok.data_presisi.laporan.index', compact('title'));
}

public function perdesa()
{
$title = 'Data Presisi Pengisian Laporan Per Desa';

return view('data_pokok.data_presisi.laporan.perdesa', compact('title'));
}

public function cetak(Request $request)
{
$title = 'Data Presisi Pengisian Laporan Semua Desa';

return view('data_pokok.data_presisi.laporan.cetak', ['filter' => $request->getQueryString(), 'title' => $title]);
}

public function cetakPerdesa(Request $request)
{
$title = 'Data Presisi Pengisian Laporan Per Desa';
$namaDesa = session('desa.nama_desa') ?? 'Semua Desa';
return view('data_pokok.data_presisi.laporan.cetak_perdesa', [
'filter' => $request->getQueryString(),
'title' => $title,
'namaDesa' => $namaDesa
]);
}
}
6 changes: 1 addition & 5 deletions catatan_rilis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ Di rilis ini, versi 2511.0.0 berisi penambahan dan perbaikan yang diminta penggu

#### Penambahan Fitur

1. [#827](https://github.com/OpenSID/OpenKab/issues/827) Penambahan Fitur Login OTP Passwordless dengan Pengaturan Awal via Email/Telegram sebagai Alternatif Autentikasi di OpenKab.
2. [#829](https://github.com/OpenSID/OpenKab/issues/829) Penambahan 2FA keamaan login.
1. [#842](https://github.com/OpenSID/OpenKab/issues/842) Tambahkan fitur halaman baru laporan pengisian pada menu data presisi.

#### Perbaikan BUG

1. [#836](https://github.com/OpenSID/OpenKab/issues/836) Perbaikan unit test.

#### Perubahan Teknis

1. [#790](https://github.com/OpenSID/OpenKab/issues/790) Upgrade versi laravel dari 9.52.16 menjadi 10.48.29.
2. [#791](https://github.com/OpenSID/OpenKab/issues/791) Upgrade teknis berdasarkan composer audit pada OpenKab.
81 changes: 81 additions & 0 deletions resources/views/data_pokok/data_presisi/laporan/cetak.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
@extends('layouts.cetak.index')

@section('title', $title)

@push('css')
<style nonce="{{ csp_nonce() }}" type="text/css" media="print">
@page {
size: landscape;
}
</style>
@endpush

@section('content')
@include('partials.breadcrumbs')
<table class="border thick" id="tabel-laporan">
<thead>
<tr class="border thick">
<th>No</th>
<th>Desa</th>
<th>Pangan</th>
<th>Sandang</th>
<th>Papan</th>
<th>Pendidikan</th>
<th>Seni Budaya</th>
<th>Kesehatan</th>
<th>Keagamaan</th>
<th>Jaminan Sosial</th>
<th>Adat</th>
<th>Ketenagakerjaan</th>
<th>Jumlah Penduduk</th>
</tr>
</thead>
<tbody></tbody>
</table>
@stop

@push('scripts')
<script nonce="{{ csp_nonce() }}">
document.addEventListener("DOMContentLoaded", function(event) {
var str = `{{ $filter }}`
var filter = str.replace(/&amp;/g, '&')
const header = @include('layouts.components.header_bearer_api_gabungan');
$.ajax({
url: `{{ config('app.databaseGabunganUrl') . '/api/v1/data-presisi/laporan' }}?${filter}`,
headers: header,
method: 'get',
success: function(json) {
var no = 1;
json.data.forEach(function(item) {
var attr = item.attributes;
var row = `
<tr>
<td class="padat">${no}</td>
<td>${attr.desa || 'N/A'}</td>
<td>${attr.pangan || 'N/A'}</td>
<td>${attr.sandang || 'N/A'}</td>
<td>${attr.papan || 'N/A'}</td>
<td>${attr.pendidikan || 'N/A'}</td>
<td>${attr.seni_budaya || 'N/A'}</td>
<td>${attr.kesehatan || 'N/A'}</td>
<td>${attr.keagamaan || 'N/A'}</td>
<td>${attr.jaminan_sosial || 'N/A'}</td>
<td>${attr.adat || 'N/A'}</td>
<td>${attr.ketenagakerjaan || 'N/A'}</td>
<td>${attr.jumlah_penduduk !== undefined ? attr.jumlah_penduduk.toLocaleString('id-ID') : 'N/A'}</td>
</tr>
`;
$('#tabel-laporan tbody').append(row)
no++;
});
// Trigger print after data is loaded
window.print();
},
error: function(xhr, status, error) {
console.error('Error loading data:', error);
alert('Gagal memuat data. Silakan coba lagi.');
}
})
});
</script>
@endpush
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@extends('layouts.cetak.index')

@section('title', $title)

@push('css')
<style nonce="{{ csp_nonce() }}" type="text/css" media="print">
@page {
size: landscape;
}
</style>
@endpush

@section('content')
@include('partials.breadcrumbs')
{{-- @dd($filter) --}}
<div style="margin-bottom: 15px;">
<h3 style="margin: 0; font-weight: bold;">Desa: {{ $namaDesa }}</h3>
</div>
<table class="border thick" id="tabel-laporan-perdesa">
<thead>
<tr class="border thick">
<th>No</th>
<th>Uraian</th>
<th>Data Lengkap</th>
<th>Lengkap Sebagian</th>
<th>Tidak Lengkap</th>
<th>Total Data</th>
</tr>
</thead>
<tbody></tbody>
</table>
@stop

@push('scripts')
<script nonce="{{ csp_nonce() }}">
document.addEventListener("DOMContentLoaded", function(event) {
var str = `{{ $filter }}`
var filter = str.replace(/&amp;/g, '&')
const header = @include('layouts.components.header_bearer_api_gabungan');
$.ajax({
url: `{{ config('app.databaseGabunganUrl') . '/api/v1/data-presisi/laporan-perdesa' }}?${filter}`,
headers: header,
method: 'get',
success: function(json) {
var no = 1;
json.data.forEach(function(item) {
var attr = item.attributes;
var row = `
<tr>
<td class=\"padat\">${no}</td>
<td>${attr.uraian || 'N/A'}</td>
<td>${attr.lengkap !== undefined ? attr.lengkap.toLocaleString('id-ID') : '0'}</td>
<td>${attr.sebagian !== undefined ? attr.sebagian.toLocaleString('id-ID') : '0'}</td>
<td>${attr.tidak_lengkap !== undefined ? attr.tidak_lengkap.toLocaleString('id-ID') : '0'}</td>
<td>${attr.total !== undefined ? attr.total.toLocaleString('id-ID') : '0'}</td>
</tr>
`;
$('#tabel-laporan-perdesa tbody').append(row)
no++;
});
// Trigger print after data is loaded
window.print();
},
error: function(xhr, status, error) {
console.error('Error loading data:', error);
alert('Gagal memuat data. Silakan coba lagi.');
}
})
});
</script>
@endpush
91 changes: 91 additions & 0 deletions resources/views/data_pokok/data_presisi/laporan/chart.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<script nonce="{{ csp_nonce() }}" >
function grafikPie() {
data = [];
$('#barChart').remove();
$('#donutChart').remove();
$('#grafik').append(
'<canvas id="barChart"></canvas>'
);
$('#pie').append(
'<canvas id="donutChart"></canvas>'
);
// Data untuk bar chart
tampilChart('bar', 'barChart', generateChartData(data_grafik, 'jenis_lahan'));
}
function tampilChart(type, canvasId, chartData, chartOptions = {}) {
var chartCanvas = $(`#${canvasId}`).get(0).getContext('2d');
// Konfigurasi opsi default untuk chart
var defaultOptions = {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: true,
position: 'top',
},
tooltip: {
enabled: true,
},
},
};
// Gabungkan opsi default dengan opsi spesifik yang diberikan
var options = { ...defaultOptions, ...chartOptions };
// Membuat chart baru
new Chart(chartCanvas, {
type: type, // Tipe chart (bar, doughnut, dll.)
data: {
labels: chartData.labels, // Menggunakan labels dari data
datasets: chartData.datasets, // Menggunakan datasets dari data
},
options: options,
});
}
function generateChartData(data, key, label = 'Jenis Lahan') {
var labelCounts = {}; // Objek untuk menghitung jumlah label unik
var labels = [];
var counts = [];
var backgroundColors = [];
// Hitung jumlah label unik berdasarkan kunci yang diberikan
data.forEach(function (item) {
var value = item[key]; // Ambil nilai berdasarkan kunci
if (!labelCounts[value]) {
labelCounts[value] = 0;
}
labelCounts[value]++;
});
// Buat data untuk chart
Object.keys(labelCounts).forEach(function (label) {
let color = randColorRGB();
labels.push(label); // Tambahkan label
counts.push(labelCounts[label]); // Tambahkan jumlah
backgroundColors.push(color); // Tambahkan warna
});
// Struktur data chart
return {
labels: labels,
datasets: [
{
label: label,
data: counts,
backgroundColor: backgroundColors,
},
],
};
}
</script>
@push('css')
<style nonce="{{ csp_nonce() }}" >
#barChart {
min-height: 250px;
height: 250px;
max-height: 250px;
max-width: 100%;
}
#donutChart {
min-height: 250px;
height: 250px;
max-height: 250px;
max-width: 100%;
}
</style>
@endpush
Loading
Loading