From 9b5e2b5eebe8e3fdceb026bbd78670fc53372025 Mon Sep 17 00:00:00 2001 From: Firliani Fauziah Date: Wed, 30 Oct 2024 13:17:56 +0700 Subject: [PATCH] statistik penduduk berdasarkan pengaturan menu --- app/Helpers/general.php | 6 +- .../Controllers/Web/PresisiController.php | 14 +- .../views/presisi/kependudukan/head.blade.php | 34 ++ .../presisi/kependudukan/index.blade.php | 349 ++---------------- .../views/presisi/kependudukan/js.blade.php | 259 +++++++++++++ .../presisi/kependudukan/kategori.blade.php | 15 + routes/web.php | 4 + 7 files changed, 362 insertions(+), 319 deletions(-) create mode 100644 resources/views/presisi/kependudukan/head.blade.php create mode 100644 resources/views/presisi/kependudukan/js.blade.php create mode 100644 resources/views/presisi/kependudukan/kategori.blade.php diff --git a/app/Helpers/general.php b/app/Helpers/general.php index 8d5e2829..1b4231c4 100644 --- a/app/Helpers/general.php +++ b/app/Helpers/general.php @@ -293,7 +293,11 @@ function generateMenuPresisi($tree, $parentId = null) if ($parentId) { $result .= "{$icon}{$item->text}"; } else { - $result .= "{$icon}{$item->text}"; + $href = $item->href; + if($href != '/presisi'){ + $href = str_contains($item->href, 'module') ? $item->href : '/'.$item->href; + } + $result .= "{$icon}{$item->text}"; } } } diff --git a/app/Http/Controllers/Web/PresisiController.php b/app/Http/Controllers/Web/PresisiController.php index 7841af75..a03dee06 100644 --- a/app/Http/Controllers/Web/PresisiController.php +++ b/app/Http/Controllers/Web/PresisiController.php @@ -35,11 +35,21 @@ public function index() return view('presisi.index', compact('categoriesItems', 'listKecamatan', 'listDesa')); } - public function kependudukan() + public function kependudukan($id = "") { + $totalDesa = 0; + $pendudukSummary = 0; + $configSummary = 0; + $keluargaSummary = 0; + $categoriesItems = [ + ['key' => 'kecamatan', 'text' => 'kecamatan', 'value' => $configSummary, 'icon' => 'web/img/kecamatan.jpg'], + ['key' => 'desa', 'text' => 'desa/kelurahan', 'value' => $totalDesa, 'icon' => 'web/img/kelurahan.jpg'], + ['key' => 'penduduk', 'text' => 'jumlah penduduk', 'value' => $pendudukSummary, 'icon' => 'web/img/penduduk.jpg'], + ['key' => 'keluarga', 'text' => 'jumlah keluarga', 'value' => $keluargaSummary, 'icon' => 'web/img/bantuan.jpg'], + ]; $statistik = Penduduk::KATEGORI_STATISTIK; - return view('presisi.kependudukan.index', compact('statistik')); + return view('presisi.kependudukan.index', compact('statistik', 'id', 'categoriesItems')); } public function kesehatan($kuartal = null, $tahun = null, $id = null) diff --git a/resources/views/presisi/kependudukan/head.blade.php b/resources/views/presisi/kependudukan/head.blade.php new file mode 100644 index 00000000..af55fbf4 --- /dev/null +++ b/resources/views/presisi/kependudukan/head.blade.php @@ -0,0 +1,34 @@ +
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
\ No newline at end of file diff --git a/resources/views/presisi/kependudukan/index.blade.php b/resources/views/presisi/kependudukan/index.blade.php index 395cece3..6d40eac1 100644 --- a/resources/views/presisi/kependudukan/index.blade.php +++ b/resources/views/presisi/kependudukan/index.blade.php @@ -7,70 +7,32 @@ @include('presisi.partials.head')
+
+ +
+ @include('presisi.summary') +
+
+
-
+
-
+ + @include('presisi.kependudukan.kategori') - - -
-
-
+
-
-
- -
- -
-
- -
-
- -
-
- - -
+ +
@@ -103,20 +65,32 @@
-