From a1abb3fd2d404e2e5ea75c8b34e59243c944b479 Mon Sep 17 00:00:00 2001 From: rahmagustin Date: Sat, 31 Jan 2026 13:58:11 +0700 Subject: [PATCH] 31 jan 26 --- app/Http/Controllers/SigController.php | 8 + app/Models/LokasiTps.php | 1 + ...1646_add_kecamatan_to_lokasi_tps_table.php | 21 + resources/views/admin/tps/create.blade.php | 8 +- resources/views/admin/tps/edit.blade.php | 8 +- resources/views/user/index.blade.php | 47 +-- resources/views/user/sig-tps.blade.php | 381 ++++++++++-------- 7 files changed, 276 insertions(+), 198 deletions(-) create mode 100644 database/migrations/2026_01_30_151646_add_kecamatan_to_lokasi_tps_table.php diff --git a/app/Http/Controllers/SigController.php b/app/Http/Controllers/SigController.php index 883f459..82f7ad9 100644 --- a/app/Http/Controllers/SigController.php +++ b/app/Http/Controllers/SigController.php @@ -17,6 +17,7 @@ public function index() 'id_tps', 'nama_tps', 'alamat_tps', + 'kecamatan', 'status_tps', 'latitude', 'longitude', @@ -24,6 +25,13 @@ public function index() 'kategori_tps_id' )->get(); + $kecamatanList = LokasiTps::select('kecamatan') + ->distinct() + ->orderBy('kecamatan') + ->pluck('kecamatan'); + + return view('user.sig-tps', compact('tps', 'kecamatanList')); + return view('user.sig-tps', compact('tps')); } diff --git a/app/Models/LokasiTps.php b/app/Models/LokasiTps.php index 920220e..78db477 100644 --- a/app/Models/LokasiTps.php +++ b/app/Models/LokasiTps.php @@ -19,6 +19,7 @@ class LokasiTps extends Model 'kategori_tps_id', 'nama_tps', 'alamat_tps', + 'kecamatan', 'status_tps', 'tahun_pembuatan', 'kapasitas_tps', diff --git a/database/migrations/2026_01_30_151646_add_kecamatan_to_lokasi_tps_table.php b/database/migrations/2026_01_30_151646_add_kecamatan_to_lokasi_tps_table.php new file mode 100644 index 0000000..a84b58a --- /dev/null +++ b/database/migrations/2026_01_30_151646_add_kecamatan_to_lokasi_tps_table.php @@ -0,0 +1,21 @@ +string('kecamatan')->after('alamat_tps'); + }); + } + + public function down(): void + { + Schema::table('lokasi_tps', function (Blueprint $table) { + $table->dropColumn('kecamatan'); + }); + } +}; diff --git a/resources/views/admin/tps/create.blade.php b/resources/views/admin/tps/create.blade.php index eb46b53..027031a 100644 --- a/resources/views/admin/tps/create.blade.php +++ b/resources/views/admin/tps/create.blade.php @@ -35,6 +35,12 @@ required> +
+ + +
+
@@ -101,7 +107,7 @@
- + Batal diff --git a/resources/views/admin/tps/edit.blade.php b/resources/views/admin/tps/edit.blade.php index 0e13621..6fe761f 100644 --- a/resources/views/admin/tps/edit.blade.php +++ b/resources/views/admin/tps/edit.blade.php @@ -52,6 +52,12 @@ class="forms-sample"> value="{{ old('alamat_tps', $tps->alamat_tps) }}" required> +
+ + +
+ {{-- Kategori TPS --}}
@@ -138,7 +144,7 @@ class="img-thumbnail">
{{-- Button --}} - diff --git a/resources/views/user/index.blade.php b/resources/views/user/index.blade.php index 214885e..c91da5d 100644 --- a/resources/views/user/index.blade.php +++ b/resources/views/user/index.blade.php @@ -4,7 +4,7 @@
-
+

Selamat Datang di SIG TPS

Sistem Informasi Geografis Pemetaan Tempat Pembuangan Sampah di Kabupaten Nganjuk

@@ -20,7 +20,7 @@
-
+

Timbulan Sampah

Data berikut menunjukkan total timbulan, pengelolaan, daur ulang, dan sisa sampah dalam ton per hari.

@@ -30,7 +30,7 @@
-
+
@@ -43,7 +43,7 @@
-
+
@@ -56,7 +56,7 @@
-
+
@@ -69,7 +69,7 @@
-
+
@@ -118,21 +118,21 @@

Sistem Informasi Geografis yang menampilkan visualisasi lokasi Tempat Pembuangan Sampah di Kabupaten Nganjuk secara mudah, cepat, dan interaktif.

-
+

Peta Interaktif Lokasi TPS

Peta digital yang memudahkan pengguna menemukan lokasi TPS terdekat, lengkap dengan tampilan yang intuitif sehingga informasi dapat diakses dengan cepat dan jelas.

-
+

Informasi TPS Lengkap

Menyajikan berbagai informasi penting seperti kapasitas, kondisi, status, hingga jenis pengelolaan TPS, sehingga pengguna dapat memahami keadaan TPS secara menyeluruh.

-
+

Layanan Aduan TPS

@@ -189,8 +189,9 @@

- {{ $item->deskripsi }} + {{ explode('.', $item->deskripsi)[0] }}.

+
@@ -208,8 +209,8 @@ - .leaflet-bottom { - bottom: 0px !important; - } - - .legend { - background: white; - padding: 10px 12px; - border-radius: 10px; - line-height: 18px; - color: #333; - box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); - font-size: 14px; - } - - .legend i { - width: 16px; - height: 16px; - float: left; - margin-right: 8px; - opacity: 1; - } - - -
-
-

Sebaran TPS di Kabupaten Nganjuk

- -
-
- -
-
-
-
-
- - + if (nearest) { + nearest.setIcon(iconNear); + nearest.openPopup(); + map.setView(nearest.getLatLng(), 15); + } + }); +}); + @endsection