diff --git a/Controllers/RumahRwController.cs b/Controllers/RumahRwController.cs new file mode 100644 index 0000000..61cb132 --- /dev/null +++ b/Controllers/RumahRwController.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Mvc; + +namespace BpsRwApp.Controllers +{ + [Route("[controller]/[action]")] + public class DataRumahRwController : AppControllerBase + { + public IActionResult Index() + { + return View(); + } + + [HttpGet] + public IActionResult Table() + { + var data = Enumerable.Range(0, 100) + .Select(index => + { + var wilayah = ControllerSampleData.WilayahSeeds[index % ControllerSampleData.WilayahSeeds.Length]; + var street = ControllerSampleData.StreetNames[(index + 2) % ControllerSampleData.StreetNames.Length]; + var pemilik = ControllerSampleData.PersonNames[(index + 5) % ControllerSampleData.PersonNames.Length]; + + var status = index % 4 == 0 ? "Tidak Aktif" : "Aktif"; + var checklist = index % 3 == 0 ? "Tidak" : "Ya"; + + return new + { + rt = ((index % 16) + 1).ToString("D3"), + rw = ((index / 4) + 1).ToString("D3"), + alamat = $"{street} No. {index + 1}", + kota = wilayah.Kota, + nama_pemilik = pemilik, + status = status, + checklist = checklist, + aksi = $@" +
+ + + {(status == "Aktif" + ? "" + : "")} +
" + }; + }) + .ToArray(); + + return Json(new { data }); + } + } +} diff --git a/Views/DataRumahRw/Index.cshtml b/Views/DataRumahRw/Index.cshtml new file mode 100644 index 0000000..85602a4 --- /dev/null +++ b/Views/DataRumahRw/Index.cshtml @@ -0,0 +1,351 @@ +@{ + ViewData["Title"] = "Data Rumah RW"; +} + + + +
+ +
+

Data Rumah RW

+
+
+ + +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + +
NoRTRWAlamatKotaNama PemilikStatusChecklistAksi
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Views/Shared/Layouts/App/_Sidebar.cshtml b/Views/Shared/Layouts/App/_Sidebar.cshtml index 437cdac..d004929 100644 --- a/Views/Shared/Layouts/App/_Sidebar.cshtml +++ b/Views/Shared/Layouts/App/_Sidebar.cshtml @@ -62,9 +62,15 @@
  • -
    +
    DATA RUMAH