slicing: create tabs on volume timbulan sampah menu
parent
c7a3c597b2
commit
131f46d7d2
|
|
@ -11,7 +11,7 @@ namespace BpsRwApp.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Table()
|
public IActionResult TableWilayah()
|
||||||
{
|
{
|
||||||
var data = new[]
|
var data = new[]
|
||||||
{
|
{
|
||||||
|
|
@ -25,5 +25,25 @@ namespace BpsRwApp.Controllers
|
||||||
|
|
||||||
return Json(new { data });
|
return Json(new { data });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult TableKecamatan()
|
||||||
|
{
|
||||||
|
var data = new[]
|
||||||
|
{
|
||||||
|
new { kecamatan="Gambir", wilayah="Jakarta Pusat", mudahTerurai=79871, daurUlang=62392, b3=11637, residu=39474 },
|
||||||
|
new { kecamatan="Kebayoran Lama", wilayah="Jakarta Pusat", mudahTerurai=6945, daurUlang=93224, b3=14705, residu=78251 },
|
||||||
|
new { kecamatan="Cengkareng", wilayah="Jakarta Pusat", mudahTerurai=8768, daurUlang=55985, b3=56214, residu=35794 },
|
||||||
|
new { kecamatan="Cakung", wilayah="Jakarta Pusat", mudahTerurai=69517, daurUlang=13264, b3=9434, residu=92256 },
|
||||||
|
new { kecamatan="Koja", wilayah="Jakarta Pusat", mudahTerurai=90028, daurUlang=53936, b3=44277, residu=73361 },
|
||||||
|
new { kecamatan="Kepulauan Harapan", wilayah="Jakarta Pusat", mudahTerurai=98931, daurUlang=968, b3=58423, residu=94865 },
|
||||||
|
new { kecamatan="Jagakarsa", wilayah="Jakarta Selatan", mudahTerurai=45231, daurUlang=32145, b3=8432, residu=21456 },
|
||||||
|
new { kecamatan="Pasar Minggu", wilayah="Jakarta Selatan", mudahTerurai=38942, daurUlang=28934, b3=7234, residu=19234 },
|
||||||
|
new { kecamatan="Cilandak", wilayah="Jakarta Barat", mudahTerurai=52341, daurUlang=41234, b3=9876, residu=25432 },
|
||||||
|
new { kecamatan="Kebayoran Baru", wilayah="Jakarta Timur", mudahTerurai=61234, daurUlang=48765, b3=11234, residu=29876 },
|
||||||
|
};
|
||||||
|
|
||||||
|
return Json(new { data });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
ViewData["Title"] = "Volume Timbulan Sampah";
|
ViewData["Title"] = "Volume Timbulan Sampah";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<!-- Breadcrumb -->
|
||||||
<div class="breadcrumbs text-sm">
|
<div class="breadcrumbs text-sm">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="text-gray-500"><a>Laporan</a></li>
|
<li class="text-gray-500"><a>Laporan</a></li>
|
||||||
|
|
@ -26,27 +27,6 @@
|
||||||
</div>
|
</div>
|
||||||
</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 -->
|
<!-- Filter Modal -->
|
||||||
<dialog id="modal_filter" class="modal modal-bottom sm:modal-middle">
|
<dialog id="modal_filter" class="modal modal-bottom sm:modal-middle">
|
||||||
<div class="modal-box w-full sm:max-w-sm">
|
<div class="modal-box w-full sm:max-w-sm">
|
||||||
|
|
@ -66,16 +46,23 @@
|
||||||
<option>2021</option>
|
<option>2021</option>
|
||||||
</select>
|
</select>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset class="fieldset max-w-sm">
|
<fieldset class="fieldset">
|
||||||
<legend class="fieldset-legend">Bulan</legend>
|
<legend class="fieldset-legend">Bulan</legend>
|
||||||
<select id="filter-bulan" class="w-full">
|
<select id="filter-bulan" class="w-full">
|
||||||
<option value="">Pilih Bulan</option>
|
<option value="">Pilih Bulan</option>
|
||||||
<option value="Januari">Januari</option>
|
<option value="Januari">Januari</option>
|
||||||
<option value="Februari">Februari</option>
|
<option value="Februari">Februari</option>
|
||||||
<option value="Maret">Maret</option>
|
<option value="Maret">Maret</option>
|
||||||
<option value="Apri">April</option>
|
<option value="April">April</option>
|
||||||
<option value="Mei">Mei</option>
|
<option value="Mei">Mei</option>
|
||||||
</select>
|
<option value="Juni">Juni</option>
|
||||||
|
<option value="Juli">Juli</option>
|
||||||
|
<option value="Agustus">Agustus</option>
|
||||||
|
<option value="September">September</option>
|
||||||
|
<option value="Oktober">Oktober</option>
|
||||||
|
<option value="November">November</option>
|
||||||
|
<option value="Desember">Desember</option>
|
||||||
|
</select>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="modal-action">
|
<div class="modal-action">
|
||||||
<button type="reset" class="btn" onclick="modal_filter.close()">Bersihkan</button>
|
<button type="reset" class="btn" onclick="modal_filter.close()">Bersihkan</button>
|
||||||
|
|
@ -85,50 +72,38 @@
|
||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
|
<div class="h-8"></div>
|
||||||
|
|
||||||
|
<!-- Tabs -->
|
||||||
|
<div class="tabs tabs-lift">
|
||||||
|
<input type="radio" name="tab_volume_timbulan" checked class="tab checked:text-white [--tab-bg:green]"
|
||||||
|
aria-label="Wilayah" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0">
|
||||||
|
@await Html.PartialAsync("_TabIndexWilayah")
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="radio" name="tab_volume_timbulan" class="tab checked:text-white [--tab-bg:green]"
|
||||||
|
aria-label="Kecamatan" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0">
|
||||||
|
@await Html.PartialAsync("_TabIndexKecamatan")
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="radio" name="tab_volume_timbulan" class="tab checked:text-white [--tab-bg:green]"
|
||||||
|
aria-label="Kelurahan" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="radio" name="tab_volume_timbulan" class="tab checked:text-white [--tab-bg:green]"
|
||||||
|
aria-label="RW" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/css/tom-select.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/css/tom-select.css" rel="stylesheet">
|
||||||
<script src="/lib/jquery/jquery-3.7.1.js"></script>
|
|
||||||
<script src="/lib/datatables/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 src="https://cdn.jsdelivr.net/npm/tom-select@2.3.1/dist/js/tom-select.complete.min.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
document.addEventListener('DOMContentLoaded', 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", {
|
new TomSelect("#filter-bulan", {
|
||||||
closeAfterSelect: true,
|
closeAfterSelect: true,
|
||||||
maxItems: 1,
|
maxItems: 1,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
<!-- TABLE -->
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
<table class="table-zebra table w-full text-sm" id="tableKecamatan">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="w-[5%]">No</th>
|
||||||
|
<th class="w-[15%]">Kecamatan</th>
|
||||||
|
<th class="w-[20%]">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>
|
||||||
|
|
||||||
|
<script src="/lib/jquery/jquery-3.7.1.js"></script>
|
||||||
|
<script src="/lib/datatables/dataTables.js"></script>
|
||||||
|
<script src="/plugins/datatables/dataTables.tailwindcss.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function () {
|
||||||
|
new DataTable('#tableKecamatan', {
|
||||||
|
ajax: '@Url.Action("TableKecamatan", "VolumeTimbulanSampah")',
|
||||||
|
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: 'kecamatan' },
|
||||||
|
{ 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")
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
<!-- TABLE -->
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
<table class="table-zebra table w-full text-sm" id="tableWilayah">
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<script src="/lib/jquery/jquery-3.7.1.js"></script>
|
||||||
|
<script src="/lib/datatables/dataTables.js"></script>
|
||||||
|
<script src="/plugins/datatables/dataTables.tailwindcss.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function () {
|
||||||
|
new DataTable('#tableWilayah', {
|
||||||
|
ajax: '@Url.Action("TableWilayah", "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")
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue