From 2be275b1fb24c0c789c0d79ac35fae5941f5abad Mon Sep 17 00:00:00 2001 From: rahmagustin Date: Sun, 18 Jan 2026 16:15:01 +0700 Subject: [PATCH] landing page from database --- .../Admin/KategoriTpsController.php | 2 + app/Http/Controllers/IndexController.php | 8 +- app/Models/KategoriTps.php | 1 + ...njangan_kategori_to_kategori_tps_table.php | 24 + .../views/admin/kategori-tps/create.blade.php | 5 + .../views/admin/kategori-tps/edit.blade.php | 6 + resources/views/user/index.blade.php | 621 +++++++++--------- 7 files changed, 362 insertions(+), 305 deletions(-) create mode 100644 database/migrations/2026_01_18_082749_add_kepanjangan_kategori_to_kategori_tps_table.php diff --git a/app/Http/Controllers/Admin/KategoriTpsController.php b/app/Http/Controllers/Admin/KategoriTpsController.php index fea4b84..73cf222 100644 --- a/app/Http/Controllers/Admin/KategoriTpsController.php +++ b/app/Http/Controllers/Admin/KategoriTpsController.php @@ -27,6 +27,7 @@ public function store(Request $request) { $data = $request->validate([ 'nama_kategori' => 'required|string|max:100', + 'kepanjangan_kategori' => 'nullable|string|max:255', 'deskripsi' => 'nullable|string', 'foto_kategori' => 'nullable|image|mimes:jpg,jpeg,png|max:2048' ]); @@ -57,6 +58,7 @@ public function update(Request $request, $id) $data = $request->validate([ 'nama_kategori' => 'required|string|max:100', + 'kepanjangan_kategori' => 'nullable|string|max:255', 'deskripsi' => 'nullable|string', 'foto_kategori' => 'nullable|image|mimes:jpg,jpeg,png|max:2048' ]); diff --git a/app/Http/Controllers/IndexController.php b/app/Http/Controllers/IndexController.php index 2e96a1a..6faaa55 100644 --- a/app/Http/Controllers/IndexController.php +++ b/app/Http/Controllers/IndexController.php @@ -2,13 +2,17 @@ namespace App\Http\Controllers; +use App\Models\Sampah; +use App\Models\KategoriTps; use Illuminate\Http\Request; class IndexController extends Controller { public function index() { - $title = 'User Home'; - return view('user.index', compact('title')); + $sampah = Sampah::orderBy('tahun', 'desc')->first(); + $kategoriTps = KategoriTps::orderBy('id_kategori_tps')->get(); + + return view('user.index', compact('sampah', 'kategoriTps')); } } diff --git a/app/Models/KategoriTps.php b/app/Models/KategoriTps.php index ecbf4aa..aff5e90 100644 --- a/app/Models/KategoriTps.php +++ b/app/Models/KategoriTps.php @@ -11,6 +11,7 @@ class KategoriTps extends Model protected $fillable = [ 'nama_kategori', + 'kepanjangan_kategori', 'deskripsi', 'foto_kategori' ]; diff --git a/database/migrations/2026_01_18_082749_add_kepanjangan_kategori_to_kategori_tps_table.php b/database/migrations/2026_01_18_082749_add_kepanjangan_kategori_to_kategori_tps_table.php new file mode 100644 index 0000000..a38cbac --- /dev/null +++ b/database/migrations/2026_01_18_082749_add_kepanjangan_kategori_to_kategori_tps_table.php @@ -0,0 +1,24 @@ +string('kepanjangan_kategori', 255) + ->after('nama_kategori') + ->nullable(); + }); + } + + public function down(): void + { + Schema::table('kategori_tps', function (Blueprint $table) { + $table->dropColumn('kepanjangan_kategori'); + }); + } +}; diff --git a/resources/views/admin/kategori-tps/create.blade.php b/resources/views/admin/kategori-tps/create.blade.php index ba0d2e5..8b54524 100644 --- a/resources/views/admin/kategori-tps/create.blade.php +++ b/resources/views/admin/kategori-tps/create.blade.php @@ -17,6 +17,11 @@ +
+ + +
+
diff --git a/resources/views/admin/kategori-tps/edit.blade.php b/resources/views/admin/kategori-tps/edit.blade.php index b5e52ce..fb6e8e8 100644 --- a/resources/views/admin/kategori-tps/edit.blade.php +++ b/resources/views/admin/kategori-tps/edit.blade.php @@ -20,6 +20,12 @@ class="form-control" required>
+
+ + +
+
diff --git a/resources/views/user/index.blade.php b/resources/views/user/index.blade.php index bc2dbc8..0b222e9 100644 --- a/resources/views/user/index.blade.php +++ b/resources/views/user/index.blade.php @@ -1,361 +1,376 @@ @extends('user.template') @section('content') + +
- -
- -
-

