feat: bank sampah nasabah
parent
d50ca719f0
commit
7242c9f7d1
|
|
@ -0,0 +1,262 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BankSampahApp.Controllers.Main
|
||||
{
|
||||
[Route("Main/[controller]/[action]")]
|
||||
public class BankSampahNasabahController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View("~/Views/Main/BankSampahNasabah/Index.cshtml");
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Table()
|
||||
{
|
||||
var data = new[]
|
||||
{
|
||||
new {
|
||||
nama = "RW 09 Kalisari",
|
||||
tgl_pendaftaran = "15 Nov 2023",
|
||||
status = "<div class=\"px-2 py-1 bg-orange-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-orange-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Belum Disetujui</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Siti Nurhaliza",
|
||||
tgl_pendaftaran = "8 Jan 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Budi Santoso",
|
||||
tgl_pendaftaran = "19 Sep 2023",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Nina Sari",
|
||||
tgl_pendaftaran = "3 Des 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Dewi Lestari",
|
||||
tgl_pendaftaran = "27 Apr 2026",
|
||||
status = "<div class=\"px-2 py-1 bg-red-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-red-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Tidak Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Rudi Hartono",
|
||||
tgl_pendaftaran = "11 Jul 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-red-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-red-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Tidak Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Ahmad Yani",
|
||||
tgl_pendaftaran = "2 Feb 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Rina Susanti",
|
||||
tgl_pendaftaran = "18 Mar 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Hendra Gunawan",
|
||||
tgl_pendaftaran = "25 May 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Sari Indah",
|
||||
tgl_pendaftaran = "7 Jun 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-red-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-red-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Tidak Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Taufik Rahman",
|
||||
tgl_pendaftaran = "14 Jul 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Maya Putri",
|
||||
tgl_pendaftaran = "22 Agt 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Bambang Hermanto",
|
||||
tgl_pendaftaran = "5 Sep 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Lina Marlina",
|
||||
tgl_pendaftaran = "11 Okt 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-orange-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-orange-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Belum Disetujui</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Agus Salim",
|
||||
tgl_pendaftaran = "19 Nov 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Wati Suryani",
|
||||
tgl_pendaftaran = "28 Des 2024",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Dedi Kurniawan",
|
||||
tgl_pendaftaran = "4 Jan 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-red-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-red-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Tidak Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Yuni Astuti",
|
||||
tgl_pendaftaran = "12 Feb 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Fajar Hidayat",
|
||||
tgl_pendaftaran = "21 Mar 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Indra Permana",
|
||||
tgl_pendaftaran = "30 Apr 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-orange-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-orange-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Belum Disetujui</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Sri Wahyuni",
|
||||
tgl_pendaftaran = "9 May 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Ahmad Dahlan",
|
||||
tgl_pendaftaran = "16 Jun 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Sinta Dewi",
|
||||
tgl_pendaftaran = "25 Jul 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-red-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-red-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Tidak Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Rian Febrian",
|
||||
tgl_pendaftaran = "3 Agt 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Nurul Aini",
|
||||
tgl_pendaftaran = "10 Sep 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-green-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-green-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Aktif</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
new {
|
||||
nama = "Eko Prasetyo",
|
||||
tgl_pendaftaran = "18 Okt 2025",
|
||||
status = "<div class=\"px-2 py-1 bg-orange-50 rounded-full inline-flex items-center justify-center\"><span class=\"text-orange-600 text-xs font-semibold font-['Plus_Jakarta_Sans']\">Belum Disetujui</span></div>",
|
||||
aksi = "<div class=\"flex gap-2\">" +
|
||||
"<button class=\"p-2 bg-amber-500 rounded-full w-[36px] h-[36px] edit-btn\"><i class=\"ph ph-note-pencil text-white text-sm\"></i></button>" +
|
||||
"<button class=\"p-2 bg-red-500 rounded-full w-[36px] h-[36px] delete-btn\"><i class=\"ph ph-trash text-white text-sm\"></i></button>" +
|
||||
"</div>",
|
||||
},
|
||||
};
|
||||
|
||||
var response = new
|
||||
{
|
||||
data = data
|
||||
};
|
||||
|
||||
return Json(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,246 @@
|
|||
@{
|
||||
ViewData["Title"] = "Bank Sampah 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-gray-900 font-['Plus_Jakarta_Sans']">
|
||||
Daftar Sebagai Bank Sampah
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-sm rounded-full bg-green-800 text-white hover:bg-green-900" onclick="modal_tambah.showModal()">
|
||||
<i class="ph ph-plus"></i>
|
||||
Tambah
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Tambah/Edit Data -->
|
||||
<dialog id="modal_tambah" class="modal modal-bottom sm:modal-middle">
|
||||
<div class="modal-box w-full max-w-3xl p-6 bg-white rounded-2xl">
|
||||
<h3 id="modal_title" class="text-gray-900 text-xl font-semibold font-['Plus_Jakarta_Sans'] leading-8 mb-8">Tambah Bank Sampah Saya</h3>
|
||||
<form id="formTambah" onsubmit="submitForm(event)">
|
||||
<input type="hidden" id="edit_mode" value="false">
|
||||
<div class="flex flex-col gap-6">
|
||||
<!-- Row 1 -->
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<label class="text-slate-800 text-base font-normal font-['Plus_Jakarta_Sans'] leading-6">
|
||||
Kelurahan
|
||||
<span class="text-red-500 text-sm font-semibold">*</span>
|
||||
</label>
|
||||
<select id="kelurahan" class="px-3.5 py-3 bg-white rounded-lg outline outline-1 outline-offset-[-1px] outline-gray-300 text-base font-['Plus_Jakarta_Sans'] text-slate-800 focus:outline-2 focus:outline-green-800" required>
|
||||
<option value="" class="text-gray-400">Pilih salah satu</option>
|
||||
<option value="Kalisari" class="text-slate-800">Kalisari</option>
|
||||
<option value="Pasar Minggu" class="text-slate-800">Pasar Minggu</option>
|
||||
<option value="Cipayung" class="text-slate-800">Cipayung</option>
|
||||
<option value="Ciracas" class="text-slate-800">Ciracas</option>
|
||||
<option value="Cilandak" class="text-slate-800">Cilandak</option>
|
||||
<option value="Cakung" class="text-slate-800">Cakung</option>
|
||||
<option value="Duren Sawit" class="text-slate-800">Duren Sawit</option>
|
||||
<option value="Kebayoran Baru" class="text-slate-800">Kebayoran Baru</option>
|
||||
<option value="Tebet" class="text-slate-800">Tebet</option>
|
||||
<option value="Menteng" class="text-slate-800">Menteng</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Row 2 -->
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<label class="text-slate-800 text-base font-normal font-['Plus_Jakarta_Sans'] leading-6">
|
||||
Daftar Bank Sampah
|
||||
<span class="text-red-500 text-sm font-semibold">*</span>
|
||||
</label>
|
||||
<select id="daftar_bank_sampah" class="px-3.5 py-3 bg-white rounded-lg outline outline-1 outline-offset-[-1px] outline-gray-300 text-base font-['Plus_Jakarta_Sans'] text-slate-800 focus:outline-2 focus:outline-green-800" required>
|
||||
<option value="" class="text-gray-400">Pilih Bank Sampah...</option>
|
||||
<option value="RW 09 Kalisari" class="text-slate-800">RW 09 Kalisari</option>
|
||||
<option value="Berkah Sampah" class="text-slate-800">Berkah Sampah</option>
|
||||
<option value="Pelangi Persada" class="text-slate-800">Pelangi Persada</option>
|
||||
<option value="Eco Makmur" class="text-slate-800">Eco Makmur</option>
|
||||
<option value="Griya Daur Ulang" class="text-slate-800">Griya Daur Ulang</option>
|
||||
<option value="Bank Sampah Induk" class="text-slate-800">Bank Sampah Induk</option>
|
||||
<option value="Ceria Hijau" class="text-slate-800">Ceria Hijau</option>
|
||||
<option value="Hijau Lestari" class="text-slate-800">Hijau Lestari</option>
|
||||
<option value="Sahabat Bumi" class="text-slate-800">Sahabat Bumi</option>
|
||||
<option value="Bersih Sejahtera" class="text-slate-800">Bersih Sejahtera</option>
|
||||
<option value="Karya Mandiri" class="text-slate-800">Karya Mandiri</option>
|
||||
<option value="Bumi Asri" class="text-slate-800">Bumi Asri</option>
|
||||
<option value="Lestari Alam" class="text-slate-800">Lestari Alam</option>
|
||||
<option value="Mandiri Sejahtera" class="text-slate-800">Mandiri Sejahtera</option>
|
||||
<option value="Cahaya Bersih" class="text-slate-800">Cahaya Bersih</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div class="flex flex-col sm:flex-row gap-3 justify-center sm:justify-between mt-4">
|
||||
<button type="button" class="w-full sm:w-auto px-8 py-2.5 bg-white rounded-full outline outline-1 outline-offset-[-1px] outline-gray-300 text-slate-800 text-base font-semibold font-['Plus_Jakarta_Sans'] leading-6 hover:bg-gray-50" onclick="closeModal()">
|
||||
Reset
|
||||
</button>
|
||||
<button type="submit" class="w-full sm:w-auto px-8 py-2.5 bg-green-800 rounded-full text-white text-base font-semibold font-['Plus_Jakarta_Sans'] leading-6 hover:bg-green-900">
|
||||
Terapkan
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<form method="dialog" class="modal-backdrop">
|
||||
<button>close</button>
|
||||
</form>
|
||||
</dialog>
|
||||
<!-- /modal tambah/edit -->
|
||||
|
||||
<div class="h-6"></div>
|
||||
|
||||
<div class="card bg-white shadow-sm">
|
||||
<div class="card-body p-2 sm:p-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<table class="table-zebra table w-full" id="example">
|
||||
<!-- head -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-[10%]">No</th>
|
||||
<th class="w-[40%]">Nama</th>
|
||||
<th class="w-[25%]">Tgl Pendaftaran</th>
|
||||
<th class="w-[15%]">Status</th>
|
||||
<th class="w-[10%]">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</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: '/Main/BankSampahNasabah/Table',
|
||||
scrollX: true,
|
||||
autoWidth: false,
|
||||
responsive: true,
|
||||
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: 'tgl_pendaftaran' },
|
||||
{ data: 'status' },
|
||||
{ data: 'aksi' },
|
||||
]
|
||||
});
|
||||
|
||||
// Delete button handler
|
||||
$('#example').on('click', '.delete-btn', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
Swal.fire({
|
||||
title: 'Apakah anda yakin?',
|
||||
text: "Data yang dihapus tidak dapat dikembalikan lagi",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Ya, Hapus',
|
||||
cancelButtonText: 'Batal',
|
||||
buttonsStyling: false,
|
||||
customClass: {
|
||||
confirmButton: 'btn bg-red-500 text-white hover:bg-red-600 px-4 py-2 rounded-full mr-2',
|
||||
cancelButton: 'btn bg-white text-gray-500 hover:bg-gray-50 px-4 py-2 rounded-full border border-gray-300',
|
||||
},
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
// TODO: Implement actual delete API call
|
||||
Swal.fire({
|
||||
title: 'Terhapus!',
|
||||
text: 'Data berhasil dihapus.',
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK',
|
||||
buttonsStyling: false,
|
||||
customClass: {
|
||||
confirmButton: 'btn bg-green-800 text-white hover:bg-green-900 px-4 py-2 rounded-full',
|
||||
},
|
||||
}).then(() => {
|
||||
// Reload table
|
||||
table.ajax.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Edit button handler
|
||||
$('#example').on('click', '.edit-btn', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Get row data
|
||||
var row = table.row($(this).parents('tr')).data();
|
||||
|
||||
// Set edit mode
|
||||
$('#edit_mode').val('true');
|
||||
$('#modal_title').text('Edit Bank Sampah Saya');
|
||||
|
||||
// Populate form with row data
|
||||
$('#daftar_bank_sampah').val(row.nama);
|
||||
|
||||
// Open modal
|
||||
modal_tambah.showModal();
|
||||
});
|
||||
});
|
||||
|
||||
function closeModal() {
|
||||
// Reset form
|
||||
$('#formTambah')[0].reset();
|
||||
$('#edit_mode').val('false');
|
||||
$('#modal_title').text('Tambah Bank Sampah Saya');
|
||||
|
||||
// Close modal
|
||||
modal_tambah.close();
|
||||
}
|
||||
|
||||
function submitForm(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var isEditMode = $('#edit_mode').val() === 'true';
|
||||
|
||||
// Get form data
|
||||
var kelurahan = $('#kelurahan').val();
|
||||
var daftarBankSampah = $('#daftar_bank_sampah').val();
|
||||
|
||||
// Validate
|
||||
if (!kelurahan || !daftarBankSampah) {
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: 'Mohon lengkapi semua field yang wajib diisi',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK',
|
||||
buttonsStyling: false,
|
||||
customClass: {
|
||||
confirmButton: 'btn bg-green-800 text-white hover:bg-green-900 px-4 py-2 rounded-full',
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Implement form submission logic
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: isEditMode ? 'Data berhasil diperbarui' : 'Data berhasil ditambahkan',
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK',
|
||||
buttonsStyling: false,
|
||||
customClass: {
|
||||
confirmButton: 'btn bg-green-800 text-white hover:bg-green-900 px-4 py-2 rounded-full',
|
||||
},
|
||||
}).then(() => {
|
||||
closeModal();
|
||||
|
||||
// Reload table
|
||||
table.ajax.reload();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
@ -155,12 +155,6 @@
|
|||
Profil
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-controller="ProfilNasabah" asp-action="Index" class="rounded-full @(controller == "ProfilNasabah" ? "menu-active" : "")">
|
||||
<i class="ph ph-user-circle me-2 text-lg"></i>
|
||||
Profil Nasabah
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Aktifitas -->
|
||||
<li>
|
||||
|
|
@ -177,6 +171,22 @@
|
|||
Manajemen User
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Nasabah -->
|
||||
<li>
|
||||
<a asp-controller="ProfilNasabah" asp-action="Index" class="rounded-full @(controller == "ProfilNasabah" ? "menu-active" : "")">
|
||||
<i class="ph ph-user-circle me-2 text-lg"></i>
|
||||
Profil Nasabah
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<!-- Bank Sampah Nasabah -->
|
||||
<li>
|
||||
<a asp-controller="BankSampahNasabah" asp-action="Index" class="rounded-full @(controller == "BankSampahNasabah" ? "menu-active" : "")">
|
||||
<i class="ph ph-bank me-2 text-lg"></i>
|
||||
Bank Sampah Nasabah
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue