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
5 changes: 5 additions & 0 deletions app/Http/Controllers/DataPokokController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public function pendidikan()
return view('data_pokok.pendidikan.index');
}

public function cetakPendidikan(Request $request)
{
return view('data_pokok.pendidikan.cetak', ['filter' => $request->getQueryString()]);
}

public function ketenagakerjaan()
{
$title = 'Data Pekerjaan dan Pelatihan';
Expand Down
2 changes: 2 additions & 0 deletions catatan_rilis.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Di rilis ini, versi 2508.0.0 berisi penambahan dan perbaikan yang diminta penggu
5. [#796](https://github.com/OpenSID/OpenKab/issues/796) Penambahan kolom nama desa pada halaman menu bantuan OpenKab.
6. [#799](https://github.com/OpenSID/OpenKab/issues/799) Penambahan kolom nama desa pada beberapa halaman kesehatan di OpenKab.
7. [#797](https://github.com/OpenSID/OpenKab/issues/797) Penambahan kolom nama desa pada halaman ketenagakerjaan di OpenKab.
8. [#798](https://github.com/OpenSID/OpenKab/issues/798) Penambahan kolom nama desa pada beberapa halaman pendidikan di OpenKab.
9. [#798](https://github.com/OpenSID/OpenKab/issues/798) Penambahan kolom nama desa pada beberapa halaman pendidikan di OpenKab.


#### Perbaikan BUG
Expand Down
74 changes: 74 additions & 0 deletions resources/views/data_pokok/pendidikan/cetak.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
@extends('layouts.cetak.index')

@section('title', 'Data Pendidikan')

@section('content')
@include('partials.breadcrumbs')
<div x-data="{
data: {},
async retrievePosts() {
try {
const headers = @include('layouts.components.header_bearer_api_gabungan');
var create_url = new URL({{ json_encode(config('app.databaseGabunganUrl')) }} + '/api/v1/pendidikan');

// Get current URL parameters and add them to create_url
const currentUrl = new URL(window.location.href);
const urlParams = currentUrl.searchParams;

// Add all search parameters from current URL
for (const [key, value] of urlParams.entries()) {
if (value && value !== '' && value !== 'null') {
create_url.searchParams.set(key, value);
}
}

const response = await fetch(create_url.href, {
method: 'GET',
headers: headers
});

if (!response.ok) throw new Error('Gagal mengambil data');

const result = await response.json();
this.data = result.data;

await $nextTick();
window.print();
} catch (error) {
console.error('Terjadi kesalahan:', error);
alert('Terjadi kesalahan saat mengambil data.');
}
}
}" x-init="retrievePosts">
<table class="border thick" id="tabel-penduduk">
<thead>
<tr class="border thick">
<th class="padat">No</th>
<th class="padat">Nama {{ config('app.sebutanDesa') }}</th>
<th class="padat">NIK</th>
<th class="padat">Pendidikan<br> dalam KK</th>
<th class="padat">Pendidikan<br>Sedang Ditempuh</th>
<th class="padat">Partisipasi Sekolah</th>
<th class="padat">Jenjang<br> dan Jenis<br>Pendidikan Tertinggi</th>
<th class="padat">Kelas Tertinggi</th>
<th class="padat">Ijazah Tertinggi</th>
</tr>
</thead>
<tbody>
<template x-for="(value, index) in data">
<tr>
<td class="padat" x-text="index+1"></td>
<td x-text="value.attributes.nama_desa"></td>
<td x-text="value.attributes.nik"></td>
<td x-text="value.attributes.pendidikan_kk_id"></td>
<td x-text="value.attributes.pendidikan_sedang_id"></td>
<td x-text="value.attributes.partisipasi_sekolah"></td>
<td x-text="value.attributes.pendidikan_tertinggi"></td>
<td x-text="value.attributes.kelas_tertinggi"></td>
<td x-text="value.attributes.ijazah_tertinggi"></td>
</tr>
</template>
</tbody>
</table>
</div>
@stop
203 changes: 107 additions & 96 deletions resources/views/data_pokok/pendidikan/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,21 @@
<div class="col-lg-12">
<div class="card card-outline card-primary">
<div class="card-header">
<div class="float-left">Data Pendidikan Penduduk dan DTKS</div>
<div>Data Pendidikan Penduduk dan DTKS</div>
<div class="row">
<div class="col-sm-3">
<x-print-button :print-url="url('data-pokok/pendidikan/cetak')" table-id="pendidikan" :filter="[]" />
<x-excel-download-button :download-url="config('app.databaseGabunganUrl') . '/api/v1/pendidikan/download'" table-id="pendidikan" filename="data_pendidikan" />
</div>
</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped" id="pendidikan">
<thead>
<tr>
<th>No</th>
<th>Nama {{ config('app.sebutanDesa') }}</th>
<th>NIK</th>
<th>Pendidikan dalam KK</th>
<th>Pendidikan Sedang Ditempuh</th>
Expand All @@ -70,106 +77,110 @@

@section('js')
@include('data_pokok.pendidikan.chart')
<script nonce="{{ csp_nonce() }}" >
<script nonce="{{ csp_nonce() }}">
let data_grafik = [];
document.addEventListener("DOMContentLoaded", function(event) {
document.addEventListener("DOMContentLoaded", function(event) {

const header = @include('layouts.components.header_bearer_api_gabungan');
var url = new URL("{{ config('app.databaseGabunganUrl').'/api/v1/pendidikan' }}");
url.searchParams.set("kode_kabupaten", "{{ session('kabupaten.kode_kabupaten') ?? '' }}");
url.searchParams.set("kode_kecamatan", "{{ session('kecamatan.kode_kecamatan') ?? '' }}");
url.searchParams.set("config_desa", "{{ session('desa.id') ?? '' }}");
const header = @include('layouts.components.header_bearer_api_gabungan');
var url = new URL("{{ config('app.databaseGabunganUrl') . '/api/v1/pendidikan' }}");
url.searchParams.set("kode_kabupaten", "{{ session('kabupaten.kode_kabupaten') ?? '' }}");
url.searchParams.set("kode_kecamatan", "{{ session('kecamatan.kode_kecamatan') ?? '' }}");
url.searchParams.set("config_desa", "{{ session('desa.id') ?? '' }}");

var pendidikan = $('#pendidikan').DataTable({
processing: true,
serverSide: true,
autoWidth: false,
ordering: false,
searchPanes: {
viewTotal: false,
columns: [0]
},
ajax: {
url: url.href,
headers: header,
method: 'get',
data: function(row) {
return {
"page[size]": row.length,
"page[number]": (row.start / row.length) + 1,
"filter[search]": row.search.value,
"filter[kode_desa]": $("#kode_desa").val(),
};
},
dataSrc: function(json) {

if (json.data.length > 0) {
json.recordsTotal = json.meta.pagination.total
json.recordsFiltered = json.meta.pagination.total
data_grafik = [];
json.data.forEach(function(item, index) {
data_grafik.push(item.attributes)
})
grafikPie()
return json.data;
}
return false;
var pendidikan = $('#pendidikan').DataTable({
processing: true,
serverSide: true,
autoWidth: false,
ordering: false,
searchPanes: {
viewTotal: false,
columns: [0]
},
},
columnDefs: [{
targets: '_all',
className: 'text-nowrap',
ajax: {
url: url.href,
headers: header,
method: 'get',
data: function(row) {
return {
"page[size]": row.length,
"page[number]": (row.start / row.length) + 1,
"filter[search]": row.search.value,
"filter[kode_desa]": $("#kode_desa").val(),
};
},
dataSrc: function(json) {

if (json.data.length > 0) {
json.recordsTotal = json.meta.pagination.total
json.recordsFiltered = json.meta.pagination.total
data_grafik = [];
json.data.forEach(function(item, index) {
data_grafik.push(item.attributes)
})
grafikPie()
return json.data;
}
return false;
},
],
columns: [{
data: null,
orderable: false
},
{
data: "attributes.nik",
name: "nik",
orderable: false
},
{
data: "attributes.pendidikan_kk_id",
name: "pendidikan_kk_id",
orderable: false
},
{
data: "attributes.pendidikan_sedang_id",
name: "pendidikan_sedang_id",
orderable: false
},
{
data: "attributes.partisipasi_sekolah",
name: "partisipasi_sekolah",
orderable: false
},
{
data: "attributes.pendidikan_tertinggi",
name: "pendidikan_tertinggi",
orderable: false
},
{
data: "attributes.kelas_tertinggi",
name: "kelas_tertinggi",
orderable: false
},
{
data: "attributes.ijazah_tertinggi",
name: "ijazah_tertinggi",
orderable: false
},
]
})
pendidikan.on('draw.dt', function() {
var PageInfo = $('#pendidikan').DataTable().page.info();
pendidikan.column(0, {
page: 'current'
}).nodes().each(function(cell, i) {
cell.innerHTML = i + 1 + PageInfo.start;
columnDefs: [{
targets: '_all',
className: 'text-nowrap',
}, ],
columns: [{
data: null,
orderable: false
},
{
data: "attributes.nama_desa",
name: "nama_desa",
orderable: false
},
{
data: "attributes.nik",
name: "nik",
orderable: false
},
{
data: "attributes.pendidikan_kk_id",
name: "pendidikan_kk_id",
orderable: false
},
{
data: "attributes.pendidikan_sedang_id",
name: "pendidikan_sedang_id",
orderable: false
},
{
data: "attributes.partisipasi_sekolah",
name: "partisipasi_sekolah",
orderable: false
},
{
data: "attributes.pendidikan_tertinggi",
name: "pendidikan_tertinggi",
orderable: false
},
{
data: "attributes.kelas_tertinggi",
name: "kelas_tertinggi",
orderable: false
},
{
data: "attributes.ijazah_tertinggi",
name: "ijazah_tertinggi",
orderable: false
},
]
})
pendidikan.on('draw.dt', function() {
var PageInfo = $('#pendidikan').DataTable().page.info();
pendidikan.column(0, {
page: 'current'
}).nodes().each(function(cell, i) {
cell.innerHTML = i + 1 + PageInfo.start;
});
});
});
})
})
</script>
@endsection
@endsection
1 change: 1 addition & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
Route::middleware(['permission:datapokok-ketenagakerjaan-read'])->get('/ketenagakerjaan/cetak', 'cetakKetenagakerjaan');

Route::middleware(['permission:datapokok-pendidikan-read'])->get('/pendidikan', 'pendidikan')->name('pendidikan');
Route::middleware(['permission:datapokok-pendidikan-read'])->get('/pendidikan/cetak', 'cetakPendidikan')->name('pendidikan.cetak');
Route::middleware(['permission:datapokok-pariwisata-read'])->get('/pariwisata', 'pariwisata')->name('pariwisata');
Route::middleware(['permission:datapokok-jaminan-sosial-read'])->get('/jaminan-sosial', 'jaminanSosial')->name('jaminan-sosial');
Route::middleware(['permission:datapokok-jaminan-sosial-read'])->get('/jaminan-sosial/detail', 'detailJaminanSosial')->name('jaminan-sosial-detail');
Expand Down