diff --git a/Views/Data/Aktivitas/Index.cshtml b/Views/Data/Aktivitas/Index.cshtml
index 6137925..2075943 100644
--- a/Views/Data/Aktivitas/Index.cshtml
+++ b/Views/Data/Aktivitas/Index.cshtml
@@ -203,157 +203,158 @@
-
-
-
+
+ // Update Fasilitas - tampilkan dalam satu baris
+ if (currentData.fasilitas && currentData.fasilitas.length > 0) {
+ const fasilitasHtml = currentData.fasilitas.map(item =>
+ `
${item}
`
+ ).join('');
+ $('#viewFasilitas').html(fasilitasHtml);
+ } else {
+ $('#viewFasilitas').html('-
');
+ }
+
+ // Update Jenis Pengolahan - tampilkan dalam satu baris
+ if (currentData.jenis_pengolahan && currentData.jenis_pengolahan.length > 0) {
+ const jenisPengolahanHtml = currentData.jenis_pengolahan.map(item =>
+ `${item}
`
+ ).join('');
+ $('#viewJenisPengolahan').html(jenisPengolahanHtml);
+ } else {
+ $('#viewJenisPengolahan').html('-
');
+ }
+ }
+
+ function toggleEditMode() {
+ $('#viewMode').addClass('hidden');
+ $('#editMode').removeClass('hidden').addClass('flex');
+
+ // Set checkboxes based on current data
+ $('input[name="aktivitas"]').each(function() {
+ $(this).prop('checked', currentData.aktivitas.includes($(this).val()));
+ });
+ $('input[name="fasilitas"]').each(function() {
+ $(this).prop('checked', currentData.fasilitas.includes($(this).val()));
+ });
+ $('input[name="jenis_pengolahan"]').each(function() {
+ $(this).prop('checked', currentData.jenis_pengolahan.includes($(this).val()));
+ });
+ }
+
+ function cancelEdit() {
+ $('#editMode').addClass('hidden').removeClass('flex');
+ $('#viewMode').removeClass('hidden');
+ }
+
+ function saveData() {
+ // Collect checked values
+ const aktivitas = [];
+ $('input[name="aktivitas"]:checked').each(function() {
+ aktivitas.push($(this).val());
+ });
+
+ const fasilitas = [];
+ $('input[name="fasilitas"]:checked').each(function() {
+ fasilitas.push($(this).val());
+ });
+
+ const jenisPengolahan = [];
+ $('input[name="jenis_pengolahan"]:checked').each(function() {
+ jenisPengolahan.push($(this).val());
+ });
+
+ // Send to server
+ $.ajax({
+ url: '/Data/Aktivitas/Save',
+ type: 'POST',
+ contentType: 'application/json',
+ data: JSON.stringify({
+ Aktivitas: aktivitas,
+ Fasilitas: fasilitas,
+ JenisPengolahan: jenisPengolahan
+ }),
+ success: function(response) {
+ if (response.success) {
+ Swal.fire({
+ title: 'Berhasil!',
+ text: response.message,
+ 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(() => {
+ // Update current data and switch to view mode
+ currentData = {
+ aktivitas: aktivitas,
+ fasilitas: fasilitas,
+ jenis_pengolahan: jenisPengolahan
+ };
+ updateViewMode();
+ cancelEdit();
+ });
+ }
+ },
+ error: function() {
+ Swal.fire({
+ title: 'Error!',
+ text: 'Gagal menyimpan data',
+ icon: 'error',
+ confirmButtonText: 'OK',
+ buttonsStyling: false,
+ customClass: {
+ confirmButton: 'btn bg-green-800 text-white hover:bg-green-900 px-4 py-2 rounded-full',
+ },
+ });
+ }
+ });
+ }
+
+}
diff --git a/Views/Data/BankSampahInduk/Index.cshtml b/Views/Data/BankSampahInduk/Index.cshtml
index 08efd79..d74781f 100644
--- a/Views/Data/BankSampahInduk/Index.cshtml
+++ b/Views/Data/BankSampahInduk/Index.cshtml
@@ -98,149 +98,148 @@
-
-
-
-
-
+
+ var isEditMode = $('#edit_mode').val() === 'true';
+
+ // 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();
+ });
+ }
+
+}
diff --git a/Views/Data/HargaSampah/Index.cshtml b/Views/Data/HargaSampah/Index.cshtml
index 38b03f6..f2db3fc 100644
--- a/Views/Data/HargaSampah/Index.cshtml
+++ b/Views/Data/HargaSampah/Index.cshtml
@@ -82,119 +82,118 @@
-
-
-
-
-
+
+ var isEditMode = $('#edit_mode').val() === 'true';
+
+ // 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();
+ });
+ }
+
+}
diff --git a/Views/Data/Nasabah/Index.cshtml b/Views/Data/Nasabah/Index.cshtml
index a1851ec..ab31ab0 100644
--- a/Views/Data/Nasabah/Index.cshtml
+++ b/Views/Data/Nasabah/Index.cshtml
@@ -118,158 +118,157 @@
-
-
-
-
-
+
+ var isEditMode = $('#edit_mode').val() === 'true';
+
+ // 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();
+ });
+ }
+
+}
diff --git a/Views/Data/Offtaker/Index.cshtml b/Views/Data/Offtaker/Index.cshtml
index 894971c..ec6f009 100644
--- a/Views/Data/Offtaker/Index.cshtml
+++ b/Views/Data/Offtaker/Index.cshtml
@@ -2,10 +2,6 @@
ViewData["Title"] = "Offtaker Sampah";
}
-@section Styles {
-
-}
-
-
-
-
-
-
+ // Reload table
+ table.ajax.reload();
+ });
+ }
+
+}
diff --git a/Views/Main/BankSampah/Index.cshtml b/Views/Main/BankSampah/Index.cshtml
index 2ae6d70..ae010f8 100644
--- a/Views/Main/BankSampah/Index.cshtml
+++ b/Views/Main/BankSampah/Index.cshtml
@@ -194,152 +194,151 @@
-
-
-
-
-
+
+ var isEditMode = $('#edit_mode').val() === 'true';
+
+ // 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();
+ });
+ }
+
+}
diff --git a/Views/Main/BankSampahNasabah/Index.cshtml b/Views/Main/BankSampahNasabah/Index.cshtml
index d4c32d3..49ebf11 100644
--- a/Views/Main/BankSampahNasabah/Index.cshtml
+++ b/Views/Main/BankSampahNasabah/Index.cshtml
@@ -112,135 +112,134 @@
-
-
-
-
-
+
+}
diff --git a/Views/Main/Composting/Index.cshtml b/Views/Main/Composting/Index.cshtml
index 107e76c..74dd36d 100644
--- a/Views/Main/Composting/Index.cshtml
+++ b/Views/Main/Composting/Index.cshtml
@@ -207,155 +207,154 @@
-
-
-
-
-
+
+ function convertDateToInput(dateStr) {
+ // Convert "15 Mar 2024" to "2024-03-15"
+ const monthMap = {
+ 'Jan': '01', 'Feb': '02', 'Mar': '03', 'Apr': '04',
+ 'Mei': '05', 'Jun': '06', 'Jul': '07', 'Agt': '08',
+ 'Sep': '09', 'Okt': '10', 'Nov': '11', 'Des': '12'
+ };
+
+ const parts = dateStr.split(' ');
+ const day = parts[0].padStart(2, '0');
+ const month = monthMap[parts[1]];
+ const year = parts[2];
+
+ return `${year}-${month}-${day}`;
+ }
+
+ function closeModal() {
+ // Reset form
+ $('#formTambah')[0].reset();
+ $('#edit_mode').val('false');
+ $('#modal_title').text('Tambah Transaksi BSI');
+ modal_tambah.close();
+ }
+
+ function submitForm(e) {
+ e.preventDefault();
+
+ var isEditMode = $('#edit_mode').val() === 'true';
+
+ // TODO: Implement actual save/update API call here
+ // For now, just show success message
+
+ Swal.fire({
+ title: 'Berhasil!',
+ text: isEditMode ? 'Data berhasil diperbarui.' : 'Data berhasil ditambahkan.',
+ icon: 'success',
+ confirmButtonColor: '#166534',
+ confirmButtonText: 'OK',
+ customClass: {
+ confirmButton: 'btn bg-green-800 text-white hover:bg-green-900 border-0'
+ },
+ buttonsStyling: false
+ }).then(() => {
+ closeModal();
+
+ // Reload table
+ table.ajax.reload();
+ });
+ }
+
+}
diff --git a/Views/Main/DataBankSampah/Index.cshtml b/Views/Main/DataBankSampah/Index.cshtml
index 422fd67..b9cd022 100644
--- a/Views/Main/DataBankSampah/Index.cshtml
+++ b/Views/Main/DataBankSampah/Index.cshtml
@@ -199,165 +199,163 @@
-
-
-
-
-
\ No newline at end of file
+ modal_filter.close();
+ }
+
+}
\ No newline at end of file
diff --git a/Views/Main/DataNasabah/Index.cshtml b/Views/Main/DataNasabah/Index.cshtml
index 1387c39..739aec1 100644
--- a/Views/Main/DataNasabah/Index.cshtml
+++ b/Views/Main/DataNasabah/Index.cshtml
@@ -202,128 +202,126 @@
-
-
-
-
-
+ // Reload table
+ table.ajax.reload();
+ });
+ }
+
+}
diff --git a/Views/Main/DataOfftaker/Index.cshtml b/Views/Main/DataOfftaker/Index.cshtml
index 1e5f044..4936052 100644
--- a/Views/Main/DataOfftaker/Index.cshtml
+++ b/Views/Main/DataOfftaker/Index.cshtml
@@ -152,122 +152,120 @@
-
-
-
-
-
+ // Reload table
+ table.ajax.reload();
+ });
+ }
+
+}
diff --git a/Views/Main/Maggot/Index.cshtml b/Views/Main/Maggot/Index.cshtml
index 79a8ed7..d8ec9d4 100644
--- a/Views/Main/Maggot/Index.cshtml
+++ b/Views/Main/Maggot/Index.cshtml
@@ -186,150 +186,148 @@
-
-
-
-
-
+ // Reload table
+ table.ajax.reload();
+ });
+ }
+
+}
diff --git a/Views/Main/ReduksiSampah/Index.cshtml b/Views/Main/ReduksiSampah/Index.cshtml
index 13241dc..9cfa6f0 100644
--- a/Views/Main/ReduksiSampah/Index.cshtml
+++ b/Views/Main/ReduksiSampah/Index.cshtml
@@ -35,29 +35,29 @@
-
-
-
-
+
+}
diff --git a/Views/Main/TransaksiNasabah/Index.cshtml b/Views/Main/TransaksiNasabah/Index.cshtml
index 0359be6..8b36a1f 100644
--- a/Views/Main/TransaksiNasabah/Index.cshtml
+++ b/Views/Main/TransaksiNasabah/Index.cshtml
@@ -121,160 +121,159 @@
-
-
-
-
-
+
+}
diff --git a/Views/Master/Aktivitas/Index.cshtml b/Views/Master/Aktivitas/Index.cshtml
index 87f6c00..d223686 100644
--- a/Views/Master/Aktivitas/Index.cshtml
+++ b/Views/Master/Aktivitas/Index.cshtml
@@ -69,10 +69,8 @@
-
-
-
-
+
+@section Scripts {
\ No newline at end of file
+
+}
diff --git a/Views/Master/Artikel/Index.cshtml b/Views/Master/Artikel/Index.cshtml
index 91d29fb..05716a6 100644
--- a/Views/Master/Artikel/Index.cshtml
+++ b/Views/Master/Artikel/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/BadanHukum/Index.cshtml b/Views/Master/BadanHukum/Index.cshtml
index 1297b24..2e2fa20 100644
--- a/Views/Master/BadanHukum/Index.cshtml
+++ b/Views/Master/BadanHukum/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/Fasilitas/Index.cshtml b/Views/Master/Fasilitas/Index.cshtml
index fd5d103..5d29188 100644
--- a/Views/Master/Fasilitas/Index.cshtml
+++ b/Views/Master/Fasilitas/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/JenisBankSampah/Index.cshtml b/Views/Master/JenisBankSampah/Index.cshtml
index e958dbb..320442d 100644
--- a/Views/Master/JenisBankSampah/Index.cshtml
+++ b/Views/Master/JenisBankSampah/Index.cshtml
@@ -71,113 +71,111 @@
-
-
-
-
-
+ // Reload table
+ table.ajax.reload();
+ });
+ }
+
+}
diff --git a/Views/Master/JenisNasabah/Index.cshtml b/Views/Master/JenisNasabah/Index.cshtml
index 531e5a9..351c3b4 100644
--- a/Views/Master/JenisNasabah/Index.cshtml
+++ b/Views/Master/JenisNasabah/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/JenisPengolahan/Index.cshtml b/Views/Master/JenisPengolahan/Index.cshtml
index f279bbc..dacd255 100644
--- a/Views/Master/JenisPengolahan/Index.cshtml
+++ b/Views/Master/JenisPengolahan/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/JenisSampah/Index.cshtml b/Views/Master/JenisSampah/Index.cshtml
index 2c7e6db..9325ca6 100644
--- a/Views/Master/JenisSampah/Index.cshtml
+++ b/Views/Master/JenisSampah/Index.cshtml
@@ -71,113 +71,111 @@
-
-
-
-
-
+ // Reload table
+ table.ajax.reload();
+ });
+ }
+
+}
diff --git a/Views/Master/Kategori/Index.cshtml b/Views/Master/Kategori/Index.cshtml
index 4fb17d1..b998e59 100644
--- a/Views/Master/Kategori/Index.cshtml
+++ b/Views/Master/Kategori/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/KategoriFasilitas/Index.cshtml b/Views/Master/KategoriFasilitas/Index.cshtml
index 6c6708a..172dc2d 100644
--- a/Views/Master/KategoriFasilitas/Index.cshtml
+++ b/Views/Master/KategoriFasilitas/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/KategoriSampah/Index.cshtml b/Views/Master/KategoriSampah/Index.cshtml
index c942974..ff21a2a 100644
--- a/Views/Master/KategoriSampah/Index.cshtml
+++ b/Views/Master/KategoriSampah/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/Mitra/Index.cshtml b/Views/Master/Mitra/Index.cshtml
index 5d09cc0..f45b3a0 100644
--- a/Views/Master/Mitra/Index.cshtml
+++ b/Views/Master/Mitra/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/StatusLahan/Index.cshtml b/Views/Master/StatusLahan/Index.cshtml
index de70304..a541416 100644
--- a/Views/Master/StatusLahan/Index.cshtml
+++ b/Views/Master/StatusLahan/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Master/SubKategoriSampah/Index.cshtml b/Views/Master/SubKategoriSampah/Index.cshtml
index da91e66..0eb75a9 100644
--- a/Views/Master/SubKategoriSampah/Index.cshtml
+++ b/Views/Master/SubKategoriSampah/Index.cshtml
@@ -71,10 +71,8 @@
-
-
-
-
+
+@section Scripts {
+}
diff --git a/Views/Shared/_LayoutApp.cshtml b/Views/Shared/_LayoutApp.cshtml
index ac209ff..8cad2ac 100644
--- a/Views/Shared/_LayoutApp.cshtml
+++ b/Views/Shared/_LayoutApp.cshtml
@@ -38,6 +38,7 @@
+
@await RenderSectionAsync("Styles", required: false)
@@ -62,6 +63,10 @@
+
+
+
+
@await RenderSectionAsync("Scripts", required: false)