80 lines
2.5 KiB
Plaintext
80 lines
2.5 KiB
Plaintext
@{
|
|
ViewData["Title"] = "Jenis Nasabah";
|
|
}
|
|
|
|
<div class="flex flex-col gap-2 md:flex-row md:justify-between md:gap-0">
|
|
<div class="prose">
|
|
<span class="text-xl font-semibold text-black">
|
|
Jenis Nasabah
|
|
</span>
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-2 md:flex-row">
|
|
<button class="btn btn-sm bg-bank-sampah-primary-500 max-w-full rounded-full text-white">
|
|
<i class="ph ph-plus"></i>
|
|
Tambah Jenis Nasabah
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="h-6"></div>
|
|
|
|
<div class="card bg-white">
|
|
<div class="card-body p-2">
|
|
<table class="table-zebra table" id="example">
|
|
<!-- head -->
|
|
<thead>
|
|
<tr>
|
|
<th class="w-[5%]">No</th>
|
|
<th class="w-[85%]">Nama Jenis Nasabah</th>
|
|
<th class="w-[10%]">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>
|
|
<script type="text/javascript">
|
|
var table;
|
|
|
|
$(document).ready(function () {
|
|
table = new DataTable('#example', {
|
|
ajax: '/Dinas/JenisNasabah/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: 'nama' },
|
|
{ data: 'aksi' },
|
|
]
|
|
});
|
|
|
|
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> |