feat: create an RW report page
parent
733c94c42a
commit
2a979c7b72
|
|
@ -0,0 +1,88 @@
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace BpsRwApp.Controllers
|
||||||
|
{
|
||||||
|
[Route("[controller]/[action]")]
|
||||||
|
public class LaporanRwRwController : AppControllerBase
|
||||||
|
{
|
||||||
|
public IActionResult Index()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult Table()
|
||||||
|
{
|
||||||
|
var data = new[]
|
||||||
|
{
|
||||||
|
new {
|
||||||
|
bulan = "Januari",
|
||||||
|
rumah_aktif_memilah = 104,
|
||||||
|
status = "<div class=\"badge badge-error badge-soft rounded-full\">Belum Diverifikasi</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "Februari",
|
||||||
|
rumah_aktif_memilah = 67,
|
||||||
|
status = "<div class=\"badge badge-error badge-soft rounded-full\">Belum Diverifikasi</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "Maret",
|
||||||
|
rumah_aktif_memilah = 110,
|
||||||
|
status = "<div class=\"badge badge-error badge-soft rounded-full\">Belum Diverifikasi</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "April",
|
||||||
|
rumah_aktif_memilah = 88,
|
||||||
|
status = "<div class=\"badge badge-success badge-soft rounded-full\">Verifikasi Sudin</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "Mei",
|
||||||
|
rumah_aktif_memilah = 90,
|
||||||
|
status = "<div class=\"badge badge-success badge-soft rounded-full\">Verifikasi Sudin</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "Juni",
|
||||||
|
rumah_aktif_memilah = 72,
|
||||||
|
status = "<div class=\"badge badge-success badge-soft rounded-full\">Verifikasi Sudin</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "Juli",
|
||||||
|
rumah_aktif_memilah = 81,
|
||||||
|
status = "<div class=\"badge badge-success badge-soft rounded-full\">Verifikasi Sudin</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "Agustus",
|
||||||
|
rumah_aktif_memilah = 65,
|
||||||
|
status = "<div class=\"badge badge-success badge-soft rounded-full\">Verifikasi Sudin</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "September",
|
||||||
|
rumah_aktif_memilah = 90,
|
||||||
|
status = "<div class=\"badge badge-success badge-soft rounded-full\">Verifikasi Sudin</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
bulan = "Oktober",
|
||||||
|
rumah_aktif_memilah = 72,
|
||||||
|
status = "<div class=\"badge badge-success badge-soft rounded-full\">Verifikasi Sudin</div>",
|
||||||
|
gambar = "<button class='btn bg-white rounded-full btn-sm'>Lihat Gambar</button>"
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
var response = new
|
||||||
|
{
|
||||||
|
data = data
|
||||||
|
};
|
||||||
|
|
||||||
|
return Json(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Laporan RW (RW)";
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="breadcrumbs text-sm mb-4">
|
||||||
|
<ul>
|
||||||
|
<li class="text-gray-500"><a>INPUT</a></li>
|
||||||
|
<li id="breadcrumb-active">Laporan RW</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center justify-between mb-6">
|
||||||
|
<h2 class="text-xl font-semibold text-gray-800">Data Input Laporan RW</h2>
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
|
||||||
|
<!-- Add Button -->
|
||||||
|
<a href="#" class="btn bg-green-600 text-white rounded-full">
|
||||||
|
<span class="icon me-2">add</span>
|
||||||
|
Tambah
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card bg-white shadow-sm">
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<table class="table w-full" id="tableRw">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>No</th>
|
||||||
|
<th>Bulan</th>
|
||||||
|
<th>Jumlah Rumah Aktif Memilah</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Gambar</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('#tableRw', {
|
||||||
|
ajax: '@Url.Action("Table", "LaporanRwRw")',
|
||||||
|
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 },
|
||||||
|
{ data: 'bulan' },
|
||||||
|
{ data: 'rumah_aktif_memilah' },
|
||||||
|
{ data: 'status' },
|
||||||
|
{ data: 'gambar' }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -155,5 +155,20 @@
|
||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<details @(controller == "LaporanRwRw" ? "open" : "")>
|
||||||
|
<summary>INPUT</summary>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a asp-controller="LaporanRwRw"
|
||||||
|
asp-action="Index"
|
||||||
|
class="@(controller == "LaporanRwRw" ? "menu-active" : "")">
|
||||||
|
<span class="icon icon-fill">house</span>
|
||||||
|
Laporan RW (RW)
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue