style: add menu Data RW role Admin
parent
cfa635c935
commit
72d8f9aa1c
|
|
@ -0,0 +1,128 @@
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace BpsRwApp.Areas.Admin.Controllers
|
||||||
|
{
|
||||||
|
[Area("Admin")]
|
||||||
|
public class DataRwController : Controller
|
||||||
|
{
|
||||||
|
public IActionResult Index()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult Table()
|
||||||
|
{
|
||||||
|
var data = new[]
|
||||||
|
{
|
||||||
|
new {
|
||||||
|
rw = "001",
|
||||||
|
kecamatan = "Kebayoran",
|
||||||
|
jumlah_rumah_memilah = 581,
|
||||||
|
jumlah_rumah_nasabah = 701,
|
||||||
|
jumlah_bank_sampah = 581,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "002",
|
||||||
|
kecamatan = "Tebet",
|
||||||
|
jumlah_rumah_memilah = 889,
|
||||||
|
jumlah_rumah_nasabah = 934,
|
||||||
|
jumlah_bank_sampah = 889,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "003",
|
||||||
|
kecamatan = "Menteng",
|
||||||
|
jumlah_rumah_memilah = 673,
|
||||||
|
jumlah_rumah_nasabah = 1378,
|
||||||
|
jumlah_bank_sampah = 673,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "004",
|
||||||
|
kecamatan = "Cilandak",
|
||||||
|
jumlah_rumah_memilah = 790,
|
||||||
|
jumlah_rumah_nasabah = 1094,
|
||||||
|
jumlah_bank_sampah = 790,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "005",
|
||||||
|
kecamatan = "Setiabudi",
|
||||||
|
jumlah_rumah_memilah = 750,
|
||||||
|
jumlah_rumah_nasabah = 794,
|
||||||
|
jumlah_bank_sampah = 750,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "006",
|
||||||
|
kecamatan = "Gambir",
|
||||||
|
jumlah_rumah_memilah = 780,
|
||||||
|
jumlah_rumah_nasabah = 1573,
|
||||||
|
jumlah_bank_sampah = 780,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "007",
|
||||||
|
kecamatan = "Cakung",
|
||||||
|
jumlah_rumah_memilah = 552,
|
||||||
|
jumlah_rumah_nasabah = 1160,
|
||||||
|
jumlah_bank_sampah = 552,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "008",
|
||||||
|
kecamatan = "Kelapa Gading",
|
||||||
|
jumlah_rumah_memilah = 582,
|
||||||
|
jumlah_rumah_nasabah = 1663,
|
||||||
|
jumlah_bank_sampah = 582,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "009",
|
||||||
|
kecamatan = "Pancoran",
|
||||||
|
jumlah_rumah_memilah = 935,
|
||||||
|
jumlah_rumah_nasabah = 730,
|
||||||
|
jumlah_bank_sampah = 935,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
rw = "010",
|
||||||
|
kecamatan = "Tanah Abang",
|
||||||
|
jumlah_rumah_memilah = 593,
|
||||||
|
jumlah_rumah_nasabah = 1046,
|
||||||
|
jumlah_bank_sampah = 593,
|
||||||
|
aksi = "<div class=\"flex gap-2\">" +
|
||||||
|
"<a href=\"#\" class=\"btn btn-ghost btn-square btn-xs\"><span class=\"icon icon-fill text-sm\">more_horiz</span></a>" +
|
||||||
|
"</div>",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
var response = new
|
||||||
|
{
|
||||||
|
data = data
|
||||||
|
};
|
||||||
|
|
||||||
|
return Json(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Data RW";
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="breadcrumbs text-sm">
|
||||||
|
<ul>
|
||||||
|
<li class="text-gray-500"><a>Data RW</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Header -->
|
||||||
|
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
|
||||||
|
<div class="prose">
|
||||||
|
<h3 class="mb-2">Data RW</h3>
|
||||||
|
</div>
|
||||||
|
<div class="justify-self-end lg:self-center">
|
||||||
|
<a class="btn rounded-full bg-white" href="#">
|
||||||
|
<span class="icon icon-fill me-2">filter_list</span>
|
||||||
|
Filter
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="h-8"></div>
|
||||||
|
|
||||||
|
<div class="card bg-white shadow-sm">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<table class="table-zebra table" id="example">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="w-[5%]">No</th>
|
||||||
|
<th class="w-[5%]">RW</th>
|
||||||
|
<th class="w-[40%]">Kecamatan</th>
|
||||||
|
<th class="w-[15%]">Jumlah Rumah Memilah</th>
|
||||||
|
<th class="w-[15%]">Jumlah Rumah Nasabah</th>
|
||||||
|
<th class="w-[15%]">Jumlah Bank Sampah</th>
|
||||||
|
<th class="w-[5%]">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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 type="text/javascript">
|
||||||
|
var table;
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
table = new DataTable('#example', {
|
||||||
|
ajax: '/Admin/DataRw/Table',
|
||||||
|
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: 'rw' },
|
||||||
|
{ data: 'kecamatan' },
|
||||||
|
{ data: 'jumlah_rumah_memilah' },
|
||||||
|
{ data: 'jumlah_rumah_nasabah' },
|
||||||
|
{ data: 'jumlah_bank_sampah' },
|
||||||
|
{ data: 'aksi' },
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
</details>
|
</details>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a>
|
<a asp-area="Admin" asp-controller="DataRw" asp-action="Index" class="@(controller == "DataRw" ? "menu-active" : "")">
|
||||||
<span class="icon icon-fill">list</span>
|
<span class="icon icon-fill">list</span>
|
||||||
Data RW
|
Data RW
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue