feat: create a page for TPS3R & Waste Collection Parking locations and add locations
parent
9ff34f0b03
commit
af0643f51e
|
|
@ -0,0 +1,108 @@
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace BpsRwApp.Controllers
|
||||||
|
{
|
||||||
|
[Route("[controller]/[action]")]
|
||||||
|
public class LokasiController : AppControllerBase
|
||||||
|
{
|
||||||
|
public IActionResult Index()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult Table()
|
||||||
|
{
|
||||||
|
var data = new[]
|
||||||
|
{
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi G",
|
||||||
|
alamat = "Perumahan Mawar Indah",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Larasati Wulandari",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi I",
|
||||||
|
alamat = "Jl. Bougenville, RT 02",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Arya Dwipangga",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi F",
|
||||||
|
alamat = "Lingk. Edelweiss, No. 7",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Kirana Lazuardi",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi C",
|
||||||
|
alamat = "Jl. Anggrek No. 14",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Bagas Priambodo",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi B",
|
||||||
|
alamat = "Jl. Tulip, Kel. Gardenia",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Raisa Adiwangsa",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi E",
|
||||||
|
alamat = "Jl. Lavender, RT 09",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Satria Gunawan",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi A",
|
||||||
|
alamat = "Komp. Melati, No. 22",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Kartika Hastuti",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi D",
|
||||||
|
alamat = "Gg. Dahlia, RT 05",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Bayu Anggoro",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi H",
|
||||||
|
alamat = "Ds. Cempaka, Kab. Anyer",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Citra Kirani",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
new {
|
||||||
|
usulan = "Lokasi J",
|
||||||
|
alamat = "Jl. Kenanga, Blok C",
|
||||||
|
statusLahan = "Inventaris",
|
||||||
|
pemilikLahan = "Galih Prasetya",
|
||||||
|
luasLahan = 500,
|
||||||
|
statusUsulan = "Aktif"
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
var response = new
|
||||||
|
{
|
||||||
|
data = data
|
||||||
|
};
|
||||||
|
|
||||||
|
return Json(response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Lokasi TP3SR & Parkir Pengumpulan Sampah";
|
||||||
|
}
|
||||||
|
|
||||||
|
<!-- Breadcrumb -->
|
||||||
|
<div class="breadcrumbs text-sm">
|
||||||
|
<ul>
|
||||||
|
<li class="text-gray-500"><a>Profil RW</a></li>
|
||||||
|
<li id="breadcrumb-active">Lokasi TP3SR & Parkir Pengumpulan Sampah</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Header -->
|
||||||
|
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
|
||||||
|
<div class="prose">
|
||||||
|
<h3 class="mb-2">Profil Rw</h3>
|
||||||
|
</div>
|
||||||
|
<div class="justify-self-end lg:self-center">
|
||||||
|
<label for="modal-tambah"
|
||||||
|
class="btn rounded-full bg-green-600 hover:bg-green-700 text-white border-0 shadow-sm transition duration-200">
|
||||||
|
<span class="icon icon-fill me-2">add</span>
|
||||||
|
Tambah
|
||||||
|
</label>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="h-8"></div>
|
||||||
|
|
||||||
|
<!-- Tabs -->
|
||||||
|
<div class="tabs tabs-lift">
|
||||||
|
<input type="radio" name="tab_profil_rw" class="tab checked:text-white [--tab-bg:green]" aria-label="Profil" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0"></div>
|
||||||
|
|
||||||
|
<input type="radio" name="tab_profil_rw" class="tab checked:text-white [--tab-bg:green]" aria-label="BPS-RW" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0"></div>
|
||||||
|
|
||||||
|
<input type="radio" name="tab_profil_rw" class="tab checked:text-white [--tab-bg:green]" aria-label="Surat Usulan" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0"></div>
|
||||||
|
|
||||||
|
<input type="radio" name="tab_profil_rw" class="tab checked:text-white [--tab-bg:green]" aria-label="Pengadaan Wadah" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0"></div>
|
||||||
|
|
||||||
|
<input type="radio" name="tab_profil_rw" class="tab checked:text-white [--tab-bg:green]" aria-label="Kebutuhan Sarpras" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0"></div>
|
||||||
|
|
||||||
|
<input type="radio" name="tab_profil_rw" checked class="tab checked:text-white [--tab-bg:green]" aria-label="Lokasi TP3SR & Parkir Pengumpulan Sampah" />
|
||||||
|
<div class="tab-content bg-base-100 border-base-300 p-0">
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
<table class="table table-zebra w-full text-sm" id="lokasiTable">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="w-[5%]">No</th>
|
||||||
|
<th class="w-[10%]">Usulan</th>
|
||||||
|
<th class="w-[20%]">Alamat Lokasi</th>
|
||||||
|
<th class="w-[10%]">Status Lahan</th>
|
||||||
|
<th class="w-[20%]">Pemilik Lahan</th>
|
||||||
|
<th class="w-[10%]">Luas Lahan</th>
|
||||||
|
<th class="w-[10%]">Status Usulan</th>
|
||||||
|
<th class="w-[15%] text-center">Aksi</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Modal adding location -->
|
||||||
|
@await Html.PartialAsync("_ModalTambah")
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.7.1.js"></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">
|
||||||
|
$(document).ready(function () {
|
||||||
|
// Datatable setup
|
||||||
|
const table = new DataTable('#lokasiTable', {
|
||||||
|
ajax: '@Url.Action("Table", "Lokasi")',
|
||||||
|
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: 'usulan' },
|
||||||
|
{ data: 'alamat' },
|
||||||
|
{ data: 'statusLahan' },
|
||||||
|
{ data: 'pemilikLahan' },
|
||||||
|
{ data: 'luasLahan' },
|
||||||
|
{
|
||||||
|
data: 'statusUsulan',
|
||||||
|
render: (data) => `
|
||||||
|
<span class="badge bg-green-100 text-green-700 px-3 py-1 rounded-full text-xs font-medium">
|
||||||
|
${data}
|
||||||
|
</span>`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: null,
|
||||||
|
className: "text-center",
|
||||||
|
render: () => `
|
||||||
|
<div class="flex justify-center gap-2">
|
||||||
|
<button class="btn btn-xs bg-gray-200 text-gray-800 rounded-full hover:bg-gray-300">Detail</button>
|
||||||
|
<button class="btn btn-xs bg-blue-500 text-white rounded-full hover:bg-blue-600">Edit</button>
|
||||||
|
<button class="btn btn-xs bg-red-500 text-white rounded-full hover:bg-red-600">Hapus</button>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
orderable: false,
|
||||||
|
searchable: false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// Breadcrumbs update on tab change
|
||||||
|
const updateBreadcrumbs = () => {
|
||||||
|
const activeTab = $('input[name="tab_profil_rw"]:checked');
|
||||||
|
$('#breadcrumb-active').text(activeTab.attr('aria-label'));
|
||||||
|
};
|
||||||
|
|
||||||
|
updateBreadcrumbs();
|
||||||
|
$('input[name="tab_profil_rw"]').on('change', updateBreadcrumbs);
|
||||||
|
|
||||||
|
// Form submission
|
||||||
|
$('#formTambahLokasi').on('submit', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
const data = $(this).serialize();
|
||||||
|
|
||||||
|
$.post('@Url.Action("Create", "Lokasi")', data, function () {
|
||||||
|
table.ajax.reload();
|
||||||
|
$('#modal-tambah').prop('checked', false);
|
||||||
|
$('#formTambahLokasi')[0].reset();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
<input type="checkbox" id="modal-tambah" class="modal-toggle" />
|
||||||
|
|
||||||
|
<div class="modal" role="dialog">
|
||||||
|
<div class="modal-box w-full max-w-md rounded-2xl shadow-lg relative">
|
||||||
|
<!-- Close Button -->
|
||||||
|
<label for="modal-tambah"
|
||||||
|
class="btn btn-sm btn-circle btn-ghost absolute right-3 top-3">
|
||||||
|
✕
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<!-- Header -->
|
||||||
|
<h3 class="text-lg font-semibold mb-5 text-gray-800">Tambah Lokasi</h3>
|
||||||
|
|
||||||
|
<!-- Form -->
|
||||||
|
<form id="formTambahLokasi" class="space-y-4">
|
||||||
|
<!-- Jenis Usulan -->
|
||||||
|
<div>
|
||||||
|
<label class="label font-semibold text-sm text-gray-700">Jenis Usulan</label>
|
||||||
|
<select class="select select-bordered w-full" name="jenisUsulan" required>
|
||||||
|
<option value="">Pilih jenis usulan</option>
|
||||||
|
<option value="TP3SR">TP3SR</option>
|
||||||
|
<option value="Parkir Pengumpulan">Parkir Pengumpulan</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Alamat -->
|
||||||
|
<div>
|
||||||
|
<label class="label font-semibold text-sm text-gray-700">Alamat</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input input-bordered w-full"
|
||||||
|
name="alamat"
|
||||||
|
placeholder="Masukkan alamat"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Nama Pemilik -->
|
||||||
|
<div>
|
||||||
|
<label class="label font-semibold text-sm text-gray-700">Nama Pemilik Lahan</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input input-bordered w-full"
|
||||||
|
name="pemilikLahan"
|
||||||
|
placeholder="Masukkan nama pemilik"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Status & Luas Lahan -->
|
||||||
|
<div class="grid grid-cols-2 gap-3">
|
||||||
|
<div>
|
||||||
|
<label class="label font-semibold text-sm text-gray-700">Status Lahan</label>
|
||||||
|
<select class="select select-bordered w-full" name="statusLahan" required>
|
||||||
|
<option value="">Pilih status lahan</option>
|
||||||
|
<option value="Milik Pemda">Milik Pemda</option>
|
||||||
|
<option value="Milik Warga">Milik Warga</option>
|
||||||
|
<option value="Sewa">Sewa</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="label font-semibold text-sm text-gray-700">Luas Lahan</label>
|
||||||
|
<input
|
||||||
|
type="number"
|
||||||
|
class="input input-bordered w-full"
|
||||||
|
name="luasLahan"
|
||||||
|
placeholder="Masukkan luas lahan"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Keterangan -->
|
||||||
|
<div>
|
||||||
|
<label class="label font-semibold text-sm text-gray-700">Keterangan</label>
|
||||||
|
<textarea
|
||||||
|
class="textarea textarea-bordered w-full"
|
||||||
|
name="keterangan"
|
||||||
|
placeholder="Keterangan"
|
||||||
|
rows="3"
|
||||||
|
></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Action Button -->
|
||||||
|
<div class="modal-action mt-6 flex justify-end gap-3">
|
||||||
|
<label for="modal-tambah"
|
||||||
|
class="btn btn-outline btn-sm flex items-center gap-2">
|
||||||
|
✕ Batalkan
|
||||||
|
</label>
|
||||||
|
<button type="submit"
|
||||||
|
class="btn btn-success btn-sm text-white flex items-center gap-2">
|
||||||
|
✓ Simpan
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -9,14 +9,19 @@
|
||||||
@{
|
@{
|
||||||
var controller = (ViewContext.RouteData.Values["controller"] as string) ?? string.Empty;
|
var controller = (ViewContext.RouteData.Values["controller"] as string) ?? string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a asp-controller="Dashboard" asp-action="Index" class="@(controller == "Dashboard" ? "menu-active" : "")">
|
<a asp-controller="Dashboard" asp-action="Index" class="@(controller == "Dashboard" ? "menu-active" : "")">
|
||||||
<span class="icon icon-fill">analytics</span>
|
<span class="icon icon-fill">analytics</span>
|
||||||
Dashboard
|
Dashboard
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a asp-controller="Lokasi" asp-action="Index" class="@(controller == "Lokasi" ? "menu-active" : "")">
|
||||||
|
<span class="material-symbols-outlined text-[20px]">account_box</span>
|
||||||
|
Profil RW
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<details @(new[] { "RumahMemilah", "DataSudinChecklistHarian" }.Contains(controller) ? "open" : "")>
|
<details @(new[] { "RumahMemilah", "DataSudinChecklistHarian" }.Contains(controller) ? "open" : "")>
|
||||||
<summary>DATA SUDIN</summary>
|
<summary>DATA SUDIN</summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue