From cdb744d322caee8e447e1422a2326373bd68f043 Mon Sep 17 00:00:00 2001 From: Ahmad Afandi Date: Wed, 11 Feb 2026 11:00:19 +0700 Subject: [PATCH] Menambahkan detail untuk statistik pangan --- .../DataPresisiPanganController.php | 11 + .../Controllers/StatistikPanganController.php | 2 +- .../views/components/filter-tahun.blade.php | 3 +- .../data_presisi/pangan/detail_data.blade.php | 218 +++++ .../data_presisi/pangan/index.blade.php | 2 +- .../views/presisi/statistik/pangan.blade.php | 772 +++++++++--------- .../presisi/statistik/senibudaya.blade.php | 2 +- routes/web.php | 1 + 8 files changed, 620 insertions(+), 391 deletions(-) create mode 100644 resources/views/data_pokok/data_presisi/pangan/detail_data.blade.php diff --git a/app/Http/Controllers/DataPresisiPanganController.php b/app/Http/Controllers/DataPresisiPanganController.php index e614e8a50..0f4f10b7f 100644 --- a/app/Http/Controllers/DataPresisiPanganController.php +++ b/app/Http/Controllers/DataPresisiPanganController.php @@ -13,6 +13,17 @@ public function index() return view('data_pokok.data_presisi.pangan.index', compact('title')); } + public function detailData() + { + $colomn = ''; + $title = 'Data Presisi Pangan '.request('judul'); + $filter = request('filter'); + if($filter['tipe'] && $filter['nilai']){ + $colomn = $filter['tipe'].':'.$filter['nilai']; + } + return view('data_pokok.data_presisi.pangan.detail_data', compact('title', 'colomn')); + } + public function detail(Request $request) { $data = json_decode($request->data); diff --git a/app/Http/Controllers/StatistikPanganController.php b/app/Http/Controllers/StatistikPanganController.php index 46228e038..51d40ec33 100644 --- a/app/Http/Controllers/StatistikPanganController.php +++ b/app/Http/Controllers/StatistikPanganController.php @@ -7,7 +7,7 @@ class StatistikPanganController extends Controller public function index() { return view('presisi.statistik.pangan', [ - 'detailLink' => url(''), + 'detailLink' => url('data-presisi/pangan/detail_data'), 'judul' => 'Pangan' ]); } diff --git a/resources/views/components/filter-tahun.blade.php b/resources/views/components/filter-tahun.blade.php index f23a189ce..37fe32661 100644 --- a/resources/views/components/filter-tahun.blade.php +++ b/resources/views/components/filter-tahun.blade.php @@ -3,10 +3,11 @@ @php $currentYear = date('Y'); $startYear = $currentYear - 5; + $selectedYear = $selectedYear ?? $currentYear; @endphp @for($year = $currentYear; $year >= $startYear; $year--) - + @endfor \ No newline at end of file diff --git a/resources/views/data_pokok/data_presisi/pangan/detail_data.blade.php b/resources/views/data_pokok/data_presisi/pangan/detail_data.blade.php new file mode 100644 index 000000000..e4c071193 --- /dev/null +++ b/resources/views/data_pokok/data_presisi/pangan/detail_data.blade.php @@ -0,0 +1,218 @@ +@extends('layouts.index') + +@section('title', $title) + +@section('content_header') +

{{ $title }}

+@stop + +@section('content') +@include('partials.breadcrumbs') + +
+
+
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NONIKNOMOR KKNAMAJENIS LAHANLUAS LAHANLUAS TANAMSTATUS LAHANKOMODITI UTAMA TANAMAN PANGANKOMODITI TANAMAN PANGAN LAINNYAJUMLAH BERDASARKAN JENIS KOMODITIUSIA KOMODITIJENIS PETERNAKANJUMLAH POPULASIJENIS PERIKANANFREKWENSI MAKANAN PERHARIFREKWENSI KONSUMSI SAYUR PERHARIFREKWENSI KONSUMSI BUAH PERHARIFREKWENSI KONSUMSI DAGING PERHARILONGITUDELATITUDETANGGAL PENGISIANSTATUS PENGISIAN
+
+
+
+
+
+@endsection + +@section('js') + +@endsection \ No newline at end of file diff --git a/resources/views/data_pokok/data_presisi/pangan/index.blade.php b/resources/views/data_pokok/data_presisi/pangan/index.blade.php index 4b799bfea..fcf1b08ba 100644 --- a/resources/views/data_pokok/data_presisi/pangan/index.blade.php +++ b/resources/views/data_pokok/data_presisi/pangan/index.blade.php @@ -28,7 +28,7 @@
- +
diff --git a/resources/views/presisi/statistik/pangan.blade.php b/resources/views/presisi/statistik/pangan.blade.php index db8c577e8..0f604936a 100644 --- a/resources/views/presisi/statistik/pangan.blade.php +++ b/resources/views/presisi/statistik/pangan.blade.php @@ -5,463 +5,461 @@ @section('title', 'Data Statistik') @section('content_header') -

Data Statistik {{ $judul }}

+

Data Statistik {{ $judul }}

@stop @section('content') - @include('partials.breadcrumbs') -
-
-
-
-

Statistik {{ $judul }}

-
- -
-
-
- +@include('partials.breadcrumbs') +
+
+
+
+

Statistik {{ $judul }}

+
+
+
+ +
-
-
-
-
-

+
+
+
+
+
+

+
+
+ +
+
-
-
- - - -
- -
- -
-
- -
-
- -
+
+ +
+
+
-
-
-
-
-
- -
-
+
+
+
+
+
+
+
+
+
-
-
- -
-
+
+
+
+
+
-
- - - - - - - - - -
NoNilaiJumlah
-
+
+ + + + + + + + + +
NoNilaiJumlah
+
@endsection @section('js') - - @include('statistik.chart') - +@include('statistik.chart') + -@endsection -@push('css') - -@endpush + // Event listener for year filter change + $('#filter-tahun').on('change', function() { + statistik.ajax.reload(); + }); + $(document).on('click', '#reset', function(e) { + e.preventDefault(); + statistik.ajax.reload(); + }); + }); + +@endsection +@push('css') + +@endpush \ No newline at end of file diff --git a/resources/views/presisi/statistik/senibudaya.blade.php b/resources/views/presisi/statistik/senibudaya.blade.php index 50e0e0f57..44506d8ae 100644 --- a/resources/views/presisi/statistik/senibudaya.blade.php +++ b/resources/views/presisi/statistik/senibudaya.blade.php @@ -389,7 +389,7 @@ className: 'dt-body-right', urlDetail.searchParams.set('nama', nilai); urlDetail.searchParams.set('tipe', $('.pilih-kategori > a.active').text().trim()); urlDetail.searchParams.set('chart-view', true); - + return `${nilai}` } diff --git a/routes/web.php b/routes/web.php index 788511842..013484a95 100644 --- a/routes/web.php +++ b/routes/web.php @@ -316,6 +316,7 @@ Route::prefix('pangan')->group(function () { Route::get('/', [App\Http\Controllers\DataPresisiPanganController::class, 'index'])->name('data-pokok.data-presisi-pangan.index'); Route::get('/detail', [App\Http\Controllers\DataPresisiPanganController::class, 'detail'])->name('data-pokok.data-presisi-pangan.detail'); + Route::get('detail_data', [App\Http\Controllers\DataPresisiPanganController::class, 'detailData'])->name('data-pokok.data-presisi-pangan.detail_data'); Route::get('cetak', [App\Http\Controllers\DataPresisiPanganController::class, 'cetak'])->name('data-pokok.data-presisi-pangan.cetak'); }) ->middleware(['permission:datapresisi-pangan-read']);