271 lines
11 KiB
Plaintext
271 lines
11 KiB
Plaintext
@{
|
|
ViewData["Title"] = "Laporan RW";
|
|
}
|
|
|
|
<div class="breadcrumbs text-sm">
|
|
<ul>
|
|
<li class="text-gray-500"><a>Data Verifikasi</a></li>
|
|
<li>Laporan RW</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- Header -->
|
|
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
|
|
<div class="prose">
|
|
<h3 class="mb-2">Laporan 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">download</span>
|
|
Unduh Laporan
|
|
</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-8"></div>
|
|
|
|
<!-- Filter Modal -->
|
|
<dialog id="modal_filter" class="modal modal-bottom sm:modal-middle">
|
|
<div class="modal-box w-full sm:max-w-sm">
|
|
<h3 class="text-lg font-bold">Filter</h3>
|
|
<form action="#" method="get">
|
|
<p class="py-4">
|
|
<fieldset class="fieldset max-w-sm">
|
|
<legend class="fieldset-legend">Bulan Awal</legend>
|
|
<input type="month" class="input w-full">
|
|
</fieldset>
|
|
<fieldset class="fieldset max-w-sm">
|
|
<legend class="fieldset-legend">Bulan Akhir</legend>
|
|
<input type="month" class="input w-full">
|
|
</fieldset>
|
|
<fieldset class="fieldset max-w-sm">
|
|
<legend class="fieldset-legend">Kecamatan</legend>
|
|
<select id="filter-kecamatan" class="w-full">
|
|
<option value="">Pilih Kecamatan</option>
|
|
<option value="Matraman">Matraman</option>
|
|
<option value="Pulogadung">Pulogadung</option>
|
|
<option value="Jatinegara">Jatinegara</option>
|
|
<option value="Kramat Jati">Kramat Jati</option>
|
|
<option value="Pasar Rebo">Pasar Rebo</option>
|
|
</select>
|
|
</fieldset>
|
|
<fieldset class="fieldset max-w-sm">
|
|
<legend class="fieldset-legend">Kelurahan</legend>
|
|
<select id="filter-kelurahan" class="w-full">
|
|
<option value="">Pilih Kelurahan</option>
|
|
<option value="Sukamaju">Sukamaju</option>
|
|
<option value="Sukadamai">Sukadamai</option>
|
|
<option value="Mekarsari">Mekarsari</option>
|
|
<option value="HarapanJaya">Harapan Jaya</option>
|
|
<option value="Cibinong">Cibinong</option>
|
|
</select>
|
|
</fieldset>
|
|
<fieldset class="fieldset max-w-sm">
|
|
<legend class="fieldset-legend">RW</legend>
|
|
<select id="filter-rw" class="w-full">
|
|
<option value="">Pilih RW</option>
|
|
<option value="01">01</option>
|
|
<option value="02">02</option>
|
|
<option value="03">03</option>
|
|
<option value="04">04</option>
|
|
<option value="05">05</option>
|
|
<option value="06">06</option>
|
|
<option value="07">07</option>
|
|
<option value="08">08</option>
|
|
<option value="09">09</option>
|
|
<option value="10">10</option>
|
|
</select>
|
|
</fieldset>
|
|
<fieldset class="fieldset max-w-sm">
|
|
<legend class="fieldset-legend">Status</legend>
|
|
<select id="filter-status" class="select w-full">
|
|
<option disabled selected>Pilih Status</option>
|
|
<option value="verifikasi">Verifikasi</option>
|
|
<option value="belum">Belum Verifikasi</option>
|
|
</select>
|
|
</fieldset>
|
|
</p>
|
|
<div class="modal-action">
|
|
<button type="button" class="btn" onclick="modal_filter.close()">Bersihkan</button>
|
|
<button type="submit" class="btn btn-neutral">Terapkan Filter</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</dialog>
|
|
|
|
<!-- Detail Modal -->
|
|
<dialog id="modal_detail" class="modal modal-bottom sm:modal-middle">
|
|
<div class="modal-box w-full max-w-2xl">
|
|
<form method="dialog">
|
|
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button>
|
|
<h3 class="text-lg font-bold mb-4">Detail Laporan RW</h3>
|
|
<div class="grid grid-cols-2 gap-4 mb-6">
|
|
<div>
|
|
<p class="text-sm text-gray-500">Kelurahan</p>
|
|
<p class="font-semibold" id="detail_kelurahan">-</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm text-gray-500">RW</p>
|
|
<p class="font-semibold" id="detail_rw">-</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm text-gray-500">Period</p>
|
|
<p class="font-semibold" id="detail_period">-</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-sm text-gray-500">Rumah Aktif Memilah</p>
|
|
<p class="font-semibold" id="detail_rumah_aktif">-</p>
|
|
</div>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="table table-zebra w-full">
|
|
<thead>
|
|
<tr>
|
|
<th class="w-[10%]">No</th>
|
|
<th class="w-[50%]">Rumah</th>
|
|
<th class="w-[20%]">RT</th>
|
|
<th class="w-[20%]">Checklist</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="detail_table_body">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="modal-action mt-6">
|
|
<button type="button" class="btn btn-ghost rounded-full" onclick="modal_detail.close()">
|
|
<span class="icon me-2">close</span>
|
|
Tutup
|
|
</button>
|
|
<button type="submit" class="btn btn-primary text-white rounded-full">
|
|
<span class="icon me-2">check_circle</span>
|
|
Verifikasi
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<form method="dialog" class="modal-backdrop">
|
|
<button>close</button>
|
|
</form>
|
|
</dialog>
|
|
|
|
<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-[40%]">Kelurahan</th>
|
|
<th class="w-[5%]">RW</th>
|
|
<th class="w-[10%]">Bulan</th>
|
|
<th class="w-[10%]">Rumah Aktif Memilah</th>
|
|
<th class="w-[10%]">Status</th>
|
|
<th class="w-[15%]">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.jsdelivr.net/npm/sweetalert2@11"></script>
|
|
<script src="https://cdn.datatables.net/2.3.4/js/dataTables.js"></script>
|
|
<script src="/plugins/datatables/dataTables.tailwindcss.js"></script>
|
|
<link href="https://cdn.jsdelivr.net/npm/tom-select@2.2.2/dist/css/tom-select.css" rel="stylesheet">
|
|
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.2.2/dist/js/tom-select.complete.min.js"></script>
|
|
<script type="text/javascript">
|
|
var table;
|
|
|
|
$(document).ready(function () {
|
|
new TomSelect("#filter-kecamatan", {
|
|
closeAfterSelect: true,
|
|
maxItems: 1,
|
|
placeholder: "Pilih Kecamatan",
|
|
});
|
|
|
|
new TomSelect("#filter-kelurahan", {
|
|
closeAfterSelect: true,
|
|
maxItems: 1,
|
|
placeholder: "Pilih Kelurahan",
|
|
});
|
|
|
|
new TomSelect("#filter-rw", {
|
|
closeAfterSelect: true,
|
|
maxItems: 1,
|
|
placeholder: "Pilih RW",
|
|
});
|
|
|
|
table = new DataTable('#example', {
|
|
ajax: '@Url.Action("Table", "LaporanRw")',
|
|
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: 'kelurahan' },
|
|
{ data: 'rw' },
|
|
{ data: 'bulan' },
|
|
{ data: 'rumah_aktif_memilah' },
|
|
{ data: 'status' },
|
|
{ data: 'aksi' },
|
|
]
|
|
});
|
|
|
|
|
|
table.on("click", ".btn-detail", function (e) {
|
|
e.preventDefault();
|
|
|
|
let rowData = table.row($(this).closest('tr')).data();
|
|
$('#detail_kelurahan').text(rowData.kelurahan);
|
|
$('#detail_rw').text(rowData.rw);
|
|
$('#detail_period').text(rowData.bulan);
|
|
$('#detail_rumah_aktif').text(rowData.rumah_aktif_memilah);
|
|
|
|
let detailRows = '';
|
|
let sampleHouses = [
|
|
{ rumah: 'Jl. Cipinang Raya No 34', rt: '03', checklist: '11' },
|
|
{ rumah: 'Jl. Cipinang Baru No 22', rt: '01', checklist: '23' }
|
|
];
|
|
|
|
sampleHouses.forEach((house, index) => {
|
|
detailRows += `
|
|
<tr>
|
|
<td>${index + 1}</td>
|
|
<td>${house.rumah}</td>
|
|
<td>${house.rt}</td>
|
|
<td>${house.checklist}</td>
|
|
</tr>
|
|
`;
|
|
});
|
|
|
|
$('#detail_table_body').html(detailRows);
|
|
|
|
modal_detail.showModal();
|
|
});
|
|
|
|
table.on("click", ".delete", function (e) {
|
|
e.preventDefault();
|
|
|
|
let url = $(this).data("url");
|
|
Swal.fire({
|
|
title: "Apakah anda yakin?",
|
|
text: "Data yang dihapus tidak dapat dikembalikan lagi",
|
|
icon: "question",
|
|
showCancelButton: true,
|
|
confirmButtonText: "Ya, Hapus",
|
|
cancelButtonText: "Batal",
|
|
buttonsStyling: false,
|
|
customClass: {
|
|
confirmButton: "btn btn-error text-white",
|
|
cancelButton: "btn btn-link no-underline text-gray-500",
|
|
},
|
|
});
|
|
});
|
|
});
|
|
</script> |