111 lines
3.7 KiB
Plaintext
111 lines
3.7 KiB
Plaintext
@{
|
|
ViewData["Title"] = "Data Offtaker";
|
|
}
|
|
|
|
<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">
|
|
Data Offtaker
|
|
</span>
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-2 md:flex-row">
|
|
<button class="btn btn-sm max-w-full rounded-full bg-white" onclick="modal_download.showModal()">
|
|
<i class="ph ph-download"></i>
|
|
Download
|
|
</button>
|
|
<button class="btn btn-sm bg-bank-sampah-primary-500 max-w-full rounded-full text-white">
|
|
<i class="ph ph-plus"></i>
|
|
Tambah Offtaker
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal Download -->
|
|
<dialog id="modal_download" class="modal modal-bottom sm:modal-middle">
|
|
<div class="modal-box w-full sm:max-w-sm">
|
|
<form method="dialog">
|
|
<button class="btn btn-sm btn-circle btn-ghost absolute top-2 right-2">✕</button>
|
|
</form>
|
|
<h3 class="text-lg font-bold">Download Data</h3>
|
|
<form action="#" method="get">
|
|
<fieldset class="fieldset">
|
|
<legend class="fieldset-legend">Jumlah Nasabah</legend>
|
|
<select class="select w-full">
|
|
<option disabled selected>Semua</option>
|
|
</select>
|
|
</fieldset>
|
|
<div class="modal-action">
|
|
<button type="submit" class="btn bg-bank-sampah-primary-500 w-full rounded-full text-white">Download</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</dialog>
|
|
<!-- /modal download -->
|
|
|
|
<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>No</th>
|
|
<th>Nama Offtaker</th>
|
|
<th>Kabupaten</th>
|
|
<th>Kecamatan</th>
|
|
<th>Status</th>
|
|
<th>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/DataNasabah/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: 'kabupaten' },
|
|
{ data: 'kecamatan' },
|
|
{ data: 'status' },
|
|
{ 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> |