diff --git a/Controllers/DataPendampingRwController.cs b/Controllers/DataPendampingRwController.cs index 46e74ed..ec02beb 100644 --- a/Controllers/DataPendampingRwController.cs +++ b/Controllers/DataPendampingRwController.cs @@ -11,6 +11,38 @@ namespace BpsRwApp.Controllers return View(); } + [HttpGet] + public IActionResult DetailPendamping(string nama, string rw) + { + if (string.IsNullOrEmpty(nama) || string.IsNullOrEmpty(rw)) + return RedirectToAction("Index"); + + ViewBag.Nama = nama; + ViewBag.RW = rw; + return View(); + } + + [HttpGet] + public IActionResult TableDetailPendamping(string rw) + { + var data = Enumerable.Range(1, 10) + .Select(i => new + { + id = i, + tanggal = "2025-09-22", + rw = rw ?? "04", + kelurahan = "Tomang", + mudah_terurai = "17/4", + materi_daur = "17/4", + b3 = "17/4", + residu_jumlah = "17/4", + photo = 0 + }) + .ToList(); + + return Json(new { data }); + } + [HttpGet] public IActionResult TableRapot() { @@ -54,13 +86,16 @@ namespace BpsRwApp.Controllers rumahAktif = 0; } + var rw = (index % 10 + 1).ToString("D2"); + var detailUrl = $"/DataPendampingRw/DetailPendamping?nama={System.Web.HttpUtility.UrlEncode(nama)}&rw={rw}"; + return new { nama, checklist = BuildMetricBadge(checklistCount, 10, 15), foto = BuildFotoIndicator(fotoCount), rumah_aktif_memilah = BuildRatioBadge(rumahAktif, targetRumah), - aksi = BuildDetailAction(), + aksi = BuildDetailAction(detailUrl), }; }) .ToArray(); @@ -143,9 +178,9 @@ namespace BpsRwApp.Controllers return $"
@nama
+| + | Tanggal | +RW | +Kelurahan | +Mudah Terurai (Jumlah/Berat) |
+ Materi Daur (Jumlah/Berat) |
+ B3 (Jumlah/Berat) |
+
|---|