feat: create volume timbulan sampah page
parent
4278a12ce0
commit
2276ec27db
|
|
@ -0,0 +1,29 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BpsRwApp.Controllers
|
||||
{
|
||||
[Route("[controller]/[action]")]
|
||||
public class VolumeTimbulanSampahController : AppControllerBase
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Table()
|
||||
{
|
||||
var data = new[]
|
||||
{
|
||||
new { wilayah="Jakarta Pusat", mudahTerurai=79871, daurUlang=62392, b3=11637, residu=39474 },
|
||||
new { wilayah="Jakarta Selatan", mudahTerurai=6945, daurUlang=93224, b3=14705, residu=78251 },
|
||||
new { wilayah="Jakarta Barat", mudahTerurai=8768, daurUlang=55985, b3=56214, residu=35794 },
|
||||
new { wilayah="Jakarta Timur", mudahTerurai=69517, daurUlang=13264, b3=9434, residu=92256 },
|
||||
new { wilayah="Jakarta Utara", mudahTerurai=90028, daurUlang=53936, b3=44277, residu=73361 },
|
||||
new { wilayah="Kepulauan Seribu", mudahTerurai=98931, daurUlang=968, b3=58423, residu=94865 },
|
||||
};
|
||||
|
||||
return Json(new { data });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details @(controller == "RincianTargetRumahMemilah" ? "open" : "")>
|
||||
<details @(new[] { "RincianTargetRumahMemilah", "VolumeTimbulanSampah" }.Contains(controller) ? "open" : "")>
|
||||
<summary>LAPORAN</summary>
|
||||
<ul>
|
||||
<li>
|
||||
|
|
@ -163,6 +163,12 @@
|
|||
Rincian Target Rumah Memilah
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-controller="VolumeTimbulanSampah" asp-action="Index" class="@(controller == "VolumeTimbulanSampah" ? "menu-active" : "")">
|
||||
<span class="icon icon-fill">delete</span>
|
||||
Volume Timbulan Sampah
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,138 @@
|
|||
@{
|
||||
ViewData["Title"] = "Volume Timbulan Sampah";
|
||||
}
|
||||
|
||||
<div class="breadcrumbs text-sm">
|
||||
<ul>
|
||||
<li class="text-gray-500"><a>Laporan</a></li>
|
||||
<li>Volume Timbulan Sampah</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Header -->
|
||||
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
|
||||
<div class="prose">
|
||||
<h3 class="mb-2">Volume Timbulan Sampah</h3>
|
||||
</div>
|
||||
<div class="flex justify-end items-center gap-2">
|
||||
<a class="btn btn-primary text-white rounded-full" href="#">
|
||||
<span class="icon icon-fill me-2">download</span>
|
||||
Download
|
||||
</a>
|
||||
<button class="btn rounded-full bg-white" onclick="modal_filter.showModal()">
|
||||
<span class="icon icon-fill me-2">filter_list</span>
|
||||
Filter
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="h-6"></div>
|
||||
|
||||
<!-- TABLE -->
|
||||
<div class="card bg-white shadow-sm">
|
||||
<div class="card-body p-0">
|
||||
<table class="table table-zebra w-full" id="example">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-[5%]">No</th>
|
||||
<th class="w-[30%]">Wilayah</th>
|
||||
<th class="w-[15%]">Mudah Terurai</th>
|
||||
<th class="w-[15%]">Daur Ulang</th>
|
||||
<th class="w-[15%]">B3</th>
|
||||
<th class="w-[15%]">Residu</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filter Modal -->
|
||||
<dialog id="modal_filter" class="modal modal-bottom sm:modal-middle">
|
||||
<div class="modal-box w-full sm:max-w-sm">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<h3 class="text-lg font-bold">Filter Data</h3>
|
||||
<button type="button" class="btn btn-sm btn-circle btn-ghost" onclick="modal_filter.close()">✕</button>
|
||||
</div>
|
||||
<form action="#" method="get">
|
||||
<fieldset class="fieldset">
|
||||
<legend class="fieldset-legend">Tahun</legend>
|
||||
<select name="tahun" class="select w-full">
|
||||
<option disabled selected>Pilih Tahun</option>
|
||||
<option>2025</option>
|
||||
<option>2024</option>
|
||||
<option>2023</option>
|
||||
<option>2022</option>
|
||||
<option>2021</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
<fieldset class="fieldset max-w-sm">
|
||||
<legend class="fieldset-legend">Bulan</legend>
|
||||
<select id="filter-bulan" class="w-full">
|
||||
<option value="">Pilih Bulan</option>
|
||||
<option value="Januari">Januari</option>
|
||||
<option value="Februari">Februari</option>
|
||||
<option value="Maret">Maret</option>
|
||||
<option value="Apri">April</option>
|
||||
<option value="Mei">Mei</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
<div class="modal-action">
|
||||
<button type="reset" class="btn" onclick="modal_filter.close()">Bersihkan</button>
|
||||
<button type="submit" class="btn btn-neutral">Terapkan Filter</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/css/tom-select.css" rel="stylesheet">
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
|
||||
<script src="https://cdn.datatables.net/2.3.4/js/dataTables.js"></script>
|
||||
<script src="/plugins/datatables/dataTables.tailwindcss.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/js/tom-select.complete.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
new DataTable('#example', {
|
||||
ajax: '@Url.Action("Table", "VolumeTimbulanSampah")',
|
||||
scrollX: true,
|
||||
autoWidth: false,
|
||||
initComplete: function () {
|
||||
$('div.dt-scroll-body thead').css('visibility', 'collapse');
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
data: null,
|
||||
render: (d, t, r, m) => m.row + 1,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{ data: 'wilayah' },
|
||||
|
||||
{
|
||||
data: 'mudahTerurai',
|
||||
render: data => data.toLocaleString("id-ID")
|
||||
},
|
||||
{
|
||||
data: 'daurUlang',
|
||||
render: data => data.toLocaleString("id-ID")
|
||||
},
|
||||
{
|
||||
data: 'b3',
|
||||
render: data => data.toLocaleString("id-ID")
|
||||
},
|
||||
{
|
||||
data: 'residu',
|
||||
render: data => data.toLocaleString("id-ID")
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
new TomSelect("#filter-bulan", {
|
||||
closeAfterSelect: true,
|
||||
maxItems: 1,
|
||||
placeholder: "Pilih Bulan",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Loading…
Reference in New Issue