diff --git a/Controllers/Main/ReduksiSampahDinasController.cs b/Controllers/Main/ReduksiSampahDinasController.cs deleted file mode 100644 index f468317..0000000 --- a/Controllers/Main/ReduksiSampahDinasController.cs +++ /dev/null @@ -1,254 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace BankSampahApp.Controllers.Main -{ - [Route("Main/[controller]/[action]")] - public class ReduksiSampahDinasController : Controller - { - public IActionResult Index() - { - return View("~/Views/Main/ReduksiSampahDinas/Index.cshtml"); - } - - [HttpGet] - public IActionResult Table() - { - var data = new[] { - new { - id = 1, - periode_bulan = "Jan 2025", - nama_lokasi = "Jakarta Pusat", - alamat = @" -
- Tanah Abang -
- Cideng - RT 002 - RW 001 -
-
", - jenis_lokasi = "Maggot", - berat_maggot = 1, - berat_komposting = 5, - berat_bank_sampah = 6, - aksi = @"
- - - -
", - }, - new { - id = 2, - periode_bulan = "Feb 2025", - nama_lokasi = "Jakarta Barat", - alamat = @" -
- Palmerah -
- Kemanggisan - RT 003 - RW 004 -
-
", - jenis_lokasi = "Organik", - berat_maggot = 2, - berat_komposting = 4, - berat_bank_sampah = 3, - aksi = @"
- - - -
", - }, - new { - id = 3, - periode_bulan = "Mar 2025", - nama_lokasi = "Jakarta Selatan", - alamat = @" -
- Tebet -
- Manggarai - RT 001 - RW 002 -
-
", - jenis_lokasi = "Maggot", - berat_maggot = 3, - berat_komposting = 6, - berat_bank_sampah = 2, - aksi = @"
- - - -
", - }, - new { - id = 4, - periode_bulan = "Apr 2025", - nama_lokasi = "Jakarta Timur", - alamat = @" -
- Cakung -
- Jatinegara - RT 004 - RW 006 -
-
", - jenis_lokasi = "Anorganik", - berat_maggot = 1, - berat_komposting = 3, - berat_bank_sampah = 7, - aksi = @"
- - - -
", - }, - new { - id = 5, - periode_bulan = "Mei 2025", - nama_lokasi = "Jakarta Utara", - alamat = @" -
- Koja -
- Lagoa - RT 005 - RW 003 -
-
", - jenis_lokasi = "Maggot", - berat_maggot = 4, - berat_komposting = 5, - berat_bank_sampah = 1, - aksi = @"
- - - -
", - }, - new { - id = 6, - periode_bulan = "Jun 2025", - nama_lokasi = "Depok", - alamat = @" -
- Beji -
- Kukusan - RT 002 - RW 007 -
-
", - jenis_lokasi = "Organik", - berat_maggot = 2, - berat_komposting = 6, - berat_bank_sampah = 4, - aksi = @"
- - - -
", - }, - new { - id = 7, - periode_bulan = "Jul 2025", - nama_lokasi = "Bekasi", - alamat = @" -
- Pondok Gede -
- Jatibening - RT 006 - RW 002 -
-
", - jenis_lokasi = "Maggot", - berat_maggot = 5, - berat_komposting = 3, - berat_bank_sampah = 2, - aksi = @"
- - - -
", - }, - new { - id = 8, - periode_bulan = "Agu 2025", - nama_lokasi = "Tangerang", - alamat = @" -
- Ciledug -
- Paninggilan - RT 001 - RW 005 -
-
", - jenis_lokasi = "Anorganik", - berat_maggot = 1, - berat_komposting = 2, - berat_bank_sampah = 6, - aksi = @"
- - - -
", - }, - new { - id = 9, - periode_bulan = "Sep 2025", - nama_lokasi = "Bogor", - alamat = @" -
- Cibinong -
- Pabuaran - RT 003 - RW 004 -
-
", - jenis_lokasi = "Organik", - berat_maggot = 2, - berat_komposting = 5, - berat_bank_sampah = 3, - aksi = @"
- - - -
", - }, - new { - id = 10, - periode_bulan = "Okt 2025", - nama_lokasi = "Jakarta Selatan", - alamat = @" -
- Pasar Minggu -
- Pejaten - RT 007 - RW 008 -
-
", - jenis_lokasi = "Maggot", - berat_maggot = 6, - berat_komposting = 4, - berat_bank_sampah = 2, - aksi = @"
- - - -
", - } - }; - - - return Json(new { data = data }); - } - } - -} \ No newline at end of file diff --git a/Controllers/Main/ReduksiSampahSatpelController.cs b/Controllers/Main/ReduksiSampahSatpelController.cs deleted file mode 100644 index d7138f5..0000000 --- a/Controllers/Main/ReduksiSampahSatpelController.cs +++ /dev/null @@ -1,234 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace BankSampahApp.Controllers.Main -{ - [Route("Main/[controller]/[action]")] - public class ReduksiSampahSatpelController : Controller - { - public IActionResult Index() - { - return View("~/Views/Main/ReduksiSampahSatpel/Index.cshtml"); - } - - [HttpGet] - public IActionResult Table() - { - var data = new[] - { - new { - id=1, - nama_lokasi = "Jakarta Pusat", - alamat = @" -
- Tanah Abang -
- Cideng - RT 002 - RW 001 -
-
", - jenis_lokasi = "Maggot", - berat = 1, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=2, - nama_lokasi = "Jakarta Selatan", - alamat = @" -
- Kebayoran Baru -
- Gandaria Utara - RT 005 - RW 003 -
-
", - jenis_lokasi = "Komposting", - berat = 2, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=3, - nama_lokasi = "Jakarta Barat", - alamat = @" -
- Palmerah -
- Kemanggisan - RT 004 - RW 002 -
-
", - jenis_lokasi = "Maggot", - berat = 3, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=4, - nama_lokasi = "Jakarta Timur", - alamat = @" -
- Cakung -
- Pulo Gebang - RT 007 - RW 005 -
-
", - jenis_lokasi = "Komposting", - berat = 4, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=5, - nama_lokasi = "Jakarta Utara", - alamat = @" -
- Tanjung Priok -
- Sunter Jaya - RT 003 - RW 001 -
-
", - jenis_lokasi = "Maggot", - berat = 2, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=6, - nama_lokasi = "Depok", - alamat = @" -
- Beji -
- Beji Timur - RT 006 - RW 002 -
-
", - jenis_lokasi = "Komposting", - berat = 3, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=7, - nama_lokasi = "Bogor", - alamat = @" -
- Bogor Utara -
- Kedunghalang - RT 001 - RW 004 -
-
", - jenis_lokasi = "Maggot", - berat = 5, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=8, - nama_lokasi = "Tangerang", - alamat = @" -
- Karawaci -
- Nusa Jaya - RT 008 - RW 003 -
-
", - jenis_lokasi = "Komposting", - berat = 2, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=9, - nama_lokasi = "Bekasi", - alamat = @" -
- Bekasi Timur -
- Margahayu - RT 009 - RW 005 -
-
", - jenis_lokasi = "Maggot", - berat = 3, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - new { - id=10, - nama_lokasi = "Bandung", - alamat = @" -
- Coblong -
- Dago - RT 002 - RW 001 -
-
", - jenis_lokasi = "Komposting", - berat = 1, - gambar = @"", - aksi = "
" + - "" + - "" + - "" + - "
", - }, - }; - - return Json(new { data = data }); - } - } - -} \ No newline at end of file diff --git a/Controllers/Main/ReduksiSampahSudinController.cs b/Controllers/Main/ReduksiSampahSudinController.cs deleted file mode 100644 index e00b995..0000000 --- a/Controllers/Main/ReduksiSampahSudinController.cs +++ /dev/null @@ -1,194 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace BankSampahApp.Controllers.Main -{ - [Route("Main/[controller]/[action]")] - public class ReduksiSampahSudinController : Controller - { - public IActionResult Index() - { - return View("~/Views/Main/ReduksiSampahSudin/Index.cshtml"); - } - - [HttpGet] - public IActionResult Table() - { - var data = new[] { - new { - nama_lokasi = "Jakarta Pusat", - alamat = @" -
- Tanah Abang -
- Cideng - RT 002 - RW 001 -
-
", - jenis_lokasi = "Maggot", - berat = 1, - gambar = @"", - aksi = @"
- - -
", - }, - new { - nama_lokasi = "Jakarta Barat", - alamat = @" -
- Palmerah -
- Kemanggisan - RT 003 - RW 004 -
-
", - jenis_lokasi = "Organik", - berat = 2, - gambar = @"", - aksi = @"
- - -
", - }, - new { - nama_lokasi = "Jakarta Selatan", - alamat = @" -
- Tebet -
- Manggarai - RT 001 - RW 002 -
-
", - jenis_lokasi = "Maggot", - berat = 3, - gambar = @"", - aksi = @"
- - -
", - }, - new { - nama_lokasi = "Jakarta Timur", - alamat = @" -
- Cakung -
- Jatinegara - RT 004 - RW 006 -
-
", - jenis_lokasi = "Anorganik", - berat = 5, - gambar = @"", - aksi = @"
- - -
", - }, - new { - nama_lokasi = "Jakarta Utara", - alamat = @" -
- Koja -
- Lagoa - RT 005 - RW 003 -
-
", - jenis_lokasi = "Maggot", - berat = 4, - gambar = @"", - aksi = @"
- - -
", - }, - new { - nama_lokasi = "Depok", - alamat = @" -
- Beji -
- Kukusan - RT 002 - RW 007 -
-
", - jenis_lokasi = "Organik", - berat = 2, - gambar = @"", - aksi = @"
- - -
", - }, - new { - nama_lokasi = "Bekasi", - alamat = @" -
- Pondok Gede -
- Jatibening - RT 006 - RW 002 -
-
", - jenis_lokasi = "Maggot", - berat = 6, - gambar = @"", - aksi = @"
- - -
", - }, - new { - nama_lokasi = "Tangerang", - alamat = @" -
- Ciledug -
- Paninggilan - RT 001 - RW 005 -
-
", - jenis_lokasi = "Anorganik", - berat = 3, - gambar = @"", - aksi = @"
- - -
", - }, - new { - nama_lokasi = "Bogor", - alamat = @" -
- Cibinong -
- Pabuaran - RT 003 - RW 004 -
-
", - jenis_lokasi = "Organik", - berat = 4, - gambar = @"", - aksi = @"
- - -
", - } - }; - - return Json(new { data = data }); - } - } - -} \ No newline at end of file diff --git a/Controllers/ReduksiSampah/KompostingController.cs b/Controllers/ReduksiSampah/KompostingController.cs new file mode 100644 index 0000000..bbc57a5 --- /dev/null +++ b/Controllers/ReduksiSampah/KompostingController.cs @@ -0,0 +1,27 @@ +using System.Linq; +using Microsoft.AspNetCore.Mvc; + +namespace BankSampahApp.Controllers.ReduksiSampah +{ + [Route("ReduksiSampah/[controller]/[action]")] + public class KompostingController : Controller + { + private const string Jenis = "Komposting"; + + public IActionResult Index() + { + return View("~/Views/ReduksiSampah/Komposting/Index.cshtml"); + } + + [HttpGet] + public IActionResult Table([FromQuery] string? bulan) + { + var data = ReduksiSampahDataStore + .GetItems(Jenis) + .Where(item => ReduksiSampahDataStore.MatchesBulan(item, bulan)) + .Select(ReduksiSampahDataStore.ToResponse); + + return Json(new { data }); + } + } +} diff --git a/Controllers/Master/LokasiController.cs b/Controllers/ReduksiSampah/LokasiController.cs similarity index 97% rename from Controllers/Master/LokasiController.cs rename to Controllers/ReduksiSampah/LokasiController.cs index 0d5d1ec..a30edf2 100644 --- a/Controllers/Master/LokasiController.cs +++ b/Controllers/ReduksiSampah/LokasiController.cs @@ -1,13 +1,13 @@ using Microsoft.AspNetCore.Mvc; -namespace BankSampahApp.Controllers.Master +namespace BankSampahApp.Controllers.ReduksiSampah { - [Route("Master/[controller]/[action]")] + [Route("ReduksiSampah/[controller]/[action]")] public class LokasiController : Controller { public IActionResult Index() { - return View("~/Views/Master/Lokasi/Index.cshtml"); + return View("~/Views/ReduksiSampah/Lokasi/Index.cshtml"); } [HttpGet] diff --git a/Controllers/ReduksiSampah/MaggotController.cs b/Controllers/ReduksiSampah/MaggotController.cs new file mode 100644 index 0000000..53990d1 --- /dev/null +++ b/Controllers/ReduksiSampah/MaggotController.cs @@ -0,0 +1,27 @@ +using System.Linq; +using Microsoft.AspNetCore.Mvc; + +namespace BankSampahApp.Controllers.ReduksiSampah +{ + [Route("ReduksiSampah/[controller]/[action]")] + public class MaggotController : Controller + { + private const string Jenis = "Maggot"; + + public IActionResult Index() + { + return View("~/Views/ReduksiSampah/Maggot/Index.cshtml"); + } + + [HttpGet] + public IActionResult Table([FromQuery] string? bulan) + { + var data = ReduksiSampahDataStore + .GetItems(Jenis) + .Where(item => ReduksiSampahDataStore.MatchesBulan(item, bulan)) + .Select(ReduksiSampahDataStore.ToResponse); + + return Json(new { data }); + } + } +} diff --git a/Controllers/ReduksiSampah/ReduksiSampahDataStore.cs b/Controllers/ReduksiSampah/ReduksiSampahDataStore.cs new file mode 100644 index 0000000..83551f3 --- /dev/null +++ b/Controllers/ReduksiSampah/ReduksiSampahDataStore.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace BankSampahApp.Controllers.ReduksiSampah +{ + internal static class ReduksiSampahDataStore + { + private static readonly IReadOnlyList Items = new List + { + new() + { + Id = 1, + PeriodeBulan = "Jan 2025", + NamaLokasi = "Jakarta Pusat", + JenisLokasi = "Maggot", + BeratReduksi = 8, + BeratSampah = 15, + Alamat = AddressBlock("Tanah Abang", "Cideng", "002", "001") + }, + new() + { + Id = 2, + PeriodeBulan = "Feb 2025", + NamaLokasi = "Jakarta Barat", + JenisLokasi = "Maggot", + BeratReduksi = 10, + BeratSampah = 20, + Alamat = AddressBlock("Palmerah", "Kemanggisan", "003", "004") + }, + new() + { + Id = 3, + PeriodeBulan = "Mar 2025", + NamaLokasi = "Jakarta Selatan", + JenisLokasi = "Maggot", + BeratReduksi = 7, + BeratSampah = 14, + Alamat = AddressBlock("Tebet", "Manggarai", "001", "002") + }, + new() + { + Id = 4, + PeriodeBulan = "Apr 2025", + NamaLokasi = "Jakarta Timur", + JenisLokasi = "Maggot", + BeratReduksi = 6, + BeratSampah = 12, + Alamat = AddressBlock("Cakung", "Jatinegara", "004", "006") + }, + new() + { + Id = 5, + PeriodeBulan = "Mei 2025", + NamaLokasi = "Jakarta Utara", + JenisLokasi = "Maggot", + BeratReduksi = 9, + BeratSampah = 16, + Alamat = AddressBlock("Koja", "Lagoa", "005", "003") + }, + new() + { + Id = 6, + PeriodeBulan = "Jun 2025", + NamaLokasi = "Depok", + JenisLokasi = "Komposting", + BeratReduksi = 11, + BeratSampah = 18, + Alamat = AddressBlock("Beji", "Beji Timur", "006", "002") + }, + new() + { + Id = 7, + PeriodeBulan = "Jul 2025", + NamaLokasi = "Bekasi", + JenisLokasi = "Komposting", + BeratReduksi = 13, + BeratSampah = 21, + Alamat = AddressBlock("Bekasi Timur", "Margahayu", "009", "005") + }, + new() + { + Id = 8, + PeriodeBulan = "Agu 2025", + NamaLokasi = "Bogor", + JenisLokasi = "Komposting", + BeratReduksi = 9, + BeratSampah = 15, + Alamat = AddressBlock("Bogor Utara", "Kedunghalang", "001", "004") + }, + new() + { + Id = 9, + PeriodeBulan = "Sep 2025", + NamaLokasi = "Tangerang", + JenisLokasi = "Komposting", + BeratReduksi = 8, + BeratSampah = 13, + Alamat = AddressBlock("Karawaci", "Nusa Jaya", "008", "003") + }, + new() + { + Id = 10, + PeriodeBulan = "Okt 2025", + NamaLokasi = "Cilegon", + JenisLokasi = "Komposting", + BeratReduksi = 12, + BeratSampah = 19, + Alamat = AddressBlock("Ciwandan", "Kebonsari", "010", "002") + } + }; + + private const string ActionButtons = @"
+ + + + + +
"; + + private const string ProofButton = @""; + + public static IEnumerable GetItems(string jenisLokasi) => + Items.Where(item => string.Equals(item.JenisLokasi, jenisLokasi, StringComparison.OrdinalIgnoreCase)); + + public static bool MatchesBulan(ReduksiSampahItem item, string? bulan) + { + if (string.IsNullOrWhiteSpace(bulan)) + { + return true; + } + + return item.PeriodeBulan.Contains(bulan.Trim(), StringComparison.OrdinalIgnoreCase); + } + + public static object ToResponse(ReduksiSampahItem item) => new + { + id = item.Id, + periode_bulan = item.PeriodeBulan, + nama_lokasi = item.NamaLokasi, + alamat = item.Alamat, + jenis_lokasi = item.JenisLokasi, + berat_reduksi = item.BeratReduksi, + berat_sampah = item.BeratSampah, + gambar = ProofButton, + aksi = ActionButtons + }; + + private static string AddressBlock(string kecamatan, string kelurahan, string rt, string rw) + { + return $@" +
+ {kecamatan} +
+ {kelurahan} + RT {rt} + RW {rw} +
+
"; + } + + public class ReduksiSampahItem + { + public int Id { get; set; } + public string PeriodeBulan { get; set; } = string.Empty; + public string NamaLokasi { get; set; } = string.Empty; + public string Alamat { get; set; } = string.Empty; + public string JenisLokasi { get; set; } = string.Empty; + public double BeratReduksi { get; set; } + public double BeratSampah { get; set; } + } + } +} diff --git a/Views/Main/ReduksiSampahDinas/Index.cshtml b/Views/Main/ReduksiSampahDinas/Index.cshtml deleted file mode 100644 index 2691902..0000000 --- a/Views/Main/ReduksiSampahDinas/Index.cshtml +++ /dev/null @@ -1,338 +0,0 @@ -@{ - ViewData["Title"] = "Reduksi Sampah Dinas"; -} - -
-
- - Reduksi Sampah Dinas - -
-
- -
-
- - - - - - - - - - - - - - - -
- -
-
-
- - - - - - - - - - - - - - - - - -
NoPeriodeNama LokasiAlamatBerat Maggot(Kg)Berat Komposting(Kg)Berat Bank Sampah(Kg)Total Reduksi(Kg)Aksi
-
-
-
- - -@section Scripts { - -} diff --git a/Views/Main/ReduksiSampahSatpel/Index.cshtml b/Views/Main/ReduksiSampahSatpel/Index.cshtml deleted file mode 100644 index 40c1e07..0000000 --- a/Views/Main/ReduksiSampahSatpel/Index.cshtml +++ /dev/null @@ -1,283 +0,0 @@ -@{ - ViewData["Title"] = "Reduksi Sampah"; -} - -
-
- - Reduksi Sampah - -
-
- - -
-
- - - - - - - - -
- -
-
-
- - - - - - - - - - - - - - - -
NoNama LokasiAlamatJenis LokasiBerat(Kg)GambarAksi
-
-
-
- - -@section Scripts { - -} diff --git a/Views/Main/ReduksiSampahSudin/Index.cshtml b/Views/Main/ReduksiSampahSudin/Index.cshtml deleted file mode 100644 index 3d8ae9c..0000000 --- a/Views/Main/ReduksiSampahSudin/Index.cshtml +++ /dev/null @@ -1,151 +0,0 @@ -@{ - ViewData["Title"] = "Reduksi Sampah Sudin"; -} - -
-
- - Reduksi Sampah Sudin - -
-
- -
-
- - - - - - - - -
- -
-
-
- - - - - - - - - - - - - - - -
NoNama LokasiAlamatJenis LokasiBerat(Kg)GambarAksi
-
-
-
- - -@section Scripts { - -} diff --git a/Views/ReduksiSampah/Komposting/Index.cshtml b/Views/ReduksiSampah/Komposting/Index.cshtml new file mode 100644 index 0000000..e957d1e --- /dev/null +++ b/Views/ReduksiSampah/Komposting/Index.cshtml @@ -0,0 +1,422 @@ +@{ + var jenis = "Komposting"; + var tableUrl = Url.Content("~/ReduksiSampah/Komposting/Table"); + ViewData["Title"] = $"Reduksi Sampah - {jenis}"; +} + +
+
+ + Reduksi Sampah - @jenis + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ + + + + + + + + + + + + + + + +
NoPeriodeNama LokasiAlamatJenis LokasiBerat Reduksi (Kg)Berat Sampah (Kg)Bukti KegiatanAksi
+
+
+
+ + +@section Scripts { + +} \ No newline at end of file diff --git a/Views/Master/Lokasi/Index.cshtml b/Views/ReduksiSampah/Lokasi/Index.cshtml similarity index 90% rename from Views/Master/Lokasi/Index.cshtml rename to Views/ReduksiSampah/Lokasi/Index.cshtml index 988a3a6..216ea20 100644 --- a/Views/Master/Lokasi/Index.cshtml +++ b/Views/ReduksiSampah/Lokasi/Index.cshtml @@ -1,33 +1,34 @@ @{ - ViewData["Title"] = "Lokasi Maggot, Bank Sampah, Composting"; +ViewData["Title"] = "Reduksi Sampah - Lokasi"; } - + .select2-selection__arrow { + height: 2rem !important; + } +
- Lokasi Maggot, Bank Sampah, Composting + Reduksi Sampah - Lokasi
- @@ -37,7 +38,8 @@