Selamat Datang di SIG TPS

-

Sistem Informasi Geografis Pemetaan Tempat Pembuangan Sampah di Kabupaten Nganjuk

-
- Lihat Peta - +
+

Selamat Datang di SIG TPS

+

Sistem Informasi Geografis Pemetaan Tempat Pembuangan Sampah di Kabupaten Nganjuk

+
+ Lihat Peta + +
-
-
+
- -
-
- -
- -
-
- -
-
- -
-

Sistem Informasi Geografis Tempat Pembuangan Sampah di Kabupaten Nganjuk

- - -
- -
- -

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

-
-

Fitur yang memungkinkan masyarakat menyampaikan keluhan atau laporan terkait TPS dengan mudah, membantu pemerintah dalam memperbaiki serta meningkatkan pengelolaan sampah.

- -
-
+ - + +
- -
+
-
+
-
+ @foreach ($kategoriTps as $index => $item) +
-
-
-
- -
-
-
- +
+
+ @if ($item->foto_kategori) + {{ $item->nama_kategori }} + @else + Default + @endif +
+ +
+
+ @if ($item->nama_kategori == 'TPS') + + @elseif ($item->nama_kategori == 'TPS 3R') + + @elseif ($item->nama_kategori == 'TPA') + + @else + + @endif +
+ + +

{{ $item->kepanjangan_kategori }}

+
+ +

+ {{ $item->deskripsi }} +

+
- -

Tempat Pembuangan Sampah

-
-

Provident nihil minus qui consequatur non omnis maiores. Eos accusantium minus dolores iure perferendis.

-
-
-
-
-
-
-
-
-
- -
- -

Tempat Pengolahan Sampah Reduce, Reuse, Recycle

-
-

Ut autem aut autem non a. Sint sint sit facilis nam iusto sint. Libero corrupti neque eum hic non ut nesciunt dolorem.

-
-
-
+ @endforeach -
-
-
- -
-
-
- -
- -

Tempat Pembuangan Akhir

-
-

Ut excepturi voluptatem nisi sed. Quidem fuga consequatur. Minus ea aut. Vel qui id voluptas adipisci eos earum corrupti.

-
-
-
+
-
-
+
+ - - - + + + - - -
-
- -
-
-
- -
-
- - + /* Container dibuat flex agar map bisa center */ + #call-to-action .container { + display: flex; + justify-content: center; + padding: 20px 0; + } - -
+ /* Wrapper card map modern */ + .map-wrapper { + width: 100%; + max-width: 1100px; + /* agar map di tengah */ + border-radius: 10px; + overflow: hidden; + box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); + } - -
-

Contact

-

Necessitatibus eius consequatur ex aliquid fuga eum quidem sint consectetur velit

-
+ /* Map full card */ + #mapTPS { + width: 100%; + height: 450px; + } -
+ /* Zoom Button Modern */ + .leaflet-control-zoom { + border-radius: 10px !important; + box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important; + overflow: hidden !important; + } -
+ /* Popup Modern */ + .leaflet-popup-content-wrapper { + border-radius: 14px !important; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); + } + -
+
+
-
-

Get in touch

-

Et id eius voluptates atque nihil voluptatem enim in tempore minima sit ad mollitia commodi minus.

+
+
+
-
- -
-

Location:

-

A108 Adam Street, New York, NY 535022

-
-
+
+
-
- -
-

Email:

-

info@example.com

-
-
+ + + +
+ + +
+

Contact

+

Necessitatibus eius consequatur ex aliquid fuga eum quidem sint consectetur velit

+
+ +
+ +
+ +
+ +
+

Get in touch

+

Et id eius voluptates atque nihil voluptatem enim in tempore minima sit ad mollitia commodi + minus.

+ +
+ +
+

Location:

+

A108 Adam Street, New York, NY 535022

+
+
+ +
+ +
+

Email:

+

info@example.com

+
+
+ +
+ +
+

Call:

+

+1 5589 55488 55

+
+
+ +
-
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
Loading
+
+
Your message has been sent. Thank you!
+
+
+
+
-
-
-
-
- -
-
- -
-
-
- -
-
- -
-
-
Loading
-
-
Your message has been sent. Thank you!
-
-
-
-
+
-
- -
- + @endsection