56 lines
1.5 KiB
C#
56 lines
1.5 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BpsRwApp.Controllers
|
|
{
|
|
[Route("[controller]/[action]")]
|
|
public class LaporanRwRwController : AppControllerBase
|
|
{
|
|
public IActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[HttpGet]
|
|
public IActionResult Create()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[HttpGet]
|
|
public IActionResult Table()
|
|
{
|
|
var startMonth = new DateTime(2023, 1, 1);
|
|
|
|
var data = Enumerable.Range(0, 100)
|
|
.Select(index =>
|
|
{
|
|
var bulan = ControllerSampleData.FormatBulanDenganTahun(startMonth.AddMonths(index));
|
|
var status = index % 5 == 0
|
|
? "<div class=\"badge badge-error badge-soft rounded-full\">Belum Diverifikasi</div>"
|
|
: "<div class=\"badge badge-success badge-soft rounded-full\">Verifikasi</div>";
|
|
|
|
return new
|
|
{
|
|
bulan,
|
|
rumah_aktif_memilah = 420 + (index * 8 % 350),
|
|
status,
|
|
gambar = "<a href='/LaporanRwRw/Detail' class='btn bg-white rounded-full btn-sm'>Lihat Gambar</a>"
|
|
};
|
|
})
|
|
.ToArray();
|
|
|
|
var response = new
|
|
{
|
|
data = data
|
|
};
|
|
|
|
return Json(response);
|
|
}
|
|
[HttpGet]
|
|
public IActionResult Detail()
|
|
{
|
|
return View();
|
|
}
|
|
}
|
|
}
|