🎨 refactor(ui): perbaikan styling form penilai & optimasi dashboard role-based

- Form Penilai: hapus spasi ganda di class CSS input currency/currency-format
- Konsistensi class Tailwind: gunakan "w-full currency" & "w-full currency-format"
- Hapus console.log tidak perlu, tambah debug log untuk parsing luas
- Optimasi parsing input luas dengan parseFloat + regex sanitasi numerik
- Dashboard: tambahkan pembatasan akses berdasarkan role (!penilai, !surveyor, !pemohon-ao, !pemohon-eo)
- Perbaiki struktur HTML & urutan class Tailwind (grid, flex, spacing, alignment)
- Optimalkan layout header, stats cards, & tabel dengan class yang konsisten
- Hapus class CSS redundan & perbaiki konsistensi penamaan
- Tingkatkan keamanan & UX dengan role-based access + struktur HTML lebih maintainable
This commit is contained in:
Daeng Deni Mardaeni
2025-09-26 10:55:27 +07:00
parent e3540a1dd6
commit a1b9b7af86
6 changed files with 452 additions and 437 deletions

View File

@@ -142,7 +142,7 @@
<label for="province" class="input">
<i class="">Rp
</i>
<input type="text" class="w-full currency-format" id="total_nilai_pasar_wajar"
<input type="text" class="w-full currency-format" id="total_nilai_pasar_wajar"
name="total_nilai_pasar_wajar"
value="{{ old('total_nilai_pasar_wajar', $lpjData['total_nilai_pasar_wajar'] ?? null) }}">
</label>
@@ -167,7 +167,7 @@
<div class="w-full">
<label class="input">
<input type="text" id="likuidasi" name="likuidasi" class="w-full currency"
<input type="text" id="likuidasi" name="likuidasi" class="w-full currency"
value="{{ old('likuidasi', $lpjData['likuidasi'] ?? null) }}"
oninput="calculateTotal()">
<i class="">%
@@ -182,7 +182,7 @@
<label class="input">
<i class="">Rp
</i>
<input type="text" class="w-full currency-format" id="likuidasi_nilai_1"
<input type="text" class="w-full currency-format" id="likuidasi_nilai_1"
name="likuidasi_nilai_1"
value="{{ old('likuidasi_nilai_1', $lpjData['likuidasi_nilai_1'] ?? null) }}"
oninput="calculateTotal()">
@@ -194,7 +194,7 @@
<label class="input">
<i class="">Rp
</i>
<input type="text" class="w-full currency-format" name="likuidasi_nilai_2"
<input type="text" class="w-full currency-format" name="likuidasi_nilai_2"
value="{{ old('likuidasi_nilai_2', $lpjData['likuidasi_nilai_2'] ?? null) }}">
</div>
@@ -278,7 +278,7 @@
</i>
<input type="text"
id="nilai_npw_${npwCounter}_1"
class="w-full currency"
class="w-full currency"
name="nilai_npw_${npwCounter}_1"
placeholder="Harga per meter"
oninput="calculateTotal()">
@@ -358,7 +358,7 @@
</i>
<input type="text"
id="nilai_npw_${npwCounter}_1"
class="w-full currency"
class="w-full currency"
name="nilai_npw_${npwCounter}_1"
placeholder="Harga per meter"
value="${npw.nilai_1 || ''}"
@@ -371,7 +371,7 @@
</i>
<input type="text"
id="nilai_npw_${npwCounter}_2"
class="w-full currency-format"
class="w-full currency-format"
name="nilai_npw_${npwCounter}_2"
placeholder="Total Nilai"
value="${npw.nilai_2 || ''}"
@@ -470,15 +470,14 @@
kategoriItems.forEach(item => {
console.log(item);
const kategori = item.id.replace('luas_', '');
const luasInput = document.getElementById(`luas_${kategori}`);
const nilaiInput = document.querySelector(`input[name="nilai_${kategori}_1"]`);
const outputElement = document.querySelector(`input[name="nilai_${kategori}_2"]`);
if (luasInput && nilaiInput && outputElement) {
const luas = parseInput(luasInput.value);
const luas = parseFloat(luasInput.value.replace(/[^0-9.]/g, '')) || 0;
console.log("a", luas);
const nilai = parseInput(nilaiInput.value);
const hasil = luas * nilai;

View File

@@ -1,139 +1,142 @@
@extends('layouts.main')
@section('content')
<div class="w-full grid gap-6 mx-auto">
<!-- Header Section -->
<div class="flex flex-wrap items-center lg:items-end justify-between gap-5 pb-8">
<div class="flex flex-col justify-center gap-3">
<h1 class="text-2xl font-bold leading-none text-gray-800">
Dashboard
</h1>
<div class="flex items-center gap-2 text-sm font-medium text-gray-600">
<i class="ki-filled ki-clipboard"></i>
Selamat datang, <span class="text-primary font-semibold">{{ auth()->user()->name }}</span>
</div>
</div>
<div class="flex items-center gap-3 w-[30%]">
<div class="flex items-center gap-2 w-full">
<input type="date" class="input" name="start_date" id="start_date">
<input type="date" class="input" name="end_date" id="end_date">
</div>
<button class="btn btn-primary" id="filter" type="button" onclick="filterDashboard()">
<i class="ki-outline ki-filter fs-2 me-1"></i>
Filter</button>
</div>
</div>
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
@foreach ($dashboard['count_resume'] as $status => $count)
@php
$gradientFrom = $status === 'batal' ? 'from-red-50' : 'from-amber-50';
$gradientTo = $status === 'batal' ? 'to-red-100' : 'to-amber-100';
$borderColor = $status === 'batal' ? 'border-red-200' : 'border-amber-200';
$iconBg = $status === 'batal' ? 'bg-red-500' : 'bg-amber-500';
$iconColor = $status === 'batal' ? 'text-red-500' : 'text-amber-500';
$textColor = $status === 'batal' ? 'text-red-800' : 'text-amber-800';
$cardTitle = $status === 'batal' ? 'Batal dari Cabang' : 'Menunggu Keputusan Cabang';
@endphp
<div class="card bg-gradient-to-br {{ $gradientFrom }} {{ $gradientTo }} {{ $borderColor }}">
<div class="card-header border-b {{ $borderColor }}">
<div class="flex items-center gap-3">
<div class="w-10 h-10 {{ $iconBg }} rounded-lg flex items-center justify-center">
<i
class="ki-filled {{ $status === 'batal' ? 'ki-cross-circle text-white' : 'ki-time text-white' }}"></i>
</div>
<h3 class="card-title {{ $textColor }} font-semibold">{{ $cardTitle }}</h3>
</div>
@if (!Auth::user()->hasRole(['penilai', 'surveyor', 'pemohon-ao', 'pemohon-eo']))
<div class="grid gap-6 mx-auto w-full">
<!-- Header Section -->
<div class="flex flex-wrap gap-5 justify-between items-center pb-8 lg:items-end">
<div class="flex flex-col gap-3 justify-center">
<h1 class="text-2xl font-bold leading-none text-gray-800">
Dashboard
</h1>
<div class="flex gap-2 items-center text-sm font-medium text-gray-600">
<i class="ki-filled ki-clipboard"></i>
Selamat datang, <span class="font-semibold text-primary">{{ auth()->user()->name }}</span>
</div>
<div class="card-body">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div
class="bg-white rounded-xl p-4 shadow-sm border {{ $borderColor }} hover:shadow-md transition-shadow">
<div class="flex items-center justify-between">
<div>
<h4 class="text-sm font-semibold text-gray-700 mb-1">Jabodetabek</h4>
<span
class="text-2xl font-bold {{ $status === 'batal' ? 'text-red-600' : 'text-amber-600' }}">
{{ $count['jabodetabek']['count_report'] ?? 0 }}
</span>
</div>
<div class="w-8 h-8 {{ $gradientFrom }} rounded-full flex items-center justify-center">
<i class="ki-filled {{ $iconColor }}"></i>
</div>
<div class="flex items-center gap-3 w-[30%]">
<div class="flex gap-2 items-center w-full">
<input type="date" class="input" name="start_date" id="start_date">
<input type="date" class="input" name="end_date" id="end_date">
</div>
<button class="btn btn-primary" id="filter" type="button" onclick="filterDashboard()">
<i class="ki-outline ki-filter fs-2 me-1"></i>
Filter</button>
</div>
</div>
<!-- Stats Cards -->
<div class="grid grid-cols-1 gap-6 md:grid-cols-2">
@foreach ($dashboard['count_resume'] as $status => $count)
@php
$gradientFrom = $status === 'batal' ? 'from-red-50' : 'from-amber-50';
$gradientTo = $status === 'batal' ? 'to-red-100' : 'to-amber-100';
$borderColor = $status === 'batal' ? 'border-red-200' : 'border-amber-200';
$iconBg = $status === 'batal' ? 'bg-red-500' : 'bg-amber-500';
$iconColor = $status === 'batal' ? 'text-red-500' : 'text-amber-500';
$textColor = $status === 'batal' ? 'text-red-800' : 'text-amber-800';
$cardTitle = $status === 'batal' ? 'Batal dari Cabang' : 'Menunggu Keputusan Cabang';
@endphp
<div class="card bg-gradient-to-br {{ $gradientFrom }} {{ $gradientTo }} {{ $borderColor }}">
<div class="card-header border-b {{ $borderColor }}">
<div class="flex gap-3 items-center">
<div class="w-10 h-10 {{ $iconBg }} rounded-lg flex items-center justify-center">
<i
class="ki-filled {{ $status === 'batal' ? 'ki-cross-circle text-white' : 'ki-time text-white' }}"></i>
</div>
<h3 class="card-title {{ $textColor }} font-semibold">{{ $cardTitle }}</h3>
</div>
</div>
<div class="card-body">
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
<div
class="bg-white rounded-xl p-4 shadow-sm border {{ $borderColor }} hover:shadow-md transition-shadow">
<div class="flex justify-between items-center">
<div>
<h4 class="mb-1 text-sm font-semibold text-gray-700">Jabodetabek</h4>
<span
class="text-2xl font-bold {{ $status === 'batal' ? 'text-red-600' : 'text-amber-600' }}">
{{ $count['jabodetabek']['count_report'] ?? 0 }}
</span>
</div>
<div
class="w-8 h-8 {{ $gradientFrom }} rounded-full flex items-center justify-center">
<i class="ki-filled {{ $iconColor }}"></i>
</div>
</div>
</div>
</div>
<div
class="bg-white rounded-xl p-4 shadow-sm border {{ $borderColor }} hover:shadow-md transition-shadow">
<div class="flex items-center justify-between">
<div>
<h4 class="text-sm font-semibold text-gray-700 mb-1">Luar Jabodetabek</h4>
<span
class="text-2xl font-bold {{ $status === 'batal' ? 'text-red-600' : 'text-amber-600' }}">
{{ $count['non-jabodetabek']['count_report'] ?? 0 }}
</span>
</div>
<div class="w-8 h-8 {{ $gradientFrom }} rounded-full flex items-center justify-center">
<i class="ki-filled {{ $iconColor }}"></i>
<div
class="bg-white rounded-xl p-4 shadow-sm border {{ $borderColor }} hover:shadow-md transition-shadow">
<div class="flex justify-between items-center">
<div>
<h4 class="mb-1 text-sm font-semibold text-gray-700">Luar Jabodetabek</h4>
<span
class="text-2xl font-bold {{ $status === 'batal' ? 'text-red-600' : 'text-amber-600' }}">
{{ $count['non-jabodetabek']['count_report'] ?? 0 }}
</span>
</div>
<div
class="w-8 h-8 {{ $gradientFrom }} rounded-full flex items-center justify-center">
<i class="ki-filled {{ $iconColor }}"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endforeach
@endforeach
</div>
<!-- Chart Section -->
<div class="card ">
<div class="card-header border-b border-blue-200">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-10 h-10 bg-blue-500 rounded-lg flex items-center justify-center">
<i class="ki-filled ki-chart-simple-2 text-white"></i>
</div>
<h3 class="text-lg font-semibold text-blue-800">Pendapatan Appraisal</h3>
</div>
</div>
</div>
<div class="card-body">
<div class="bg-white rounded-xl p-4 shadow-sm">
<table class="table table-auto w-full">
<!-- Chart Section -->
<div class="card">
<div class="border-b border-blue-200 card-header">
<div class="flex justify-between items-center">
<div class="flex gap-3 items-center">
<div class="flex justify-center items-center w-10 h-10 bg-blue-500 rounded-lg">
<i class="text-white ki-filled ki-chart-simple-2"></i>
</div>
<h3 class="text-lg font-semibold text-blue-800">Pendapatan Appraisal</h3>
</div>
</div>
</div>
<div class="card-body">
<div class="p-4 bg-white rounded-xl shadow-sm">
<table class="table w-full table-auto">
<thead class="bg-gray-50">
<tr>
<th
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
class="px-4 py-3 text-xs font-semibold tracking-wider text-left text-gray-700 uppercase border-r border-gray-200">
Bulan
</th>
<th
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase border-r border-gray-200">
Jumlah
</th>
<th
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase">
Akumulasi
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach ($dashboard['count_pendapatan'] as $month => $data)
<tr class="hover:bg-gray-50 transition-colors">
<tr class="transition-colors hover:bg-gray-50">
<!-- Kolom Nama month -->
<td class="px-4 py-3 text-sm font-medium text-gray-900 border-r border-gray-200">
{{ ucfirst($month) }}
</td>
<!-- Kolom Total Laporan -->
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
<td class="px-4 py-3 text-sm text-center text-gray-700 border-r border-gray-200">
{{ $data['total_jumlah'] ?? '-' }}
</td>
<!-- Kolom Total Debitur -->
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
<td class="px-4 py-3 text-sm text-center text-gray-700 border-r border-gray-200">
{{ $data['total_akumulasi'] ?? '-' }}
</td>
</tr>
@@ -141,153 +144,156 @@
<!-- Add more rows as needed -->
</tbody>
</table>
</div>
</div>
</div>
<!-- Tables Section -->
<div class="flex gap-6 w-full">
<!-- Laporan Internal -->
<div class="card w-[60%] ">
<div class="border-b border-green-200 card-header">
<div class="flex gap-3 items-center">
<div class="flex justify-center items-center w-10 h-10 bg-green-500 rounded-lg">
<i class="text-white ki-filled ki-document"></i>
</div>
<h3 class="text-lg font-semibold text-green-800">Laporan Internal</h3>
</div>
</div>
<div class="card-body">
<div class="overflow-hidden bg-white rounded-xl shadow-sm">
<table class="table w-full table-auto">
<thead class="bg-gray-50">
<tr>
<th rowspan="2"
class="px-4 py-3 text-xs font-semibold tracking-wider text-left text-gray-700 uppercase border-r border-gray-200">
Bulan
</th>
<th colspan="2"
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase border-r border-gray-200">
Jabodetabek
</th>
<th colspan="2"
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase">
Luar Jabodetabek
</th>
</tr>
<tr class="border-t border-gray-200">
<th
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase border-r border-gray-200">
Laporan
</th>
<th
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase border-r border-gray-200">
Debitur
</th>
<th
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase border-r border-gray-200">
Laporan
</th>
<th
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase">
Debitur
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach ($dashboard['count_lpj_internal'] as $month => $regions)
<tr class="transition-colors hover:bg-gray-50">
<td class="px-4 py-2 text-sm font-medium text-gray-900">
{{ ucfirst($month) }}
</td>
<td class="px-4 py-2 text-sm text-center text-gray-700">
{{ $regions['jabodetabek']['total_laporan'] ?? '-' }}
</td>
<td class="px-4 py-2 text-sm text-center text-gray-700">
{{ $regions['jabodetabek']['total_debiture'] ?? '-' }}
</td>
<td class="px-4 py-2 text-sm text-center text-gray-700">
{{ $regions['non-jabodetabek']['total_laporan'] ?? '-' }}
</td>
<td class="px-4 py-2 text-sm text-center text-gray-700">
{{ $regions['non-jabodetabek']['total_debiture'] ?? '-' }}
</td>
</tr>
@endforeach
<!-- Add more rows as needed -->
</tbody>
</table>
</div>
</div>
</div>
<!-- Laporan Eksternal -->
<div class="card w-[40%]">
<div class="border-b border-purple-200 card-header">
<div class="flex gap-3 items-center">
<div class="flex justify-center items-center w-10 h-10 bg-purple-500 rounded-lg">
<i class="text-white ki-filled ki-tab-tablet"></i>
</div>
<h3 class="text-lg font-semibold text-purple-800">Laporan Eksternal</h3>
</div>
</div>
<div class="card-body">
<div class="overflow-hidden bg-white rounded-xl shadow-sm">
<table class="table w-full table-auto">
<thead class="bg-gray-50">
<tr>
<th
class="px-4 py-3 text-xs font-semibold tracking-wider text-left text-gray-700 uppercase border-r border-gray-200">
Bulan
</th>
<th
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase border-r border-gray-200">
Laporan
</th>
<th
class="px-4 py-3 text-xs font-semibold tracking-wider text-center text-gray-700 uppercase">
Debitur
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach ($dashboard['count_lpj_eksternal'] as $month => $data)
<tr class="transition-colors hover:bg-gray-50">
<!-- Kolom Nama month -->
<td
class="px-4 py-3 text-sm font-medium text-gray-900 border-r border-gray-200">
{{ ucfirst($month) }}
</td>
<!-- Kolom Total Laporan -->
<td
class="px-4 py-3 text-sm text-center text-gray-700 border-r border-gray-200">
{{ $data['total_laporan'] ?? '-' }}
</td>
<!-- Kolom Total Debitur -->
<td
class="px-4 py-3 text-sm text-center text-gray-700 border-r border-gray-200">
{{ $data['total_debiture'] ?? '-' }}
</td>
</tr>
@endforeach
<!-- Add more rows as needed -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Tables Section -->
<div class="flex w-full gap-6">
<!-- Laporan Internal -->
<div class="card w-[60%] ">
<div class="card-header border-b border-green-200">
<div class="flex items-center gap-3">
<div class="w-10 h-10 bg-green-500 rounded-lg flex items-center justify-center">
<i class="ki-filled ki-document text-white"></i>
</div>
<h3 class="text-lg font-semibold text-green-800">Laporan Internal</h3>
</div>
</div>
<div class="card-body">
<div class="bg-white rounded-xl overflow-hidden shadow-sm">
<table class="table table-auto w-full">
<thead class="bg-gray-50">
<tr>
<th rowspan="2"
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
Bulan
</th>
<th colspan="2"
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
Jabodetabek
</th>
<th colspan="2"
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
Luar Jabodetabek
</th>
</tr>
<tr class="border-t border-gray-200">
<th
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
Laporan
</th>
<th
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
Debitur
</th>
<th
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
Laporan
</th>
<th
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
Debitur
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach ($dashboard['count_lpj_internal'] as $month => $regions)
<tr class="hover:bg-gray-50 transition-colors">
<td class="px-4 py-2 text-sm font-medium text-gray-900">
{{ ucfirst($month) }}
</td>
<td class="px-4 py-2 text-sm text-center text-gray-700">
{{ $regions['jabodetabek']['total_laporan'] ?? '-' }}
</td>
<td class="px-4 py-2 text-sm text-center text-gray-700">
{{ $regions['jabodetabek']['total_debiture'] ?? '-' }}
</td>
<td class="px-4 py-2 text-sm text-center text-gray-700">
{{ $regions['non-jabodetabek']['total_laporan'] ?? '-' }}
</td>
<td class="px-4 py-2 text-sm text-center text-gray-700">
{{ $regions['non-jabodetabek']['total_debiture'] ?? '-' }}
</td>
</tr>
@endforeach
<!-- Add more rows as needed -->
</tbody>
</table>
</div>
</div>
</div>
<!-- Laporan Eksternal -->
<div class="card w-[40%]">
<div class="card-header border-b border-purple-200">
<div class="flex items-center gap-3">
<div class="w-10 h-10 bg-purple-500 rounded-lg flex items-center justify-center">
<i class="ki-filled ki-tab-tablet text-white"></i>
</div>
<h3 class="text-lg font-semibold text-purple-800">Laporan Eksternal</h3>
</div>
</div>
<div class="card-body">
<div class="bg-white rounded-xl overflow-hidden shadow-sm">
<table class="table table-auto w-full">
<thead class="bg-gray-50">
<tr>
<th
class="px-4 py-3 text-left text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
Bulan
</th>
<th
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider border-r border-gray-200">
Laporan
</th>
<th
class="px-4 py-3 text-center text-xs font-semibold text-gray-700 uppercase tracking-wider">
Debitur
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
@foreach ($dashboard['count_lpj_eksternal'] as $month => $data)
<tr class="hover:bg-gray-50 transition-colors">
<!-- Kolom Nama month -->
<td class="px-4 py-3 text-sm font-medium text-gray-900 border-r border-gray-200">
{{ ucfirst($month) }}
</td>
<!-- Kolom Total Laporan -->
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
{{ $data['total_laporan'] ?? '-' }}
</td>
<!-- Kolom Total Debitur -->
<td class="px-4 py-3 text-sm text-gray-700 text-center border-r border-gray-200">
{{ $data['total_debiture'] ?? '-' }}
</td>
</tr>
@endforeach
<!-- Add more rows as needed -->
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Chart.js CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
<script>
function filterDashboard() {
const start_date = document.getElementById('start_date').value;
const end_date = document.getElementById('end_date').value;
window.location.href = `?start_date=${start_date}&end_date=${end_date}`;
}
</script>
<!-- Chart initialization script -->
<!-- Chart.js CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
<script>
function filterDashboard() {
const start_date = document.getElementById('start_date').value;
const end_date = document.getElementById('end_date').value;
window.location.href = `?start_date=${start_date}&end_date=${end_date}`;
}
</script>
<!-- Chart initialization script -->
@endif
@endsection

View File

@@ -6,8 +6,9 @@
@section('content')
<div class="grid">
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="debitur-table" data-api-url="{{ route('debitur.datatables') }}">
<div class="card-header bg-agi-50 py-5 flex-wrap">
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
data-datatable-state-save="false" id="debitur-table" data-api-url="{{ route('debitur.datatables') }}">
<div class="flex-wrap py-5 card-header bg-agi-50">
<h3 class="card-title">
Daftar Debitur
</h3>
@@ -20,7 +21,7 @@
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="{{ route('debitur.export') }}"> Export to Excel </a>
@if(auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
@if (auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
<a class="btn btn-sm btn-primary" href="{{ route('debitur.create') }}"> Tambah Debitur </a>
@endif
</div>
@@ -28,59 +29,57 @@
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[50px]" data-datatable-column="cif">
<span class="sort"> <span class="sort-label"> Cif </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="nomor_rekening">
<span class="sort"> <span class="sort-label"> Nomor Rekening </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="branch">
<span class="sort"> <span class="sort-label"> Cabang </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="nomor_id">
<span class="sort"> <span class="sort-label"> Nomor ID </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="npwp">
<span class="sort"> <span class="sort-label"> NPWP </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="email">
<span class="sort"> <span class="sort-label"> Email </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="phone">
<span class="sort"> <span class="sort-label"> Phone </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="address">
<span class="sort"> <span class="sort-label"> Alamat </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
</th>
<th class="min-w-[50px]" data-datatable-column="cif">
<span class="sort"> <span class="sort-label"> Cif </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="nomor_rekening">
<span class="sort"> <span class="sort-label"> Nomor Rekening </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="branch">
<span class="sort"> <span class="sort-label"> Cabang </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="nomor_id">
<span class="sort"> <span class="sort-label"> Nomor ID </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="npwp">
<span class="sort"> <span class="sort-label"> NPWP </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="phone">
<span class="sort"> <span class="sort-label"> Phone </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px]" data-datatable-column="address">
<span class="sort"> <span class="sort-label"> Alamat KTP</span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
<div
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
<div class="flex gap-2 items-center">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per page
</div>
<div class="flex items-center gap-4">
<div class="flex gap-4 items-center">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
@@ -97,9 +96,10 @@
</script>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function () {
window.addEventListener('DOMContentLoaded', function() {
})
function deleteData(data) {
Swal.fire({
title: 'Are you sure?',
@@ -113,7 +113,7 @@
if (result.isConfirmed) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
});
@@ -170,14 +170,11 @@
npwp: {
title: 'NPWP',
},
email: {
title: 'Email',
},
phone: {
title: 'Phone',
},
address: {
title: 'Alamat',
title: 'Alamat KTP',
},
actions: {
title: 'Status',
@@ -220,11 +217,10 @@
let dataTable = new KTDataTable(element, dataTableOptions);
dataTable.showSpinner();
// Custom search functionality
searchInput.addEventListener('input', function () {
searchInput.addEventListener('input', function() {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
</script>
@endpush

View File

@@ -5,9 +5,9 @@
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-permohonan-table" data-api-url="{{ route('laporan-permohonan.data') }}">
<div class="card-header bg-agi-50 py-5 flex-wrap">
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-permohonan-table" data-api-url="{{ route('laporan-permohonan.data') }}">
<div class="flex-wrap py-5 card-header bg-agi-50">
<h3 class="card-title">
Laporan Permohonan
</h3>
@@ -56,7 +56,7 @@
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border" data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
@@ -66,6 +66,10 @@
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="debiture">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
<span class="sort-icon"> </span> </span>
@@ -98,13 +102,13 @@
</thead>
</table>
</div>
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
<div class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
<div class="flex gap-2 items-center">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
page
</div>
<div class="flex items-center gap-4">
<div class="flex gap-4 items-center">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
@@ -144,6 +148,12 @@
nomor_registrasi: {
title: 'Nomor Registrasi',
},
debiture: {
title: 'Debitur',
render: (item, data) => {
return data.debiture ? `${data.debiture.name} ${data.debiture.cif ? `(${data.debiture.cif})` : ''}` : '';
},
},
tanggal_permohonan: {
title: 'Tanggal Permohonan',
render: (item, data) => {

View File

@@ -5,11 +5,11 @@
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('permohonan.datatables') }}">
<div class="card-header bg-agi-50 py-5 flex-wrap">
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('permohonan.datatables') }}">
<div class="flex-wrap py-5 card-header bg-agi-50">
<h3 class="card-title">
Daftar Permohonan
</h3>
@@ -22,69 +22,70 @@
<div class="flex flex-wrap gap-2.5">
<div class="h-[24px] border border-r-gray-200"></div>
<a class="btn btn-sm btn-light" href="{{ route('permohonan.export') }}"> Export to Excel </a>
@if(auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan </a>
@if (auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan
</a>
@endif
</div>
</div>
</div>
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
data-datatable-table="true">
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
data-datatable-table="true">
<thead>
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
<tr>
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
</th>
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="mig_mst_lpj_nomor_jaminan">
</th>
<th class="min-w-[150px]" data-datatable-column="mig_mst_lpj_nomor_jaminan">
<span class="sort"> <span class="sort-label"> Nomor LPJ Lama </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
</th>
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="pemohon">
</th>
<th class="min-w-[150px]" data-datatable-column="pemohon">
<span class="sort"> <span class="sort-label"> User Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="branch">
</th>
<th class="min-w-[150px]" data-datatable-column="branch">
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="debitur_id">
</th>
<th class="min-w-[150px]" data-datatable-column="debitur_id">
<span class="sort"> <span class="sort-label"> Debitur </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
</th>
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px] text-center" data-datatable-column="status">
</th>
<th class="min-w-[150px] text-center" data-datatable-column="status">
<span class="sort"> <span class="sort-label"> Status </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[150px]" data-datatable-column="keterangan">
</th>
<th class="min-w-[150px]" data-datatable-column="keterangan">
<span class="sort"> <span class="sort-label"> Keterangan </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-right" data-datatable-column="actions">Action</th>
</tr>
</th>
<th class="min-w-[50px] text-right" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<div
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
<div class="flex items-center gap-2">
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
<div class="flex gap-2 items-center">
Show
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per page
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per page
</div>
<div class="flex items-center gap-4">
<div class="flex gap-4 items-center">
<span data-datatable-info="true"> </span>
<div class="pagination" data-datatable-pagination="true">
</div>
@@ -193,9 +194,9 @@
title: 'Status',
render: (item, data) => {
if (data.documents > 0) {
return `<span class="badge badge-sm badge-default uppercase flex justify-center">${data.status}</span>`;
return `<span class="flex justify-center uppercase badge badge-sm badge-default">${data.status}</span>`;
}
return `<span class="badge badge-sm badge-danger uppercase flex justify-center">Lengkapi Aset Jaminan</span>`;
return `<span class="flex justify-center uppercase badge badge-sm badge-danger">Lengkapi Aset Jaminan</span>`;
}
},
@@ -215,7 +216,7 @@
actions: {
title: 'Actions',
render: (item, data) => {
let actionHtml = `<div class="flex flex-nowrap justify-end gap-1.5">`;
let actionHtml = `<div class="flex flex-nowrap gap-1.5 justify-end">`;
const hasRole = (roles) => roles.some(role => userRoles.includes(role));
if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') {
@@ -259,13 +260,17 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
`;
}
if (data.status !== 'done' && data.status !== 'batal' && hasRole(['administrator', 'pemohon-ao'])) {
if (data.status !== 'done' && data.status !== 'batal' && hasRole(['administrator',
'pemohon-ao'
])) {
actionHtml += `
<a class="btn btn-sm btn-outline btn-info" href="permohonan/${data.id}/edit" title="Edit Permohonan">
<i class="ki-outline ki-notepad-edit"></i>
</a>`;
}
if (data.status === 'order' && hasRole(['administrator', 'pemohon-ao'])) {
if (data.status !== 'done' && data.status !== 'batal' && hasRole(['administrator',
'pemohon-ao'
])) {
actionHtml += `
<a onclick="deleteData(${data.id}, '${data.nomor_registrasi}','${data.debiture?.name}')" class="delete btn btn-sm btn-outline btn-danger" title="Batalkan Permohonan">
<i class="ki-outline ki-cross-square"></i>
@@ -283,7 +288,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
let dataTable = new KTDataTable(element, dataTableOptions);
// Custom search functionality
searchInput.addEventListener('input', function () {
searchInput.addEventListener('input', function() {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
@@ -328,7 +333,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
cache: false,
data: input_data,
dataType: "json",
success: function (response) {
success: function(response) {
console.log(response);
if ('success' == response.status) {
swal.fire('Sukses Menyetujui!', response.message, 'success').then(
@@ -340,7 +345,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
}
},
error: function (response, textStatus, errorThrown) {
error: function(response, textStatus, errorThrown) {
// var errors = response.responseJSON.errors;
// console.log(errors);
console.log(response);
@@ -351,7 +356,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
Swal.fire({
title: 'Reschedule Jadwal Kunjungan',
html: `
<div class="text-left space-y-4">
<div class="space-y-4 text-left">
<p class="text-gray-700">
Yakin akan Reschedule Jadwal Kunjungan
@@ -363,15 +368,15 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
</p>
<div>
<label for="reschedule_date" class="block text-sm font-medium text-gray-700 mb-1">Tanggal Baru</label>
<label for="reschedule_date" class="block mb-1 text-sm font-medium text-gray-700">Tanggal Baru</label>
<input type="datetime-local" id="reschedule_date"
class="block w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
class="block px-4 py-2 w-full rounded-lg border border-gray-300 shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
<div>
<label for="reschedule_note" class="block text-sm font-medium text-gray-700 mb-1">Catatan</label>
<label for="reschedule_note" class="block mb-1 text-sm font-medium text-gray-700">Catatan</label>
<textarea id="reschedule_note"
class="block w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
class="block px-4 py-2 w-full rounded-lg border border-gray-300 shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
placeholder="Masukkan alasan reschedule..."></textarea>
</div>
@@ -418,7 +423,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
cache: false,
data: data,
dataType: "json",
success: function (response) {
success: function(response) {
if (response.status === 'success') {
Swal.fire('Sukses Reschedule!', response.message,
'success').then(() => {
@@ -428,7 +433,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
Swal.fire('Error!', response.message, 'error');
}
},
error: function (response) {
error: function(response) {
console.log(response);
}
});
@@ -460,7 +465,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
Swal.fire({
title: 'Reschedule Jadwal Kunjungan',
html: `
<div class="text-left space-y-4">
<div class="space-y-4 text-left">
<p class="text-gray-700">
Yakin akan Reschedule Jadwal Kunjungan
@@ -472,20 +477,20 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
</p>
<div>
<label for="reschedule_date" class="block text-sm font-medium text-gray-700 mb-1">Tanggal Baru</label>
<label for="reschedule_date" class="block mb-1 text-sm font-medium text-gray-700">Tanggal Baru</label>
<input type="datetime-local" id="reschedule_date"
class="block w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
class="block px-4 py-2 w-full rounded-lg border border-gray-300 shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm">
</div>
<div>
<label for="reschedule_note" class="block text-sm font-medium text-gray-700 mb-1">Catatan</label>
<label for="reschedule_note" class="block mb-1 text-sm font-medium text-gray-700">Catatan</label>
<textarea id="reschedule_note"
class="block w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
class="block px-4 py-2 w-full rounded-lg border border-gray-300 shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
placeholder="Masukkan alasan reschedule..."></textarea>
</div>
${note ? `
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${note}</p>
` : ''}
<p class="text-gray-700"><strong>Catatan Reject:</strong> ${note}</p>
` : ''}
</div>
`,
@@ -532,7 +537,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
cache: false,
data: data,
dataType: "json",
success: function (response) {
success: function(response) {
if (response.status === 'success') {
Swal.fire('Sukses Reschedule!', response.message, 'success').then(
() => {
@@ -542,7 +547,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
Swal.fire('Error!', response.message, 'error');
}
},
error: function (response) {
error: function(response) {
const errorMessage = response.responseJSON?.message ||
'Terjadi kesalahan saat memproses data.';
Swal.fire('Error!', errorMessage, 'error');

View File

@@ -1,24 +1,23 @@
<div class="card border border-agi-100 w-full rounded-lg shadow-md overflow-hidden">
<div class="overflow-hidden w-full rounded-lg border shadow-md card border-agi-100">
<div class="card-header light:bg-agi-50">
<h3 class="card-title uppercase">
<h3 class="uppercase card-title">
Analisa Tanah
</h3>
</div>
<div class="card-body">
<div class="grid gap-5">
<!-- Luas tanah -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
<label class="form-label max-w-56">Luas Tanah</label>
<div class="mt-2">
@if (isset($permohonan->documents))
@foreach ($permohonan->documents as $item)
@php
// 27
$total_luas_tanah = 0;
$jenis_legalitas_jaminan_id = 0;
if (isset($item->detail)) {
$total_luas_tanah = calculateTotalLuas($item->detail, 'luas_tanah', 1, 27, 3);
if (isset($item->details)) {
$total_luas_tanah = calculateTotalLuas($item->details, 'luas_tanah', 1, 27, 3);
}
@endphp
<input type="hidden" id="jenis_legalistas_jaminan_tanah_id"
@@ -26,25 +25,25 @@
value="{{ $jenis_legalitas_jaminan_id }}">
<input type="hidden" name="luas_tanah_sesuai" class="input"
value="{{ $total_luas_tanah }}">
<p class="text-2sm text-gray-700">{{ $total_luas_tanah }} m<sup>2</sup></p>
<p class="text-gray-700 text-2sm">{{ $total_luas_tanah }} m<sup>2</sup></p>
@endforeach
@endif
<div class="flex-wrap items-stretch">
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
<label class="form-label flex items-center gap-3 text-nowrap">
<div class="grid grid-cols-3 gap-4 mt-2 md:grid-cols-3">
<label class="flex gap-3 items-center form-label text-nowrap">
<input type="radio" class="radio" name="luas_tanah" value="sesuai"
onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])"
{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['sesuai'])) ? 'checked' : '' }}>
<span class="ml-2">Sesuai</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input type="radio" class="radio" name="luas_tanah" value="tidak sesuai"
onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])"
{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? 'checked' : '' }}>
<span class="ml-2">Tidak Sesuai</span>
</label>
<div id="luas_tanah_tidak_sesuai" class="flex items-baseline gap-2"
<div id="luas_tanah_tidak_sesuai" class="flex gap-2 items-baseline"
style="{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? '' : 'display: none;' }}">
<div class="input">
<input id="analisa_tanah_tidak_sesuai" type="text" name="luas_tanah_tidak_sesuai"
@@ -57,26 +56,26 @@
</button> --}}
</div>
</div>
<em id="error-luas_tanah" class="alert text-danger text-sm"></em>
<em id="error-luas_tanah" class="text-sm alert text-danger"></em>
</div>
</div>
</div>
<!-- Hadap Mata Angin -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
<input type="hidden" name="hadap_mata_angin_sesuai" class="input" value="sesuai">
<label class="form-label max-w-56">Hadap Mata Angin</label>
<div class="mt-2">
<div class="flex-wrap items-stretch">
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
<label class="form-label flex items-center gap-3 text-nowrap">
<div class="grid grid-cols-3 gap-4 mt-2 md:grid-cols-3">
<label class="flex gap-3 items-center form-label text-nowrap">
<input type="radio" class="radio" name="hadap_mata_angin" value="sesuai"
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])) ? 'checked' : '' }}>
<span class="ml-2">Sesuai</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input type="radio" class="radio" name="hadap_mata_angin" value="tidak sesuai"
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? 'checked' : '' }}>
@@ -84,7 +83,7 @@
</label>
<!-- Select dropdown untuk "Tidak Sesuai" -->
<div id="hadap_mata_angin_tidak_sesuai" class="flex items-baseline gap-2"
<div id="hadap_mata_angin_tidak_sesuai" class="flex gap-2 items-baseline"
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
<select class="input w-full
id="
@@ -108,19 +107,19 @@
{{-- <button type="button" class="btn btn-md btn-primary" onclick="updateAnalisa('hadap_mata_angin')">Save</button> --}}
</div>
</div>
<em id="error-hadap_mata_angin" class="alert text-danger text-sm"></em>
<em id="error-hadap_mata_angin" class="text-sm alert text-danger"></em>
</div>
</div>
</div>
<!-- Bentuk Tanah -->
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-stretch lg:flex-nowrap">
<label class="form-label max-w-56">Bentuk Tanah</label>
<div class="flex-wrap items-stretch">
<div class="flex flex-col items-start gap-4">
<div class="flex flex-col gap-4 items-start">
@if (isset($basicData['bentukTanah']))
@foreach ($basicData['bentukTanah'] as $item)
<div class="flex items-center">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input class="checkbox" name="bentuk_tanah[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, old('bentuk_tanah', [])) ||
@@ -135,7 +134,7 @@
@if (strcasecmp($item->name, 'lainnya') == 0)
<input id="bentuk_tanah_lainnya" type="text"
style="{{ isset($forminspeksi['tanah']['bentuk_tanah']['lainnya']) && $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ? '' : 'display: none;' }}"
name="bentuk_tanah_lainnya" class="input w-full mt-2"
name="bentuk_tanah_lainnya" class="mt-2 w-full input"
placeholder="Masukkan bentuk tanah..."
value="{{ old('bentuk_tanah_lainnya', $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ?? '') }}" />
@endif
@@ -143,17 +142,17 @@
@endforeach
@endif
</div>
<em id="error-bentuk_tanah" class="alert text-danger text-sm"></em>
<em id="error-bentuk_tanah" class="text-sm alert text-danger"></em>
</div>
</div>
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-stretch lg:flex-nowrap">
<label class="form-label max-w-56">Kontur Tanah</label>
<div class="flex-wrap items-stretch">
<div class="flex flex-col items-start gap-4">
<div class="flex flex-col gap-4 items-start">
@if (isset($basicData['konturTanah']))
@foreach ($basicData['konturTanah'] as $item)
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input class="checkbox" name="kontur_tanah[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, old('kontur_tanah', $forminspeksi['tanah']['kontur_tanah'] ?? [])) ? 'checked' : '' }} />
@@ -162,18 +161,18 @@
@endforeach
@endif
</div>
<em id="error-kontur_tanah" class="alert text-danger text-sm"></em>
<em id="error-kontur_tanah" class="text-sm alert text-danger"></em>
</div>
</div>
<!-- Beda Ketinggian Dengan Jalan -->
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-stretch lg:flex-nowrap">
<label class="form-label max-w-56">Beda Ketinggian Dengan Jalan</label>
<div class="flex-wrap items-stretch">
<div class="flex flex-col items-start gap-4">
<div class="flex flex-col gap-4 items-start">
@if (isset($basicData['ketinggianTanah']))
@foreach ($basicData['ketinggianTanah'] as $item)
<div class="flex flex-col gap-2">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input class="checkbox" name="ketinggian_jalan[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, old('ketinggian_jalan', $forminspeksi['tanah']['ketinggian_jalan'] ?? [])) ? 'checked' : '' }}
@@ -186,12 +185,12 @@
@if (strcasecmp($item->name, 'Lebih Tinggi') == 0)
<input id="input-lebih-tinggi" type="text"
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ? '' : 'display: none;' }}"
name="ketinggian_lebih_tinggi" class="input w-full mt-2" placeholder="Masukkan Ketinggian..."
name="ketinggian_lebih_tinggi" class="mt-2 w-full input" placeholder="Masukkan Ketinggian..."
value="{{ old('ketinggian_lebih_tinggi', $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ?? '') }}" />
@elseif (strcasecmp($item->name, 'Lebih Rendah') == 0)
<input id="input-lebih-rendah" type="text"
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ? '' : 'display: none;' }}"
name="ketinggian_lebih_rendah" class="input w-full mt-2" placeholder="Masukkan Ketinggian..."
name="ketinggian_lebih_rendah" class="mt-2 w-full input" placeholder="Masukkan Ketinggian..."
value="{{ old('ketinggian_lebih_rendah', $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ?? '') }}" />
@endif
@@ -199,39 +198,39 @@
@endforeach
@endif
</div>
<em id="error-ketinggian_jalan" class="alert text-danger text-sm"></em>
<em id="error-ketinggian_jalan" class="text-sm alert text-danger"></em>
</div>
</div>
<!-- Kontur Jalan Depan Objek -->
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-stretch lg:flex-nowrap">
<label class="form-label max-w-56">Kontur Jalan Depan Objek</label>
<div class="flex-wrap items-stretch">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<div class="grid grid-cols-2 gap-4 md:grid-cols-3">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input type="radio" class="radio" name="kontur_jalan" value="menurun"
{{ old('kontur_jalan', isset($forminspeksi['tanah']['kontur_jalan']) ? $forminspeksi['tanah']['kontur_jalan'] : '') == 'menurun' ? 'checked' : '' }}>
<span class="ml-2">Menurun</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input type="radio" class="radio" name="kontur_jalan" value="rata"
{{ old('kontur_jalan', isset($forminspeksi['tanah']['kontur_jalan']) ? $forminspeksi['tanah']['kontur_jalan'] : '') == 'rata' ? 'checked' : '' }}>
<span class="ml-2">Rata</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input type="radio" class="radio" name="kontur_jalan" value="Menanjak"
{{ old('kontur_jalan', isset($forminspeksi['tanah']['kontur_jalan']) ? $forminspeksi['tanah']['kontur_jalan'] : '') == 'Menanjak' ? 'checked' : '' }}>
<span class="ml-2">Menanjak</span>
</label>
</div>
<em id="error-kontur_jalan" class="alert text-danger text-sm"></em>
<em id="error-kontur_jalan" class="text-sm alert text-danger"></em>
</div>
</div>
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-stretch lg:flex-nowrap">
<label class="form-label max-w-56">Posisi Kavling</label>
<div class="flex-wrap items-stretch">
<div class="flex flex-col items-start gap-4">
<div class="flex flex-col gap-4 items-start">
@if (isset($basicData['posisiKavling']))
@php
$selectedPosisiKavling = old(
@@ -245,7 +244,7 @@
@endphp
@foreach ($basicData['posisiKavling'] as $item)
<div class="flex items-center">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input class="checkbox" name="posisi_kavling[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, $selectedPosisiKavling) ? 'checked' : '' }}
@@ -255,7 +254,7 @@
@if (strcasecmp($item->name, 'Lainnya') == 0)
<input id="posisi_kavling_lainnya" type="text"
style="{{ $lainnyaValue ? '' : 'display: none' }}"
name="posisi_kavling_lainnya" class="input w-full mt-2"
name="posisi_kavling_lainnya" class="mt-2 w-full input"
placeholder="Masukkan Posisi Kavling lainnya..."
value="{{ $lainnyaValue }}" />
@endif
@@ -263,16 +262,16 @@
@endforeach
@endif
</div>
<em id="error-posisi_kavling" class="alert text-danger text-sm"></em>
<em id="error-posisi_kavling" class="text-sm alert text-danger"></em>
</div>
</div>
<!-- Tusuk Sate -->
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-stretch lg:flex-nowrap">
<label class="form-label max-w-56">Tusuk Sate</label>
<div class="flex-wrap items-stretch">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<div class="grid grid-cols-2 gap-4 mt-2 md:grid-cols-3">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input onclick="toggleFieldVisibility('tusuk_sate', 'tusuk_sate_ya', ['Ya'])"
type="radio" class="radio" name="tusuk_sate" value="Ya"
{{ old('tusuk_sate') == 'Ya' || (isset($forminspeksi['tanah']['tusuk_sate']['Ya']) && $forminspeksi['tanah']['tusuk_sate']['Ya']) ? 'checked' : '' }}>
@@ -287,45 +286,45 @@
value="{{ old('tusuk_sate_ya', isset($selectedData) ? $selectedData : '') }}"
style="{{ $statusKey == 'Ya' ? '' : 'display: none;' }}">
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input onclick="toggleFieldVisibility('tusuk_sate', 'tusuk_sate_ya', ['Ya'])"
type="radio" class="radio" name="tusuk_sate" value="Tidak"
{{ old('tusuk_sate') == 'Tidak' || (isset($forminspeksi['tanah']['tusuk_sate']['Tidak']) && $forminspeksi['tanah']['tusuk_sate']['Tidak']) ? 'checked' : '' }}>
<span class="ml-2">Tidak</span>
</label>
</div>
<em id="error-tusuk_sate" class="alert text-danger text-sm"></em>
<em id="error-tusuk_sate" class="text-sm alert text-danger"></em>
</div>
</div>
<!-- Lockland -->
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-stretch lg:flex-nowrap">
<label class="form-label max-w-56">Lockland</label>
<div class="flex-wrap items-stretch">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<div class="grid grid-cols-2 gap-4 mt-2 md:grid-cols-3">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input type="radio" class="radio" name="lockland" value="yes"
{{ old('lockland') == 'yes' || (isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'yes') ? 'checked' : '' }}>
<span class="ml-2">Ya</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input type="radio" class="radio" name="lockland" value="no"
{{ old('lockland') == 'no' || (isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'no') ? 'checked' : '' }}>
<span class="ml-2">Tidak</span>
</label>
</div>
<em id="error-lockland" class="alert text-danger text-sm"></em>
<em id="error-lockland" class="text-sm alert text-danger"></em>
</div>
</div>
<!-- Kondisi Fisik Tanah -->
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
<div class="flex flex-wrap gap-2.5 items-stretch lg:flex-nowrap">
<label class="form-label max-w-56">Kondisi Fisik Tanah</label>
<div class="flex-wrap items-stretch">
<div class="flex flex-col items-start gap-4">
<div class="flex flex-col gap-4 items-start">
@if (isset($basicData['kondisiFisikTanah']))
@foreach ($basicData['kondisiFisikTanah'] as $item)
<label class="form-label flex items-center gap-2.5 text-nowrap">
<label class="flex gap-2.5 items-center form-label text-nowrap">
<input class="checkbox" name="kondisi_fisik_tanah[]" type="checkbox"
value="{{ $item->name }}"
{{ in_array($item->name, old('kondisi_fisik_tanah', [])) || (isset($forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah']) && in_array($item->name, $forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah'])) ? 'checked' : '' }}
@@ -337,7 +336,7 @@
@if (strcasecmp($item->name, 'lainnya') == 0)
<div class="flex items-center">
<input type="text" name="kondisi_fisik_tanah_lainnya"
id="kondisi_fisik_tanah_lainnya" class="input mt-2"
id="kondisi_fisik_tanah_lainnya" class="mt-2 input"
placeholder="Masukkan Kondisi Fisik Tanah..." style="display: none;"
value="{{ old('kondisi_fisik_tanah_lainnya', isset($forminspeksi['tanah']['kondisi_fisik_tanah']['lainnya'])) }}">
</div>
@@ -345,7 +344,7 @@
@endforeach
@endif
</div>
<em id="error-kondisi_fisik_tanah" class="alert text-danger text-sm"></em>
<em id="error-kondisi_fisik_tanah" class="text-sm alert text-danger"></em>
</div>
</div>