Merge remote-tracking branch 'composer/feature/senior-officer' into staging

This commit is contained in:
Daeng Deni Mardaeni
2025-03-03 08:00:55 +07:00
26 changed files with 921 additions and 606 deletions

View File

@@ -392,7 +392,7 @@ class ActivityController extends Controller
$q->where('user_id', $id); $q->where('user_id', $id);
}) })
->whereHas('permohonan', function ($q) { ->whereHas('permohonan', function ($q) {
$q->whereIn('status', ['assign', 'proses-laporan', 'done', 'proses-survey', 'request-reschedule', 'reschedule', 'rejected-reschedule', 'approved-reschedule', 'revisi-laporan', 'survey']); $q->whereNotIn('status', ['done']);
}); });

View File

@@ -181,7 +181,13 @@ class PembayaranController extends Controller
$permohonan = Permohonan::find($id); $permohonan = Permohonan::find($id);
if ($permohonan) { if ($permohonan) {
$data['status_bayar'] = 'sudah_bayar';
if ($request->type === 'revisi') {
$data['status_bayar'] = 'belum_bayar';
} else {
$data['status_bayar'] = 'sudah_bayar';
}
if ($permohonan->jenis_penilaian_id == 2) { if ($permohonan->jenis_penilaian_id == 2) {
$data['status'] = 'spk'; $data['status'] = 'spk';
} }

View File

@@ -297,7 +297,6 @@ class PenilaiController extends Controller
return redirect() return redirect()
->route('penilai.show', ['id' => $id])->with('success', 'diperbarui ke status paparan dan dikirim ke So untuk proses lebih lanjut.'); ->route('penilai.show', ['id' => $id])->with('success', 'diperbarui ke status paparan dan dikirim ke So untuk proses lebih lanjut.');
} catch (\Exception $e) { } catch (\Exception $e) {
return redirect()->route('penilai.show', ['id' => $id])->with('error', 'Terjadi kesalahan saat memproses permohonan.'); return redirect()->route('penilai.show', ['id' => $id])->with('error', 'Terjadi kesalahan saat memproses permohonan.');
} }
@@ -505,7 +504,7 @@ class PenilaiController extends Controller
}); });
} }
$query->whereRaw('LOWER(status) IN (?, ?, ?, ?, ?, ?,?, ?)', ['assign','survey-completed', 'proses-laporan', 'paparan', 'proses-paparan','paparan', 'revisi-laporan','revisi-paparan']); $query->whereRaw('LOWER(status) IN (?, ?, ?, ?, ?, ?,?, ?)', ['assign', 'survey-completed', 'proses-laporan', 'paparan', 'proses-paparan', 'paparan', 'revisi-laporan', 'revisi-paparan']);
if (!Auth::user()->hasRole('administrator')) { if (!Auth::user()->hasRole('administrator')) {
$query->whereHas('penilaian.userPenilai', function ($q) { $query->whereHas('penilaian.userPenilai', function ($q) {
@@ -574,8 +573,8 @@ class PenilaiController extends Controller
$jaminanId = $request->query('jaminanId'); $jaminanId = $request->query('jaminanId');
// Fetch the data from the database // Fetch the data from the database
$data = Inspeksi::where('permohonan_id', $permohonanId) $data = Inspeksi::where('permohonan_id', $permohonanId)
->where('dokument_id', $documentId) ->where('dokument_id', $documentId)
->first(); ->first();
$permohonan = $this->surveyorController->getPermohonanJaminanId( $permohonan = $this->surveyorController->getPermohonanJaminanId(
$permohonanId, $permohonanId,
@@ -772,7 +771,6 @@ class PenilaiController extends Controller
'success' => true, 'success' => true,
'message' => 'Berhasil Megirim reported ke so' 'message' => 'Berhasil Megirim reported ke so'
], 200); ], 200);
} catch (\Exception $e) { } catch (\Exception $e) {
return response()->json([ return response()->json([
'success' => false, 'success' => false,
@@ -810,8 +808,8 @@ class PenilaiController extends Controller
); );
$inspeksi = Inspeksi::where('permohonan_id', $validatedData['permohonan_id']) $inspeksi = Inspeksi::where('permohonan_id', $validatedData['permohonan_id'])
->where('dokument_id', $validatedData['dokument_id']) ->where('dokument_id', $validatedData['dokument_id'])
->first(); ->first();
if ($inspeksi) { if ($inspeksi) {
// Get existing data_form // Get existing data_form
$existingData = json_decode($inspeksi->data_form, true) ?: []; $existingData = json_decode($inspeksi->data_form, true) ?: [];
@@ -1039,7 +1037,6 @@ class PenilaiController extends Controller
'trace' => $e->getTraceAsString() 'trace' => $e->getTraceAsString()
], 500); ], 500);
} }
} }
public function storeCallReport(Request $request) public function storeCallReport(Request $request)
@@ -1056,7 +1053,8 @@ class PenilaiController extends Controller
'fakta_negatif' => 'nullable|array', 'fakta_negatif' => 'nullable|array',
'type' => 'required', 'type' => 'required',
'action' => 'required', 'action' => 'required',
'keterangan' => 'nullable|array' 'keterangan' => 'nullable|array',
]); ]);
@@ -1072,8 +1070,8 @@ class PenilaiController extends Controller
); );
$inspeksi = Inspeksi::where('permohonan_id', $validated['permohonan_id']) $inspeksi = Inspeksi::where('permohonan_id', $validated['permohonan_id'])
->where('dokument_id', $validated['dokument_id']) ->where('dokument_id', $validated['dokument_id'])
->first(); ->first();
if ($inspeksi) { if ($inspeksi) {
// Get existing data_form // Get existing data_form
$existingData = json_decode($inspeksi->data_form, true) ?: []; $existingData = json_decode($inspeksi->data_form, true) ?: [];
@@ -1206,8 +1204,8 @@ class PenilaiController extends Controller
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan); $cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
$pdf->setPaper('A4', 'portrait'); $pdf->setPaper('A4', 'portrait');
return response($pdf->output(), 200) return response($pdf->output(), 200)
->header('Content-Type', 'application/pdf') ->header('Content-Type', 'application/pdf')
->header('Content-Disposition', 'inline; filename="Laporan_' . $tipeLaporan . '_' .$permohonan->debiture->name . '_' . $cleanNomorLaporan .'.pdf"'); ->header('Content-Disposition', 'inline; filename="Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '.pdf"');
// return $pdf->stream(); // return $pdf->stream();
} else { } else {
// $pdf = view('lpj::' . $viewLaporan, compact( // $pdf = view('lpj::' . $viewLaporan, compact(
@@ -1232,14 +1230,12 @@ class PenilaiController extends Controller
// return $pdf; // return $pdf;
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan); $cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
$pdf->setPaper('A4', 'portrait'); $pdf->setPaper('A4', 'portrait');
return $pdf->download('Laporan_'. $tipeLaporan . '_' .$permohonan->debiture->name . '_' . $cleanNomorLaporan .'_data.pdf'); return $pdf->download('Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '_data.pdf');
} }
} catch (\Exception $e) { } catch (\Exception $e) {
Log::error('PDF generation failed: ' . $e->getMessage()); Log::error('PDF generation failed: ' . $e->getMessage());
return response()->json(['error' => 'Failed to generate PDF. Please check the log for details.'. $e->getMessage()], 500); return response()->json(['error' => 'Failed to generate PDF. Please check the log for details.' . $e->getMessage()], 500);
} }
} }
private function getViewLaporan($tipe) private function getViewLaporan($tipe)
@@ -1262,10 +1258,10 @@ class PenilaiController extends Controller
private function getDataPermohonanWithPenilaiAndInspeksi($permohonanId, $documentId, $jaminanId) private function getDataPermohonanWithPenilaiAndInspeksi($permohonanId, $documentId, $jaminanId)
{ {
return [ return [
'permohonan' => $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId), 'permohonan' => $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId),
'penilai' => Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(), 'penilai' => Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(),
'inspeksi' => Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first() 'inspeksi' => Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first()
]; ];
} }
@@ -1608,6 +1604,4 @@ class PenilaiController extends Controller
'message' => 'Berhasil Revisi Ke surveyor', 'message' => 'Berhasil Revisi Ke surveyor',
], 200); ], 200);
} }
} }

View File

@@ -682,6 +682,7 @@ class SurveyorController extends Controller
$request->validate([ $request->validate([
'edited_image' => 'required|string', 'edited_image' => 'required|string',
'original_path' => 'required|string', 'original_path' => 'required|string',
'nomor_registrasi' => 'required',
]); ]);
// Decode base64 image // Decode base64 image
@@ -701,7 +702,7 @@ class SurveyorController extends Controller
// Path asli // Path asli
$originalPath = $request->input('original_path'); $originalPath = $request->input('original_path');
$fileName = basename($originalPath); $fileName = basename($originalPath);
$newFilePath = 'edited_images/' . $fileName; $newFilePath = 'surveyor/upload_foto/'. $request->input('nomor_registrasi') . '/' . $fileName;
// Simpan file ke storage // Simpan file ke storage
Storage::disk('public')->put($newFilePath, $decodedImage); Storage::disk('public')->put($newFilePath, $decodedImage);
@@ -1675,10 +1676,6 @@ class SurveyorController extends Controller
'basicData', 'basicData',
'cekAlamat' 'cekAlamat'
)); ));
// return response()->json([
// 'daya'=> $permohonan
// ]);
} }
/** /**

View File

@@ -106,11 +106,14 @@
@push('scripts') @push('scripts')
<script type="text/javascript"> <script type="text/javascript">
function pembayaranOtorisator(id) { function handlePembayaran(id, type) {
// alert('hai id = ' + id); let rv = type
let title = type === 'revisi' ? 'Apakah Anda yakin ingin merevisi pembayaran ini?' : 'Apakah Anda yakin?';
let text = type === 'revisi' ? 'Untuk melakukan revisi pembayaran!' : 'Untuk melakukan approve pembayaran!';
Swal.fire({ Swal.fire({
title: 'Apakah Anda yakin?', title: title,
text: `Untuk melakukan approve Pembayaran!`, text: text,
icon: 'warning', icon: 'warning',
input: 'textarea', // Menambahkan input textarea input: 'textarea', // Menambahkan input textarea
inputLabel: 'Keterangan', inputLabel: 'Keterangan',
@@ -133,6 +136,7 @@
input_data._method = 'PUT'; input_data._method = 'PUT';
input_data.id = id; input_data.id = id;
input_data.keterangan = keterangan; input_data.keterangan = keterangan;
input_data.type = rv;
$.ajaxSetup({ $.ajaxSetup({
headers: { headers: {
@@ -324,10 +328,10 @@
} }
if(permohonan) { if(permohonan) {
return `${permohonan.approve_keterangan_bayar}`; return `${permohonan.approve_keterangan_bayar}` || '-';
} }
return ""; return "-";
}, },
}, },
actions: { actions: {
@@ -339,12 +343,16 @@
var permohonan = data.penawaran.permohonan; var permohonan = data.penawaran.permohonan;
} }
var iconPembayaranOtorisator = '';
if(permohonan) { if(permohonan) {
var iconPembayaranOtorisator = '';
if (!permohonan.approve_bayar_by) { if (!permohonan.approve_bayar_by) {
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="pembayaranOtorisator(${permohonan.id})"> iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="handlePembayaran(${permohonan.id},'otorisator')">
<i class="ki-filled ki-double-check"></i> <i class="ki-filled ki-double-check"></i>
</a>`; </a>`;
}else{
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="handlePembayaran(${permohonan.id}, 'revisi')">
<i class="ki-filled ki-arrow-circle-left"></i>
</a>`;
} }
return `<div class="flex flex-nowrap justify-center">` + iconPembayaranOtorisator + `</div>`; return `<div class="flex flex-nowrap justify-center">` + iconPembayaranOtorisator + `</div>`;

View File

@@ -20,8 +20,13 @@
@foreach ($informasi as $key) @foreach ($informasi as $key)
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-') @if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}: @php
{{ $forminspeksi['fakta'][$key] }}</p> $displayKey = ucfirst(str_replace('_', ' ', $key));
if (strlen($key) == 3) {
$displayKey = strtoupper($key);
}
@endphp
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
@endif @endif
@endforeach @endforeach

View File

@@ -116,7 +116,11 @@
<td>Tusuk Sate</td> <td>Tusuk Sate</td>
<td>:</td> <td>:</td>
<td> <td>
{{ isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'yes' ? 'Ya' : 'Tidak' }} {{ isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'] ? 'Ya' : 'Tidak' }}
@if (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'])
{{ isset($forminspeksi['tanah']['tusuk_sate_ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate_ya'] . ')' : '' }}
@endif
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -65,8 +65,8 @@
{{-- @include('lpj::surveyor.components.header') {{-- @include('lpj::surveyor.components.header')
@include('lpj::surveyor.components.callReport') --}} @include('lpj::surveyor.components.callReport') --}}
@php @php
$paparan = $permohonan->status === 'proses-paparan' ? 'Paparan' : 'Pelaporan'; $paparan = $permohonan->status === 'proses-paparan' ? 'Paparan' : 'Pelaporan';
@endphp @endphp
<div class="card"> <div class="card">
<div class="card-header bg-agi-50"> <div class="card-header bg-agi-50">
<h3 class="card-title uppercase"> <h3 class="card-title uppercase">
@@ -251,40 +251,81 @@
@include('lpj::component.detail-jaminan', ['status' => true]) @include('lpj::component.detail-jaminan', ['status' => true])
</div> </div>
</div> </div>
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
<div class="card-header bg-agi-50"> <div class="w-full grid grid-cols-1 lg:grid-cols-2 gap-4">
<h1 class="text-md font-medium text-gray-900 uppercase">Nilai Likuidasi</h1>
<!-- Bagian Nilai KJPP -->
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
<div class="card-header bg-agi-50">
<h1 class="text-md font-medium text-gray-900 uppercase">Nilai KJPP</h1>
</div>
<div class="card-body grid gap-5 w-full">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="lelang-1" class="form-label max-w-56">Lelang ke </label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="lelang-1" name="lelang_kjpp" class="input w-full"
placeholder="Masukkan Lelang" value="{{ $callReport['lelang_kjpp'] ?? '' }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="nilai-pasar-1" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="nilai-pasar-1" name="nilai_pasar_kjpp"
class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['nilai_pasar_kjpp'] ?? '' }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="likuidasi-1" class="form-label max-w-56">Nilai Likuidasi(%)</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="likuidasi-1" name="persentase_likuidasi_kjpp" class="input w-full likuidasi"
placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)"
data-group="1" value="{{ $callReport['persentase_likuidasi_kjpp'] ?? '' }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="total-likuidasi-1" class="form-label max-w-56">Total Nilai Likuidasi (NL)</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="total-likuidasi-1" name="hasil_nilai_likuidasi_kjpp"
class="input w-full total-likuidasi currency-format" placeholder="Hasil perhitungan" value="{{ $callReport['hasil_nilai_likuidasi_kjpp'] ?? '' }}">
</div>
</div>
</div>
</div> </div>
<div class="card-body grid gap-5 w-full"> <!-- Bagian Nilai Internal -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
<label for="Lelang" class="form-label max-w-56">Lelang ke </label> <div class="card-header bg-agi-50">
<div class="flex flex-wrap items-baseline w-full"> <h1 class="text-md font-medium text-gray-900 uppercase">Nilai Internal</h1>
<input type="text" id="lelang" name="lelang" class="input w-full"
placeholder="Masukkan Lelang" value="{{ $callReport['lelang'] ?? old('lelang') }}">
</div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="card-body grid gap-5 w-full">
<label for="penilai" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<div class="flex flex-wrap items-baseline w-full"> <label for="lelang-2" class="form-label max-w-56">Lelang ke </label>
<input type="text" id="nilai-pasar" name="nilai_pasar" <div class="flex flex-wrap items-baseline w-full">
class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi" <input type="text" id="lelang-2" name="lelang_internal" class="input w-full"
value="{{ $callReport['nilai_pasar'] ?? old('likuidasi') }}"> placeholder="Masukkan Lelang" value="{{ $callReport['lelang_internal'] ?? '' }}">
</div>
</div> </div>
</div> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <label for="nilai-pasar-2" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label>
<label for="likuidasi_nilai_1" class="form-label max-w-56">Nilai Likuidasi(%)</label> <div class="flex flex-wrap items-baseline w-full">
<div class="flex flex-wrap items-baseline w-full"> <input type="text" id="nilai-pasar-2" name="nilai_pasar_internal"
<input type="text" id="likuidasi" name="likuidasi" class="input w-full likuidasi" class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['nilai_pasar_internal'] ?? '' }}">
placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)" value="{{ $callReport['persentase_likuidasi'] ?? old('likuidasi') }}"> </div>
</div> </div>
</div> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <label for="likuidasi-2" class="form-label max-w-56">Nilai Likuidasi(%)</label>
<label for="total-likuidasi" class="form-label max-w-56">Total Nilai Likuidasi <div class="flex flex-wrap items-baseline w-full">
(NL)</label> <input type="text" id="likuidasi-2" name="persentase_likuidasi_internal" class="input w-full likuidasi"
<div class="flex flex-wrap items-baseline w-full"> placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)"
<input type="text" id="total-likuidasi" name="likuidasi_nilai_1" data-group="2" value="{{ $callReport['persentase_likuidasi_internal'] ?? '' }}">
class="input w-full total-likuidasi currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['hasil_nilai_likuidasi'] ?? old('likuidasi') }}"> </div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="total-likuidasi-2" class="form-label max-w-56">Total Nilai Likuidasi (NL)</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="total-likuidasi-2" name="hasil_nilai_likuidasi_internal"
class="input w-full total-likuidasi currency-format" placeholder="Hasil perhitungan" value="{{ $callReport['hasil_nilai_likuidasi_internal'] ?? '' }}">
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -315,10 +356,9 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="penilai" class="form-label max-w-56">Pihak KJPP</label> <label for="penilai" class="form-label max-w-56">Pihak KJPP</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" id="penilai" name="pihak_kjjpp" <input type="text" id="penilai" name="pihak_kjjpp" class="input w-full "
class="input w-full " value="{{ $callReport['pihak_kjjpp'] ?? ($forminspeksi['signature']['kjjp']['name'] ?? '') }}"
value="{{ $forminspeksi['signature']['kjjp']['name'] ?? $callReport['pihak_kjjpp'] ?? '' }}" placeholder="Masukkan Nama KJPP">
placeholder="Masukkan Nama KJPP">
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
@@ -382,7 +422,8 @@
@else @else
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full"> <div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
<textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old('fakta_positif.0', '') }}</textarea> <textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old('fakta_positif.0', '') }}</textarea>
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;"> <button class="btn btn-danger btn-sm remove-btn" type="button"
style="display: none;">
<i class="ki-outline ki-trash"></i> <i class="ki-outline ki-trash"></i>
</button> </button>
</div> </div>
@@ -410,7 +451,8 @@
@else @else
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full"> <div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old('fakta_negatif.0', $forminspeksi['fakta']['fakta_negatif'][0] ?? '') }}</textarea> <textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old('fakta_negatif.0', $forminspeksi['fakta']['fakta_negatif'][0] ?? '') }}</textarea>
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;"> <button class="btn btn-danger btn-sm remove-btn" type="button"
style="display: none;">
<i class="ki-outline ki-trash"></i> <i class="ki-outline ki-trash"></i>
</button> </button>
<em id="error-fakta_negatif" class="alert text-danger text-sm"></em> <em id="error-fakta_negatif" class="alert text-danger text-sm"></em>
@@ -463,10 +505,10 @@
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px"> <div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator'])) @if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()"> <button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()">
<i class="ki-filled ki-save-2"></i> <i class="ki-filled ki-save-2"></i>
<span id="saveButtonText">Save</span> <span id="saveButtonText">Save</span>
</button> </button>
@endif @endif
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal'])) @if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal']))
<a class="btn btn-info" <a class="btn btn-info"
@@ -501,24 +543,41 @@
perihal: "", perihal: "",
pihak_kjjpp: "", pihak_kjjpp: "",
dari: "", dari: "",
lelang: "", lelang_kjpp: "",
nilai_pasar: "", nilai_pasar_kjpp: "",
persentase_likuidasi: "", persentase_likuidasi_kjpp: "",
hasil_nilai_likuidasi: "" hasil_nilai_likuidasi_kjpp: "",
lelang_internal: "",
nilai_pasar_internal: "",
persentase_likuidasi_internal: "",
hasil_nilai_likuidasi_internal: "",
}; };
jsonData.perihal = document.querySelector('input[name="perihal"]')?.value.trim() || ""; jsonData.perihal = document.querySelector('input[name="perihal"]')?.value.trim() || "";
jsonData.pihak_kjjpp = document.querySelector('input[name="pihak_kjjpp"]')?.value.trim() || "";
jsonData.dari = document.querySelector('input[name="dari"]')?.value.trim() || ""; jsonData.dari = document.querySelector('input[name="dari"]')?.value.trim() || "";
jsonData.tanggal = document.querySelector('input[name="tanggal"]')?.value.trim() || ""; jsonData.tanggal = document.querySelector('input[name="tanggal"]')?.value.trim() || "";
jsonData.kepada = document.querySelector('input[name="kepada"]')?.value.trim() || ""; jsonData.kepada = document.querySelector('input[name="kepada"]')?.value.trim() || "";
jsonData.nomor_laporan = document.querySelector('input[name="nomor_laporan"]')?.value.trim() || ""; jsonData.nomor_laporan = document.querySelector('input[name="nomor_laporan"]')?.value.trim() || "";
jsonData.lelang = document.querySelector('input[name="lelang"]')?.value.trim() || ""; jsonData.lelang_kjpp = document.querySelector('input[name="lelang_kjpp"]')?.value.trim() || "";
// Ambil nilai lainnya // Ambil nilai lainnya
jsonData.nilai_pasar = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar"]')?.value.trim() || ""); jsonData.nilai_pasar_kjpp = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar_kjpp"]')?.value.trim() ||
jsonData.persentase_likuidasi = cleanCurrencyValue(document.querySelector('input[name="likuidasi"]')?.value.trim() || ""); "");
jsonData.hasil_nilai_likuidasi = cleanCurrencyValue(document.querySelector('input[name="likuidasi_nilai_1"]')?.value.trim() || ""); jsonData.persentase_likuidasi_kjpp = cleanCurrencyValue(document.querySelector('input[name="persentase_likuidasi_kjpp"]')?.value
.trim() || "");
jsonData.hasil_nilai_likuidasi_kjpp = cleanCurrencyValue(document.querySelector('input[name="hasil_nilai_likuidasi_kjpp"]')
?.value.trim() || "");
jsonData.lelang_internal = document.querySelector('input[name="lelang_internal"]')?.value.trim() || "";
jsonData.nilai_pasar_internal = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar_internal"]')?.value.trim() ||
"");
jsonData.persentase_likuidasi_internal = cleanCurrencyValue(document.querySelector('input[name="persentase_likuidasi_internal"]')?.value
.trim() || "");
jsonData.hasil_nilai_likuidasi_internal = cleanCurrencyValue(document.querySelector('input[name="hasil_nilai_likuidasi_internal"]')
?.value.trim() || "");
return jsonData; return jsonData;
} }
@@ -533,22 +592,22 @@
const inspeksiId = urlParams.get('inspeksiId'); const inspeksiId = urlParams.get('inspeksiId');
const faktaPositif = Array.from(document.querySelectorAll('[name="fakta_positif[]"]')) const faktaPositif = Array.from(document.querySelectorAll('[name="fakta_positif[]"]'))
.map(textarea => textarea.value.trim()) .map(textarea => textarea.value.trim())
.filter(value => value !== ''); .filter(value => value !== '');
const faktaNegatif = Array.from(document.querySelectorAll('[name="fakta_negatif[]"]')) const faktaNegatif = Array.from(document.querySelectorAll('[name="fakta_negatif[]"]'))
.map(textarea => textarea.value.trim()) .map(textarea => textarea.value.trim())
.filter(value => value !== ''); .filter(value => value !== '');
const keterangan = Array.from(document.querySelectorAll('[name="keterangan[]"]')) const keterangan = Array.from(document.querySelectorAll('[name="keterangan[]"]'))
.map(textarea => textarea.value.trim()) .map(textarea => textarea.value.trim())
.filter(value => value !== ''); .filter(value => value !== '');
const action = Array.from(document.querySelectorAll('input[name="action"]')) const action = Array.from(document.querySelectorAll('input[name="action"]'))
.map(input => input.value) .map(input => input.value)
.join(',') || ""; .join(',') || "";
const type = Array.from(document.querySelectorAll('input[name="type"]')) const type = Array.from(document.querySelectorAll('input[name="type"]'))
.map(input => input.value) .map(input => input.value)
.join(',') || ""; .join(',') || "";
const requestUrl = const requestUrl =
`{{ route('penilai.storeCallReport') }}?permohonan_id=${permohonanId}&inspeksi_id=${inspeksiId}&dokument_id=${documentId}`; `{{ route('penilai.storeCallReport') }}?permohonan_id=${permohonanId}&inspeksi_id=${inspeksiId}&dokument_id=${documentId}`;
@@ -563,10 +622,10 @@
inspeksi_id: inspeksiId, inspeksi_id: inspeksiId,
data: jsonData, data: jsonData,
fakta_positif: faktaPositif, fakta_positif: faktaPositif,
fakta_negatif: faktaNegatif, fakta_negatif: faktaNegatif,
action: action, action: action,
type: type, type: type,
keterangan: keterangan keterangan: keterangan
}), }),
contentType: 'application/json', contentType: 'application/json',
headers: { headers: {
@@ -613,29 +672,33 @@
} }
</script> </script>
<script> <script>
function calculateTotal() { function calculateTotal(event) {
let nilaiPasarInput = document.getElementById('nilai-pasar'); const group = event.dataset.group;
let nilaiLikuidasi = document.getElementById('likuidasi');
let totalLikuidasi = document.getElementById('total-likuidasi');
const cleanNilaiPasar = cleanCurrencyValue(nilaiPasarInput.value);
let cleanLikuidasi = cleanCurrencyValue(nilaiLikuidasi.value);
// Batasi likuidasi maksimal hingga 100 // Ambil elemen-elemen terkait berdasarkan group
cleanLikuidasi = Math.min(parseFloat(cleanLikuidasi) || 0, 100); const nilaiPasarInput = document.querySelector(`#nilai-pasar-${group}`);
const nilaiLikuidasi = document.querySelector(`#likuidasi-${group}`);
const totalLikuidasi = document.querySelector(`#total-likuidasi-${group}`);
// Format nilai likuidasi dengan simbol % const cleanNilaiPasar = cleanCurrencyValue(nilaiPasarInput.value);
nilaiLikuidasi.value = cleanLikuidasi; let cleanLikuidasi = cleanCurrencyValue(nilaiLikuidasi.value);
// Konversi ke angka untuk perhitungan // Batasi likuidasi maksimal hingga 100
const nilaiPasar = parseFloat(cleanNilaiPasar) || 0; cleanLikuidasi = Math.min(parseFloat(cleanLikuidasi) || 0, 100);
const likuidasi = cleanLikuidasi / 100; // Konversi persentase ke desimal
// Hitung total likuidasi // Format nilai likuidasi dengan simbol %
const totalNilaiLikuidasi = nilaiPasar * likuidasi; nilaiLikuidasi.value = cleanLikuidasi;
// Tampilkan hasil dengan format yang benar // Konversi ke angka untuk perhitungan
totalLikuidasi.value = formatCurrency(totalNilaiLikuidasi.toString()); const nilaiPasar = parseFloat(cleanNilaiPasar) || 0;
} const likuidasi = cleanLikuidasi / 100; // Konversi persentase ke desimal
// Hitung total likuidasi
const totalNilaiLikuidasi = nilaiPasar * likuidasi;
// Tampilkan hasil dengan format yang benar
totalLikuidasi.value = formatCurrency(totalNilaiLikuidasi.toString());
}
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {

View File

@@ -748,320 +748,325 @@
@include('lpj::penilai.components.print-pembanding') @include('lpj::penilai.components.print-pembanding')
</div> </div>
<div class="no-break"> <div class="no-break">
<table style="width: 100%"> <table style="width: 100%">
<tr> <tr>
<td style="border: 1px solid #000; "> <strong>E. INFORMASI NILAI</strong> <td style="border: 1px solid #000; "> <strong>E. INFORMASI NILAI</strong>
</td> </td>
</tr> </tr>
</table> </table>
<table style="width: 100%;"> <table style="width: 100%;">
<tr> <tr>
<td style="padding: 8px; width: 100%;"> <td style="padding: 8px; width: 100%;">
<table style="width: 100%; border-collapse: collapse;"> <table style="width: 100%; border-collapse: collapse;">
<tr> <tr>
<td colspan="3" style="padding: 8px; text-align: left;"> <td colspan="3" style="padding: 8px; text-align: left;">
<strong>a. Total Nilai Pasar Wajar</strong> <strong>a. Total Nilai Pasar Wajar</strong>
</td> </td>
</tr> </tr>
@php
$labelNilai = [
'bangunan' => 'Luas Bangunan',
'tanah' => 'Luas Tanah',
'apartement-kantor' => 'Luas Apartemen/Kantor',
'alat-berat' => 'Luas Alat Berat',
'mesin' => 'Luas Mesin',
'kendaraan' => 'Luas Kendaraan',
'pesawat' => 'Luas Pesawat',
'kapal' => 'Luas Kapal',
];
@endphp
@foreach ($labelNilai as $key => $label)
@if (isset($lpjData['luas_' . $key]))
<tr>
<td style="padding: 3px; text-align: right; width:30%; ">
{{ $label }} {{ $lpjData['luas_' . $key] ?? '' }} m<sup>2</sup>
</td>
<td style="padding: 3px; width:30%;">
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
{{ $lpjData['nilai_' . $key . '_1'] ?? '' }}
</td>
<td style="padding: 3px; text-align: left; width:40%;">
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
{{ $lpjData['nilai_' . $key . '_2'] ?? '' }}
</td>
</tr>
@endif
@endforeach
@if (isset($lpjData['npw_tambahan']))
@foreach ($lpjData['npw_tambahan'] as $npw)
<tr>
<td style="padding: 3px; text-align: right;">
{{ $npw['name'] }} {{ $npw['luas'] }} m<sup>2</sup>
</td>
<td style="padding: 3px;">
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
{{ $npw['nilai_1'] }}
</td>
<td style="padding: 3px; text-align: left; width:40%">
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
{{ $npw['nilai_2'] }}
</td>
</tr>
@endforeach
@endif
<tr>
<td style="padding: 3px; font-weight: bold; width:30%;">Total Nilai Pasar Wajar</td>
<td style="padding: 3px; text-align: right; font-weight: bold; width:30%"></td>
<td style="padding: 3px; text-align: left; font-weight: bold; width: 40%;">
<span style="padding-left: 20px; padding-right: 20px;">=</span>
<div style="display: inline-block; border-top: 1px solid black; padding-top: 3px;">
Rp {{ $lpjData['total_nilai_pasar_wajar'] ?? '' }}
</div>
</td>
</tr>
<tr>
<td colspan="3" style="padding: 8px; text-align: left; font-weight: bold;">
b. Total Nilai Likuidasi
</td>
</tr>
<tr>
<td style="padding: 3px; text-align: right; width:30%">
{{ $lpjData['likuidasi'] ?? '' }}%
</td>
<td style="padding: 3px; text-align: left; font-weight: bold; width:30%">
<span style="padding-left:20px; padding-right: 20px">X</span> Total Nilai Pasar Wajar
</td>
<td style="padding: 3px; text-align: left; width:40%;">
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
{{ $lpjData['likuidasi_nilai_2'] ?? '' }}
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="no-break">
<table style="width: 100%;">
<tr>
<td style="border: 1px solid #000;">
F. ANALISA FAKTA
</td>
</tr>
<tr>
<table>
<tr>
<td width="25%" style="vertical-align: top;"><strong>Faktor Positif</strong></td>
<td>
@isset($forminspeksi['fakta']['fakta_positif'])
<table style="width: 100%; border-collapse: collapse;">
@foreach ($forminspeksi['fakta']['fakta_positif'] as $key => $item)
<tr>
<td>{!! nl2br(e($item)) !!}</td>
</tr>
@endforeach
</table>
@endisset
</td>
</tr>
<tr>
<td width="25%" style="vertical-align: top;"><strong>Faktor Negatif</strong></td>
<td>
@isset($forminspeksi['fakta']['fakta_negatif'])
<table style="width: 100%; border-collapse: collapse;">
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $key => $item)
<tr>
<td>{!! nl2br(e($item)) !!}</td>
</tr>
@endforeach
</table>
@endisset
</td>
</tr>
<tr>
<td width="25%" style="vertical-align: top;"><strong>Batas batas</strong></td>
<td>
@foreach ($forminspeksi['fakta']['batas_batas_input'] ?? [] as $arah => $batas)
@if ($batas)
<p> - {{ $arah }} : {{ $batas }}</p>
@endif
@endforeach
</td>
</tr>
<tr>
<td width="25%" style="vertical-align: top;"><strong>Informasi Dinas Tata Ruang</strong>
</td>
<td>
@php @php
$informasi = [ $labelNilai = [
'peruntukan', 'bangunan' => 'Luas Bangunan',
'kdb', 'tanah' => 'Luas Tanah',
'kdh', 'apartement-kantor' => 'Luas Apartemen/Kantor',
'gsb', 'alat-berat' => 'Luas Alat Berat',
'max_lantai', 'mesin' => 'Luas Mesin',
'klb', 'kendaraan' => 'Luas Kendaraan',
'gss', 'pesawat' => 'Luas Pesawat',
'pelebaran_jalan', 'kapal' => 'Luas Kapal',
'nama_petugas',
]; ];
@endphp @endphp
@foreach ($labelNilai as $key => $label)
@foreach ($informasi as $key) @if (isset($lpjData['luas_' . $key]))
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-') <tr>
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}: <td style="padding: 3px; text-align: right; width:30%; ">
{{ $forminspeksi['fakta'][$key] }}</p> {{ $label }} {{ $lpjData['luas_' . $key] ?? '' }} m<sup>2</sup>
</td>
<td style="padding: 3px; width:30%;">
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
{{ $lpjData['nilai_' . $key . '_1'] ?? '' }}
</td>
<td style="padding: 3px; text-align: left; width:40%;">
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
{{ $lpjData['nilai_' . $key . '_2'] ?? '' }}
</td>
</tr>
@endif @endif
@endforeach @endforeach
@if (isset($lpjData['npw_tambahan']))
</td> @foreach ($lpjData['npw_tambahan'] as $npw)
</tr> <tr>
<td style="padding: 3px; text-align: right;">
@if (!empty($forminspeksi['fakta']['keterangan'])) {{ $npw['name'] }} {{ $npw['luas'] }} m<sup>2</sup>
</td>
<td style="padding: 3px;">
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
{{ $npw['nilai_1'] }}
</td>
<td style="padding: 3px; text-align: left; width:40%">
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
{{ $npw['nilai_2'] }}
</td>
</tr>
@endforeach
@endif
<tr>
<td style="padding: 3px; font-weight: bold; width:30%;">Total Nilai Pasar Wajar</td>
<td style="padding: 3px; text-align: right; font-weight: bold; width:30%"></td>
<td style="padding: 3px; text-align: left; font-weight: bold; width: 40%;">
<span style="padding-left: 20px; padding-right: 20px;">=</span>
<div style="display: inline-block; border-top: 1px solid black; padding-top: 3px;">
Rp {{ $lpjData['total_nilai_pasar_wajar'] ?? '' }}
</div>
</td>
</tr>
<tr>
<td colspan="3" style="padding: 8px; text-align: left; font-weight: bold;">
b. Total Nilai Likuidasi
</td>
</tr>
<tr>
<td style="padding: 3px; text-align: right; width:30%">
{{ $lpjData['likuidasi'] ?? '' }}%
</td>
<td style="padding: 3px; text-align: left; font-weight: bold; width:30%">
<span style="padding-left:20px; padding-right: 20px">X</span> Total Nilai Pasar Wajar
</td>
<td style="padding: 3px; text-align: left; width:40%;">
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
{{ $lpjData['likuidasi_nilai_2'] ?? '' }}
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="no-break">
<table style="width: 100%;">
<tr>
<td style="border: 1px solid #000;">
F. ANALISA FAKTA
</td>
</tr>
<tr>
<table>
<tr> <tr>
<td width="25%" style="vertical-align: top;"><strong>Catatan yang Perlu <td width="25%" style="vertical-align: top;"><strong>Faktor Positif</strong></td>
Diperhatikan</strong></td>
<td> <td>
@php @isset($forminspeksi['fakta']['fakta_positif'])
$keterangan = $forminspeksi['fakta']['keterangan'] ?? '';
if (is_array($keterangan)) {
$keterangan = implode(', ', array_filter($keterangan));
}
@endphp
@if (!empty($keterangan))
<table style="width: 100%; border-collapse: collapse;"> <table style="width: 100%; border-collapse: collapse;">
<tr> @foreach ($forminspeksi['fakta']['fakta_positif'] as $key => $item)
<td>{{ $keterangan }}</td> <tr>
</tr> <td>{!! nl2br(e($item)) !!}</td>
</tr>
@endforeach
</table> </table>
@endif @endisset
</td> </td>
</tr> </tr>
@endif <tr>
</table> <td width="25%" style="vertical-align: top;"><strong>Faktor Negatif</strong></td>
</tr> <td>
@isset($forminspeksi['fakta']['fakta_negatif'])
<table style="width: 100%; border-collapse: collapse;">
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $key => $item)
<tr>
<td>{!! nl2br(e($item)) !!}</td>
</tr>
@endforeach
</table>
@endisset
</td>
</tr>
<tr>
<td width="25%" style="vertical-align: top;"><strong>Batas batas</strong></td>
<td>
@foreach ($forminspeksi['fakta']['batas_batas_input'] ?? [] as $arah => $batas)
@if ($batas)
<p> - {{ $arah }} : {{ $batas }}</p>
@endif
@endforeach
</td>
</tr>
<tr>
<td width="25%" style="vertical-align: top;"><strong>Informasi Dinas Tata Ruang</strong>
</td>
<td>
@php
$informasi = [
'peruntukan',
'kdb',
'kdh',
'gsb',
'max_lantai',
'klb',
'gss',
'pelebaran_jalan',
'nama_petugas',
];
@endphp
<tr> @foreach ($informasi as $key)
<td> @if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
<table> @php
<div style="margin-top: 20px;"> $displayKey = ucfirst(str_replace('_', ' ', $key));
<label style="font-weight: bold;">DISCLAIMER</label> if (strlen($key) == 3) {
<div> $displayKey = strtoupper($key);
<ol style="padding-left: 20px; list-style-type: decimal; margin-top: 0;"> }
@endphp
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
@endif
@endforeach
<li style="margin-bottom: 5px;">PENILAIAN INI DIBUAT BERDASARKAN ATURAN YANG </td>
BERLAKU DI SUBDIT APPRAISAL</li> </tr>
<li style="margin-bottom: 5px;">LAPORAN INI DIBUAT BERDASARKAN DATA FOTOCOPY
DOKUMEN YANG DITERIMA PENILAI DENGAN ASUMSI BAHWA DATA TERSEBUT SESUAI DENGAN
DOKUMEN ASLINYA</li>
<li style="margin-bottom: 5px;">PENILAI TIDAK MELAKUKAN PEMBUKTIAN LEBIH RINCI ATAU
PENGAKUAN TERTULIS DARI PIHAK YANG DITEMUI SAAT PENILAIAN, ATAS INFORMASI YANG
DIBERIKAN SECARA LISAN SEHUBUNGAN DENGAN IDENTITAS DIRI DAN HUBUNGAN DI ANTARA
PIHAK TERKAIT SAAT MELAKUKAN INSPEKSI OBJEK YANG DINILAI</li>
<li style="margin-bottom: 5px;">LAPORAN INI DIGUNAKAN HANYA UNTUK KEPENTINGAN
INTERNAL DAN DILARANG MENYEBARKAN KEPADA PIHAK KETIGA</li>
</ol>
</div>
</div>
@if (!empty($forminspeksi['fakta']['keterangan']))
<tr>
<td width="25%" style="vertical-align: top;"><strong>Catatan yang Perlu
Diperhatikan</strong></td>
<td>
@php
$keterangan = $forminspeksi['fakta']['keterangan'] ?? '';
if (is_array($keterangan)) {
$keterangan = implode(', ', array_filter($keterangan));
}
@endphp
@if (!empty($keterangan))
<table style="width: 100%; border-collapse: collapse;">
<tr>
<td>{{ $keterangan }}</td>
</tr>
</table>
@endif
</td>
</tr>
@endif
</table> </table>
</td> </tr>
</tr>
<tr> <tr>
<td>Demikian laporan penilai jaminan ini di buat secara objektif, tanpa adanya pengaruh baik intern <td>
maupun ekstern</td> <table>
</tr> <div style="margin-top: 20px;">
<tr> <label style="font-weight: bold;">DISCLAIMER</label>
<table style="width: 100%; border-collapse: collapse; text-align: center;"> <div>
@php <ol style="padding-left: 20px; list-style-type: decimal; margin-top: 0;">
use Modules\Usermanagement\Models\User;
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
$imagePathPenilai = storage_path(
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
);
$soUser = User::where('id', $senior_officer->id)->first(); <li style="margin-bottom: 5px;">PENILAIAN INI DIBUAT BERDASARKAN ATURAN YANG
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign); BERLAKU DI SUBDIT APPRAISAL</li>
<li style="margin-bottom: 5px;">LAPORAN INI DIBUAT BERDASARKAN DATA FOTOCOPY
DOKUMEN YANG DITERIMA PENILAI DENGAN ASUMSI BAHWA DATA TERSEBUT SESUAI DENGAN
DOKUMEN ASLINYA</li>
<li style="margin-bottom: 5px;">PENILAI TIDAK MELAKUKAN PEMBUKTIAN LEBIH RINCI ATAU
PENGAKUAN TERTULIS DARI PIHAK YANG DITEMUI SAAT PENILAIAN, ATAS INFORMASI YANG
DIBERIKAN SECARA LISAN SEHUBUNGAN DENGAN IDENTITAS DIRI DAN HUBUNGAN DI ANTARA
PIHAK TERKAIT SAAT MELAKUKAN INSPEKSI OBJEK YANG DINILAI</li>
<li style="margin-bottom: 5px;">LAPORAN INI DIGUNAKAN HANYA UNTUK KEPENTINGAN
INTERNAL DAN DILARANG MENYEBARKAN KEPADA PIHAK KETIGA</li>
</ol>
</div>
</div>
$imagePathEO = storage_path( </table>
'app/public/signatures/' . </td>
User::role('EO Appraisal')->first()->id . </tr>
'/' .
User::role('EO Appraisal')->first()->sign,
);
$imagePathDD = storage_path( <tr>
'app/public/signatures/' . <td>Demikian laporan penilai jaminan ini di buat secara objektif, tanpa adanya pengaruh baik intern
User::role('DD Appraisal')->first()->id . maupun ekstern</td>
'/' . </tr>
User::role('DD Appraisal')->first()->sign, <tr>
); <table style="width: 100%; border-collapse: collapse; text-align: center;">
@endphp @php
<tr> use Modules\Usermanagement\Models\User;
<td style=" padding: 4px;height: 50px"> $penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
@if (file_exists($imagePathPenilai)) $imagePathPenilai = storage_path(
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px"> 'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
);
$soUser = User::where('id', $senior_officer->id)->first();
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
$imagePathEO = storage_path(
'app/public/signatures/' .
User::role('EO Appraisal')->first()->id .
'/' .
User::role('EO Appraisal')->first()->sign,
);
$imagePathDD = storage_path(
'app/public/signatures/' .
User::role('DD Appraisal')->first()->id .
'/' .
User::role('DD Appraisal')->first()->sign,
);
@endphp
<tr>
<td style=" padding: 4px;height: 50px">
@if (file_exists($imagePathPenilai))
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
@endif
</td>
@if ($permohonan->approval_so != null)
<td style=" padding: 4px;height: 50px">
@if (file_exists($imagePathSo))
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
@endif
</td>
@endif @endif
</td> @if ($permohonan->approval_eo != null)
@if ($permohonan->approval_so != null) <td style=" padding: 4px;height: 50px">
<td style=" padding: 4px;height: 50px"> @if (file_exists($imagePathEO))
@if (file_exists($imagePathSo)) <img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px"> @endif
@endif </td>
</td> @endif
@endif @if ($permohonan->approval_dd != null)
@if ($permohonan->approval_eo != null) <td style=" padding: 4px;height: 50px">
<td style=" padding: 4px;height: 50px"> @if (file_exists($imagePathDD))
@if (file_exists($imagePathEO)) <img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px"> @endif
@endif </td>
</td> @endif
@endif </tr>
@if ($permohonan->approval_dd != null) <tr>
<td style=" padding: 4px;height: 50px"> <td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
@if (file_exists($imagePathDD))
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
@endif
</td>
@endif
</tr>
<tr>
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
<span>
{{ ucwords(strtolower('PENILAI')) }}
</span>
</td>
@if ($permohonan->approval_so != null)
<td style=" padding: 4px;">
{{ $senior_officer->name ?? '' }}</br>
<span> <span>
{{ ucwords(strtolower('SENIOR OFFICER')) }} {{ ucwords(strtolower('PENILAI')) }}
</span> </span>
</td>
@if ($permohonan->approval_so != null)
<td style=" padding: 4px;">
{{ $senior_officer->name ?? '' }}</br>
<span>
{{ ucwords(strtolower('SENIOR OFFICER')) }}
</span>
</td> </td>
@endif @endif
@if ($permohonan->approval_eo != null) @if ($permohonan->approval_eo != null)
<td style=" padding: 4px;"> <td style=" padding: 4px;">
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br> {{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
<span> <span>
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }} {{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
</span> </span>
</td> </td>
@endif @endif
@if ($permohonan->approval_dd != null) @if ($permohonan->approval_dd != null)
<td style=" padding: 4px;"> <td style=" padding: 4px;">
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br> {{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
<span> <span>
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }} {{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
</span> </span>
</td> </td>
@endif @endif
</tr> </tr>
</table> </table>
</tr> </tr>
</table> </table>
</div> </div>
<div class="page-break"></div> <div class="page-break"></div>
<table style="width: 100%; border-collapse: collapse; border: 1px solid #000;"> <table style="width: 100%; border-collapse: collapse; border: 1px solid #000;">

View File

@@ -415,7 +415,7 @@
YANG BERLAKU, APABILA LEWAT MAKA HARUS DILAKUKAN ORDER ULANG SESUAI PROSEDUR YANG YANG BERLAKU, APABILA LEWAT MAKA HARUS DILAKUKAN ORDER ULANG SESUAI PROSEDUR YANG
BERLAKU BERLAKU
</li> </li>
<li>Apabila sudah melewati 6 bulan, maka harus penilaian ulang kembali <li class="uppercase">Apabila sudah melewati 6 bulan, maka harus penilaian ulang kembali
</li> </li>
</ol> </ol>
</div> </div>

View File

@@ -10,7 +10,7 @@
<div class="card border border-agi-100 pb-2.5"> <div class="card border border-agi-100 pb-2.5">
<div class="card-header bg-agi-50" id="basic_settings"> <div class="card-header bg-agi-50" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title">
Detail Penilai Detail Penilaian
</h3> </h3>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('penilai.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> <a href="{{ route('penilai.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>

View File

@@ -329,10 +329,10 @@
).then((result) => { ).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
const requestData = isPaparanSO ? { const requestData = isPaparanSO ? {
message: result.value.keterangan, message: result.value.message,
tanggalPaparan: result.value.tanggalPaparan tanggalPaparan: result.value.tanggalPaparan
} : { } : {
message: result.value.keterangan message: result.value.message
}; };
handleAjaxRequest( handleAjaxRequest(

View File

@@ -206,7 +206,14 @@
if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') { if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') {
actionHtml += ` actionHtml += `
<a onclick="surveyorRescheduleJadwalSurvey(${data.id},${data.penilaian.id},'${data.nomor_registrasi}', '${data.debiture.name}', '${data.penilaian.waktu_penilaian}', ${JSON.stringify(data.penilaian.rejected_note)})" class="delete btn btn-sm btn-outline btn-light" title="Reschedule Jadwal Survey"> <a onclick="surveyorRescheduleJadwalSurvey(
${data.id},
${data.penilaian.id},
${data.nomor_registrasi},
${data.debiture.name},
${data.penilaian.waktu_penilaian},
${JSON.stringify(data.penilaian.rejected_note)}
)" class="delete btn btn-sm btn-outline btn-light" title="Reschedule Jadwal Survey">
<i class="ki-filled ki-calendar-remove"></i> <i class="ki-filled ki-calendar-remove"></i>
</a>`; </a>`;
} }

View File

@@ -5,8 +5,6 @@
@endsection @endsection
@section('content') @section('content')
<link rel="stylesheet" href="https://unpkg.com/dropzone@5/dist/min/dropzone.min.css" type="text/css" />
{{-- <link rel="stylesheet" href="https://uicdn.toast.com/tui-image-editor/latest/tui-image-editor.css" /> --}}
<style> <style>
.dropzone { .dropzone {
border: 2px dashed #3498db; border: 2px dashed #3498db;
@@ -266,9 +264,6 @@
@include('lpj::surveyor.js.fotojs') @include('lpj::surveyor.js.fotojs')
@include('lpj::surveyor.js.utils') @include('lpj::surveyor.js.utils')
@push('scripts') @push('scripts')
<script src="https://unpkg.com/dropzone@5/dist/min/dropzone.min.js"></script>
<script src="https://scaleflex.cloudimg.io/v7/plugins/filerobot-image-editor/latest/filerobot-image-editor.min.js">
</script>
<script> <script>
let jsonDataContoh = @json($formFoto); let jsonDataContoh = @json($formFoto);
Dropzone.autoDiscover = false; Dropzone.autoDiscover = false;
@@ -609,7 +604,7 @@
e.preventDefault(); e.preventDefault();
// Get the file path from hidden input // Get the file path from hidden input
const filePath = document.getElementById('editDataFilePath').value; const filePath = document.getElementById('editDataFilePath').value;
if (filePath) { if (filePath) {
openFilerobotEditor(filePath); openFilerobotEditor(filePath);
} else { } else {
@@ -632,20 +627,9 @@
const config = { const config = {
source: imagePath || '', source: imagePath || '',
onSave: (editedImageObject, designState) => { onSave: (editedImageObject, designState) => {
console.log('Image saved', editedImageObject);
// Save the edited image
saveEditedImage(editedImageObject, document.getElementById('editDataFilePath').value); saveEditedImage(editedImageObject, document.getElementById('editDataFilePath').value);
window.FilerobotImageEditor.terminate();
// Close the editor
FilerobotImageEditor.terminate();
// Hide the modal
document.getElementById('modal_10').setAttribute('data-modal-dismiss', 'true');
// Update the preview if needed
updateImagePreview(editedImageObject.imageBase64 || editedImageObject.imageCanvas.toDataURL());
}, },
annotationsCommon: { annotationsCommon: {
fill: '#ff0000' fill: '#ff0000'
@@ -681,17 +665,29 @@
config config
); );
// Render the editor
filerobotImageEditor.render({ filerobotImageEditor.render({
onClose: (closingReason) => { onClose: (closingReason) => {
console.log('Editor closed:', closingReason); console.log('Editor closed:', closingReason);
filerobotImageEditor.terminate(); filerobotImageEditor.terminate();
// Hide the modal let closeButton = document.getElementById('modal_10');
document.querySelector('#modal_10').setAttribute('data-modal-dismiss', 'true');
if (!closeButton) {
closeButton = document.createElement('button');
closeButton.setAttribute('data-modal-dismiss', 'true');
closeButton.setAttribute('type', 'button');
closeButton.setAttribute('class', 'btn btn-primary');
closeButton.setAttribute('data-modal-toggle', '#modal_10');
document.body.appendChild(closeButton);
}
closeButton.click();
console.log('Modal closed via close button simulation');
} }
}); });
} }
window.addEditAndDeleteButtons = function(file, response) { window.addEditAndDeleteButtons = function(file, response) {
@@ -828,16 +824,23 @@
formData.append('original_path', originalFilePath); formData.append('original_path', originalFilePath);
formData.forEach((value, key) => { formData.forEach((value, key) => {
console.log(`${key}:`, value); console.log(`${key}:`, value);
}); });
fetch('/api/save-edited-image', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
$.ajax({
url: `{{ route('surveyor.saveEditedImage') }}`,
type: 'POST',
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
},
data: {
edited_image: imageData,
original_path: originalFilePath,
nomor_registrasi: '{{ $permohonan->nomor_registrasi }}'
},
success: function(response) {
Swal.fire({ Swal.fire({
icon: 'success', icon: 'success',
title: 'Perubahan Disimpan', title: 'Perubahan Disimpan',
@@ -848,17 +851,23 @@
window.location.reload(); window.location.reload();
} }
});; });
},
}) error: function(xhr) {
.catch(error => {
const errorMessage = xhr.responseJSON?.message || 'Terjadi kesalahan'; const errorMessage = xhr.responseJSON?.message || 'Terjadi kesalahan';
Swal.fire({ Swal.fire({
icon: 'error', icon: 'error',
title: 'Gagal Menyimpan', title: 'Gagal Menyimpan',
text: errorMessage, text: errorMessage,
}).then((response) => {
if (response.isConfirmed) {
window.location.reload();
}
}); });
});
}
});
} }
</script> </script>
@endpush @endpush

View File

@@ -339,7 +339,7 @@
@endphp @endphp
<select id="hub_cadeb_tidak_sesuai" class="input w-full" name="hub_cadeb_tidak_sesuai" <select id="hub_cadeb_tidak_sesuai" class="input w-full" name="hub_cadeb_tidak_sesuai"
style="{{ old('hub_cadeb_tidak_sesuai', $selectedData) ? '' : 'display: none;' }}"> style="{{ $statusKey != 'sesuai' ? '' : 'display: none;' }}">
<option value="">Select Hubungan Cadeb</option> <option value="">Select Hubungan Cadeb</option>
@if (isset($basicData['hubCadeb'])) @if (isset($basicData['hubCadeb']))
@foreach ($basicData['hubCadeb'] as $item) @foreach ($basicData['hubCadeb'] as $item)
@@ -403,7 +403,7 @@
<input id="hub_penghuni_tidak_sesuai" class="input" name="hub_penghuni_tidak_sesuai" <input id="hub_penghuni_tidak_sesuai" class="input" name="hub_penghuni_tidak_sesuai"
placeholder="Masukkan Hubungan penghuni jaminan" placeholder="Masukkan Hubungan penghuni jaminan"
value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}" value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}"
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData ?? false) ? '' : 'display: none;' }}"> style="{{ $statusKey != 'sesuai' ? '' : 'display: none;' }}">
</div> </div>
<em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em> <em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em>
</div> </div>

View File

@@ -91,6 +91,8 @@
@push('scripts') @push('scripts')
<script src="https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
const datas = @json($forminspeksi);
console.log(datas);
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const signaturePads = {}; const signaturePads = {};
const types = ['penilai', 'cabang', 'debitur', 'kjjp']; const types = ['penilai', 'cabang', 'debitur', 'kjjp'];
@@ -343,8 +345,6 @@
showLoadingSwal('Mengirim data ke server...'); showLoadingSwal('Mengirim data ke server...');
const form = document.querySelector('form'); const form = document.querySelector('form');
const formData = new FormData(form); const formData = new FormData(form);
console.log('Form data entries:', Array.from(formData.entries()));
$.ajax({ $.ajax({
url: '{{ route('surveyor.store') }}', url: '{{ route('surveyor.store') }}',
type: 'POST', type: 'POST',
@@ -364,8 +364,8 @@
confirmButtonText: 'OK' confirmButtonText: 'OK'
}).then((response) => { }).then((response) => {
if (response.isConfirmed) { if (response.isConfirmed) {
window.location.href = // window.location.href =
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}'; // '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
} }
}); });
} else { } else {
@@ -389,8 +389,6 @@
}); });
return; return;
} }
let errors = xhr.responseJSON?.errors; let errors = xhr.responseJSON?.errors;
$('.alert').text(''); $('.alert').text('');
if (errors) { if (errors) {

View File

@@ -7,7 +7,7 @@
: 'sesuai'; : 'sesuai';
$luasBangunan = $forminspeksi['bangunan']['luas_tanah_bagunan'][$cekLuasBangunan] ?? null; $luasBangunan = $forminspeksi['bangunan']['luas_tanah_bagunan'][$cekLuasBangunan] ?? null;
@endphp @endphp
<td width="25%"><strong>Luas Tanah Bangunan</strong></td> <td width="25%"><strong>Luas Bangunan (IMB)</strong></td>
<td>{{ $luasBangunan }}</td> <td>{{ $luasBangunan }}</td>
</tr> </tr>
@@ -28,6 +28,7 @@
<input type="checkbox" <input type="checkbox"
{{ isset($forminspeksi['bangunan']['jenis_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['jenis_bangunan']) ? 'checked' : '' }}> {{ isset($forminspeksi['bangunan']['jenis_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['jenis_bangunan']) ? 'checked' : '' }}>
{{ $item->name }} {{ $item->name }}
</label> </label>
</td> </td>
@endforeach @endforeach
@@ -80,6 +81,18 @@
<input type="checkbox" name="sifat_bangunan[]" value="{{ $item->name }}" <input type="checkbox" name="sifat_bangunan[]" value="{{ $item->name }}"
{{ isset($forminspeksi['bangunan']['sifat_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['sifat_bangunan']) ? 'checked' : '' }}> {{ isset($forminspeksi['bangunan']['sifat_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['sifat_bangunan']) ? 'checked' : '' }}>
{{ $item->name }} {{ $item->name }}
@if (isset($forminspeksi['bangunan']['sifat_bangunan']) &&
in_array($item->name, $forminspeksi['bangunan']['sifat_bangunan']))
@php
$inputValues = isset($forminspeksi['bangunan']['sifat_bangunan_input'][$index])
? $forminspeksi['bangunan']['sifat_bangunan_input'][$index]
: null;
@endphp
@if ($inputValues)
<span class="label-checkbox"> - {{ $inputValues }}</span>
@endif
@endif
</label> </label>
</td> </td>
@endforeach @endforeach
@@ -90,7 +103,8 @@
</tr> </tr>
@if (isset($forminspeksi['bangunan']['spesifikasi_bangunan']) && count($forminspeksi['bangunan']['spesifikasi_bangunan']) > 0) @if (isset($forminspeksi['bangunan']['spesifikasi_bangunan']) &&
count($forminspeksi['bangunan']['spesifikasi_bangunan']) > 0)
@foreach ($forminspeksi['bangunan']['spesifikasi_bangunan'] as $bangunanIndex => $bangunan) @foreach ($forminspeksi['bangunan']['spesifikasi_bangunan'] as $bangunanIndex => $bangunan)
<tr> <tr>
<td colspan="2"><strong>Spesifikasi Bangunan {{ $bangunanIndex + 1 }}</strong></td> <td colspan="2"><strong>Spesifikasi Bangunan {{ $bangunanIndex + 1 }}</strong></td>
@@ -109,14 +123,20 @@
@php @php
$selectedValues = []; $selectedValues = [];
if (isset($bangunan['spek_kategori_bangunan'][$spesifikasi->name])) { if (isset($bangunan['spek_kategori_bangunan'][$spesifikasi->name])) {
$selectedValues = array_values($bangunan['spek_kategori_bangunan'][$spesifikasi->name]); $selectedValues = array_values(
$bangunan['spek_kategori_bangunan'][$spesifikasi->name],
);
} }
$lainnyaValue = $bangunan['spek_kategori_bangunan'][$spesifikasi->name]['lainnya'] ?? ''; $lainnyaValue =
$bangunan['spek_kategori_bangunan'][$spesifikasi->name][
'lainnya'
] ?? '';
@endphp @endphp
<td class="checkbox-item"> <td class="checkbox-item">
<label class="checkbox-label"> <label class="checkbox-label">
<input type="checkbox" class="checkbox-lainnya" style="margin-right: 3px;" <input type="checkbox" class="checkbox-lainnya"
style="margin-right: 3px;"
name="spesifikasi_bangunan[{{ $bangunanIndex }}][{{ $spesifikasi->name }}][]" name="spesifikasi_bangunan[{{ $bangunanIndex }}][{{ $spesifikasi->name }}][]"
value="{{ $kategori->name }}" value="{{ $kategori->name }}"
@if (in_array($kategori->name, $selectedValues)) checked @endif> @if (in_array($kategori->name, $selectedValues)) checked @endif>
@@ -134,19 +154,19 @@
@php $count++; @endphp @php $count++; @endphp
@if ($count % 3 == 0) @if ($count % 3 == 0)
</tr>
<tr>
@endif
@endif
@endforeach
</tr> </tr>
<tr>
@endif @endif
</table> @endif
</td> @endforeach
</tr> </tr>
@endforeach @endif
@endif </table>
@endforeach </td>
</tr>
@endforeach
@endif
@endforeach
@endif @endif
</table> </table>

View File

@@ -129,8 +129,13 @@
@foreach ($informasi as $key) @foreach ($informasi as $key)
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-') @if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}: @php
{{ $forminspeksi['fakta'][$key] }}</p> $displayKey = ucfirst(str_replace('_', ' ', $key));
if (strlen($key) == 3) {
$displayKey = strtoupper($key);
}
@endphp
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
@endif @endif
@endforeach @endforeach
</td> </td>

View File

@@ -13,23 +13,23 @@
<table> <table>
<tr> <tr>
<td width="25%">Jarak Jalan Utama</td> <td width="25%">Jarak Jalan Utama</td>
<td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td>Jalan Lingkungan</td> <td>Jalan Lingkungan</td>
<td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['jalan_linkungan'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td>Jarak CBD Point</td> <td>Jarak CBD Point</td>
<td>{{ $forminspeksi['lingkungan']['jarak_cbd_point'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['jarak_cbd_point'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td>Nama CBD Point</td> <td>Nama CBD Point</td>
<td>{{ $forminspeksi['lingkungan']['nama_cbd_point'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['nama_cbd_point'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td>Lebar Perkerasan Jalan</td> <td>Lebar Perkerasan Jalan</td>
<td>{{ $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? 'Tidak Diketahui' }}</td> <td>{{ $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? '' }}</td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: top;"><strong>Sarana Pelengkap</strong></td> <td style="vertical-align: top;"><strong>Sarana Pelengkap</strong></td>
@@ -191,6 +191,55 @@
</td> </td>
</tr> </tr>
<tr>
<td style="vertical-align: top;"><strong>Dekat Makam</strong></td>
<td>
<div class="checkbox-item">
<label class="checkbox-label">
<input type="radio" name="disekitar_lokasi" value="ya"
{{ ($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya' ? 'checked' : '' }}>
Ya
@if (($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya')
- Nama Makam:
{{ $forminspeksi['lingkungan']['nama_makam'] ?? '' }}
, Jarak Makam:
{{ $forminspeksi['lingkungan']['jarak_makam'] ?? '' }}
@endif
</label>
<label class="checkbox-label">
<input type="radio" name="disekitar_lokasi" value="tidak"
{{ ($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'tidak' ? 'checked' : '' }}>
Tidak
</label>
</div>
</td>
</tr>
<tr>
<td style="vertical-align: top;"><strong>Dekat TPS</strong></td>
<td>
<div class="checkbox-item">
<label class="checkbox-label">
<input type="radio" name="disekitar_lokasi" value="ya"
{{ ($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'ya' ? 'checked' : '' }}>
Ya
@if (($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'ya')
- Nama TPS:
{{ $forminspeksi['lingkungan']['nama_tps'] ?? '' }}
, Jarak TPS:
{{ $forminspeksi['lingkungan']['jarak_tps'] ?? '' }}
@endif
</label>
<label class="checkbox-label">
<input type="radio" name="disekitar_lokasi" value="tidak"
{{ ($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'tidak' ? 'checked' : '' }}>
Tidak
</label>
</div>
</td>
</tr>
<tr> <tr>
<td style="vertical-align: top;"><strong>Merupakan Daerah</strong></td> <td style="vertical-align: top;"><strong>Merupakan Daerah</strong></td>
<td> <td>

View File

@@ -193,6 +193,12 @@
.page-break { .page-break {
page-break-after: always; page-break-after: always;
} }
.no-break {
page-break-inside: avoid;
page-break-before: auto;
page-break-after: auto;
}
</style> </style>
</head> </head>
@@ -308,7 +314,13 @@
</tr> </tr>
<tr> <tr>
<td><strong>Nama Debiture/ Wakil Debiture</strong></td> <td><strong>Nama Debiture/ Wakil Debiture</strong></td>
<td>{{ $permohonan->debiture->name ?? '' }}</td> <td>{{ $permohonan->debiture->name ?? '' }}
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
/ {{ $item }}
@endforeach
@endif
</td>
<td><strong>Kunjungan Tanggal</strong></td> <td><strong>Kunjungan Tanggal</strong></td>
<td>{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td> <td>{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
</tr> </tr>
@@ -556,10 +568,12 @@
</table> </table>
</td> </td>
</tr> </tr>
@if (strtolower($permohonan->tujuanPenilaian->name) == 'rap') @if (strtolower($permohonan->tujuanPenilaian->name) == 'rap')
@include('lpj::surveyor.components.print-out.rap') @include('lpj::surveyor.components.print-out.rap')
@else @else
<tr> <tr>
<td style="text-align: center; border: 1px solid #000;"> <td style="text-align: center; border: 1px solid #000;">
E E
</td> </td>
@@ -600,7 +614,7 @@
</td> </td>
</tr> </tr>
@endIf @endIf
</div>
{{-- <tr> {{-- <tr>
<td style="text-align: center; border: 1px solid #000;"> <td style="text-align: center; border: 1px solid #000;">
G G

View File

@@ -123,13 +123,16 @@
<td><strong>Tusuk Sate</strong></td> <td><strong>Tusuk Sate</strong></td>
<td> <td>
<label> <label>
<input type="radio" name="tusuk_sate" value="yes" <input type="radio" name="tusuk_sate" value="Ya"
{{ isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'yes' ? 'Ya' : 'Tidak' }} {{ isset($forminspeksi['tanah']['tusuk_sate']['Ya']) && $forminspeksi['tanah']['tusuk_sate']['Ya'] ? 'checked' : '' }}>
Ya Ya
@if (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'])
{{ isset($forminspeksi['tanah']['tusuk_sate']['Ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate']['Ya'] . ')' : '' }}
@endif
</label> </label>
<label> <label>
<input type="radio" name="tusuk_sate" value="no" <input type="radio" name="tusuk_sate" value="Tidak"
{{isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'no' ? 'checked' : '' }}> {{isset($forminspeksi['tanah']['tusuk_sate']['Tidak']) && $forminspeksi['tanah']['tusuk_sate']['Tidak'] ? 'checked' : '' }}>
Tidak Tidak
</label> </label>
</td> </td>

View File

@@ -13,16 +13,16 @@
@if (isset($permohonan->documents)) @if (isset($permohonan->documents))
@foreach ($permohonan->documents as $item) @foreach ($permohonan->documents as $item)
@php @php
$luas_tanah = 0; $luas_tanah = 0;
if ($item->detail) { if ($item->detail) {
foreach ($item->detail as $luas) { foreach ($item->detail as $luas) {
if (isset($luas->name) && $luas->jenis_legalitas_jaminan_id === 1) { if (isset($luas->name) && $luas->jenis_legalitas_jaminan_id === 1) {
$details = json_decode($luas->details, true); $details = json_decode($luas->details, true);
$luas_tanah = isset($details['luas_tanah']) ? $details['luas_tanah'] : 0; $luas_tanah = isset($details['luas_tanah']) ? $details['luas_tanah'] : 0;
break; break;
}
} }
} }
}
@endphp @endphp
<input type="hidden" name="luas_tanah_sesuai" class="input" value="{{ $luas_tanah }}"> <input type="hidden" name="luas_tanah_sesuai" class="input" value="{{ $luas_tanah }}">
<p class="text-2sm text-gray-700">{{ $luas_tanah }} m<sup>2</sup></p> <p class="text-2sm text-gray-700">{{ $luas_tanah }} m<sup>2</sup></p>
@@ -33,26 +33,26 @@
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2"> <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"> <label class="form-label flex items-center gap-3 text-nowrap">
<input type="radio" class="radio" name="luas_tanah" value="sesuai" <input type="radio" class="radio" name="luas_tanah" value="sesuai"
onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])" onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])"
{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['sesuai'])) ? 'checked' : '' }}> {{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['sesuai'])) ? 'checked' : '' }}>
<span class="ml-2">Sesuai</span> <span class="ml-2">Sesuai</span>
</label> </label>
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="luas_tanah" value="tidak sesuai" <input type="radio" class="radio" name="luas_tanah" value="tidak sesuai"
onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])" onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])"
{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? 'checked' : '' }}> {{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? 'checked' : '' }}>
<span class="ml-2">Tidak Sesuai</span> <span class="ml-2">Tidak Sesuai</span>
</label> </label>
<div id="luas_tanah_tidak_sesuai" class="flex items-baseline gap-2" <div id="luas_tanah_tidak_sesuai" class="flex items-baseline gap-2"
style="{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? '' : 'display: none;' }}"> style="{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? '' : 'display: none;' }}">
<div class="input"> <div class="input">
<input id="analisa_tanah_tidak_sesuai" type="text" name="luas_tanah_tidak_sesuai" <input id="analisa_tanah_tidak_sesuai" type="text" name="luas_tanah_tidak_sesuai"
class="w-full number-format" placeholder="Masukan Luas Tanah" class="w-full number-format" placeholder="Masukan Luas Tanah"
value="{{ old('luas_tanah_tidak_sesuai', $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}"> value="{{ old('luas_tanah_tidak_sesuai', $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}">
<i>M<sup>2</sup></i> <i>M<sup>2</sup></i>
</div> </div>
<button type="button" class="btn btn-md btn-primary" <button type="button" class="btn btn-md btn-primary"
onclick="updateAnalisa('analisa_tanah')">Save onclick="updateAnalisa('analisa_tanah')">Save
</button> </button>
</div> </div>
</div> </div>
@@ -70,42 +70,41 @@
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2"> <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"> <label class="form-label flex items-center gap-3 text-nowrap">
<input type="radio" class="radio" name="hadap_mata_angin" value="sesuai" <input type="radio" class="radio" name="hadap_mata_angin" value="sesuai"
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak 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' : '' }}> {{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])) ? 'checked' : '' }}>
<span class="ml-2">Sesuai</span> <span class="ml-2">Sesuai</span>
</label> </label>
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="hadap_mata_angin" value="tidak sesuai" <input type="radio" class="radio" name="hadap_mata_angin" value="tidak sesuai"
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['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' : '' }}> {{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? 'checked' : '' }}>
<span class="ml-2">Tidak Sesuai</span> <span class="ml-2">Tidak Sesuai</span>
</label> </label>
<!-- Select dropdown untuk "Tidak Sesuai" --> <!-- 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 items-baseline gap-2"
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}"> style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
<select <select class="input w-full
class="input w-full id="
id=" hadap_mata_angin_tidak_sesuai" hadap_mata_angin_tidak_sesuai" name="hadap_mata_angin_tidak_sesuai">
name="hadap_mata_angin_tidak_sesuai"> @php
@php $statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])
$statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai']) ? 'sesuai'
? 'sesuai' : 'tidak sesuai';
: 'tidak sesuai'; $selectedData = $forminspeksi['tanah']['hadap_mata_angin'][$statusKey] ?? null;
$selectedData = $forminspeksi['tanah']['hadap_mata_angin'][$statusKey] ?? null; @endphp
@endphp <option value="">Select Hadap Mata Angin</option>
<option value="">Select Hadap Mata Angin</option> @if (isset($basicData['arahMataAngin']))
@if (isset($basicData['arahMataAngin'])) @foreach ($basicData['arahMataAngin'] as $item)
@foreach ($basicData['arahMataAngin'] as $item) <option value="{{ $item->name }}"
<option value="{{ $item->name }}" {{ old('hadap_mata_angin_tidak_sesuai', $selectedData ?? '') == $item->name ? 'selected' : '' }}>
{{ old('hadap_mata_angin_tidak_sesuai', $selectedData ?? '') == $item->name ? 'selected' : '' }}> {{ $item->name }}
{{ $item->name }} </option>
</option>
@endforeach @endforeach
@endif @endif
</select> </select>
{{-- <button type="button" class="btn btn-md btn-primary" onclick="updateAnalisa('hadap_mata_angin')">Save</button> --}} {{-- <button type="button" class="btn btn-md btn-primary" onclick="updateAnalisa('hadap_mata_angin')">Save</button> --}}
</div> </div>
</div> </div>
<em id="error-hadap_mata_angin" class="alert text-danger text-sm"></em> <em id="error-hadap_mata_angin" class="alert text-danger text-sm"></em>
@@ -122,22 +121,22 @@
<div class="flex items-center"> <div class="flex items-center">
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="bentuk_tanah[]" type="checkbox" <input class="checkbox" name="bentuk_tanah[]" type="checkbox"
value="{{ $item->name }}" value="{{ $item->name }}"
{{ in_array($item->name, old('bentuk_tanah', [])) || {{ in_array($item->name, old('bentuk_tanah', [])) ||
(isset($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) && (isset($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) &&
is_array($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) && is_array($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) &&
in_array($item->name, $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah'])) in_array($item->name, $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']))
? 'checked' ? 'checked'
: '' }} : '' }}
onclick="toggleCheckboxVisibility('bentuk_tanah', 'bentuk_tanah_lainnya', ['lainnya'])"/> onclick="toggleCheckboxVisibility('bentuk_tanah', 'bentuk_tanah_lainnya', ['lainnya'])" />
{{ $item->name }} {{ $item->name }}
</label> </label>
@if (strcasecmp($item->name, 'lainnya') == 0) @if (strcasecmp($item->name, 'lainnya') == 0)
<input id="bentuk_tanah_lainnya" type="text" <input id="bentuk_tanah_lainnya" type="text"
style="{{ isset($forminspeksi['tanah']['bentuk_tanah']['lainnya']) && $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ? '' : 'display: none;' }}" 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="input w-full mt-2"
placeholder="Masukkan bentuk tanah..." placeholder="Masukkan bentuk tanah..."
value="{{ old('bentuk_tanah_lainnya', $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ?? '') }}"/> value="{{ old('bentuk_tanah_lainnya', $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ?? '') }}" />
@endif @endif
</div> </div>
@endforeach @endforeach
@@ -155,7 +154,7 @@
@foreach ($basicData['konturTanah'] as $item) @foreach ($basicData['konturTanah'] as $item)
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="kontur_tanah[]" type="checkbox" <input class="checkbox" name="kontur_tanah[]" type="checkbox"
value="{{ $item->name }}" value="{{ $item->name }}"
{{ in_array($item->name, old('kontur_tanah', $forminspeksi['tanah']['kontur_tanah'] ?? [])) ? 'checked' : '' }} /> {{ in_array($item->name, old('kontur_tanah', $forminspeksi['tanah']['kontur_tanah'] ?? [])) ? 'checked' : '' }} />
{{ $item->name }} {{ $item->name }}
</label> </label>
@@ -175,24 +174,24 @@
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="ketinggian_jalan[]" type="checkbox" <input class="checkbox" name="ketinggian_jalan[]" type="checkbox"
value="{{ $item->name }}" value="{{ $item->name }}"
{{ in_array($item->name, old('ketinggian_jalan', $forminspeksi['tanah']['ketinggian_jalan'] ?? [])) ? 'checked' : '' }} {{ in_array($item->name, old('ketinggian_jalan', $forminspeksi['tanah']['ketinggian_jalan'] ?? [])) ? 'checked' : '' }}
onclick="toggleMultipleFields('ketinggian_jalan', { onclick="toggleMultipleFields('ketinggian_jalan', {
'Lebih Tinggi': 'input-lebih-tinggi', 'Lebih Tinggi': 'input-lebih-tinggi',
'Lebih Rendah': 'input-lebih-rendah' 'Lebih Rendah': 'input-lebih-rendah'
})"/> })" />
{{ $item->name }} {{ $item->name }}
</label> </label>
@if (strcasecmp($item->name, 'Lebih Tinggi') == 0) @if (strcasecmp($item->name, 'Lebih Tinggi') == 0)
<input id="input-lebih-tinggi" type="text" <input id="input-lebih-tinggi" type="text"
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ? '' : 'display: none;' }}" 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="m2" name="ketinggian_lebih_tinggi" class="input w-full mt-2" placeholder="m2"
value="{{ old('ketinggian_lebih_tinggi', $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ?? '') }}"/> value="{{ old('ketinggian_lebih_tinggi', $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ?? '') }}" />
@elseif (strcasecmp($item->name, 'Lebih Rendah') == 0) @elseif (strcasecmp($item->name, 'Lebih Rendah') == 0)
<input id="input-lebih-rendah" type="text" <input id="input-lebih-rendah" type="text"
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ? '' : 'display: none;' }}" 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="m" name="ketinggian_lebih_rendah" class="input w-full mt-2" placeholder="m"
value="{{ old('ketinggian_lebih_rendah', $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ?? '') }}"/> value="{{ old('ketinggian_lebih_rendah', $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ?? '') }}" />
@endif @endif
</div> </div>
@@ -247,17 +246,17 @@
<div class="flex items-center"> <div class="flex items-center">
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="posisi_kavling[]" type="checkbox" <input class="checkbox" name="posisi_kavling[]" type="checkbox"
value="{{ $item->name }}" value="{{ $item->name }}"
{{ in_array($item->name, $selectedPosisiKavling) ? 'checked' : '' }} {{ in_array($item->name, $selectedPosisiKavling) ? 'checked' : '' }}
onclick="toggleCheckboxVisibility('posisi_kavling', 'posisi_kavling_lainnya', ['Lainnya'])"/> onclick="toggleCheckboxVisibility('posisi_kavling', 'posisi_kavling_lainnya', ['Lainnya'])" />
{{ $item->name }} {{ $item->name }}
</label> </label>
@if (strcasecmp($item->name, 'Lainnya') == 0) @if (strcasecmp($item->name, 'Lainnya') == 0)
<input id="posisi_kavling_lainnya" type="text" <input id="posisi_kavling_lainnya" type="text"
style="{{ $lainnyaValue ? '' : 'display: none' }}" style="{{ $lainnyaValue ? '' : 'display: none' }}"
name="posisi_kavling_lainnya" class="input w-full mt-2" name="posisi_kavling_lainnya" class="input w-full mt-2"
placeholder="Masukkan Posisi Kavling lainnya..." placeholder="Masukkan Posisi Kavling lainnya..."
value="{{ $lainnyaValue }}"/> value="{{ $lainnyaValue }}" />
@endif @endif
</div> </div>
@endforeach @endforeach
@@ -272,14 +271,25 @@
<label class="form-label max-w-56">Tusuk Sate</label> <label class="form-label max-w-56">Tusuk Sate</label>
<div class="flex-wrap items-stretch"> <div class="flex-wrap items-stretch">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2"> <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"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="tusuk_sate" value="yes" <input onclick="toggleFieldVisibility('tusuk_sate', 'tusuk_sate_ya', ['Ya'])"
{{ old('tusuk_sate') == 'yes' || (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'yes') ? 'checked' : '' }}> type="radio" class="radio" name="tusuk_sate" value="Ya"
{{ old('tusuk_sate') == 'Ya' || (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya']) ? 'checked' : '' }}>
<span class="ml-2">Ya</span> <span class="ml-2">Ya</span>
@php
$statusKey = isset($forminspeksi['tanah']['tusuk_sate']['Ya']) ? 'Ya' : 'Tidak';
$selectedData = $forminspeksi['tanah']['tusuk_sate'][$statusKey] ?? null;
@endphp
<input id="tusuk_sate_ya" class="input" name="tusuk_sate_ya"
placeholder="Masukkan Tusuk Sate..."
value="{{ old('tusuk_sate_ya', isset($selectedData) ? $selectedData : '') }}"
style="{{ $statusKey == 'Ya' ? '' : 'display: none;' }}">
</label> </label>
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="tusuk_sate" value="no" <input onclick="toggleFieldVisibility('tusuk_sate', 'tusuk_sate_ya', ['Ya'])"
{{ old('tusuk_sate') == 'no' || (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'no') ? 'checked' : '' }}> 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> <span class="ml-2">Tidak</span>
</label> </label>
</div> </div>
@@ -316,9 +326,9 @@
@foreach ($basicData['kondisiFisikTanah'] as $item) @foreach ($basicData['kondisiFisikTanah'] as $item)
<label class="form-label flex items-center gap-2.5 text-nowrap"> <label class="form-label flex items-center gap-2.5 text-nowrap">
<input class="checkbox" name="kondisi_fisik_tanah[]" type="checkbox" <input class="checkbox" name="kondisi_fisik_tanah[]" type="checkbox"
value="{{ $item->name }}" 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' : '' }} {{ 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' : '' }}
onclick="toggleInputLainnya(this, 'kondisi_fisik_tanah_lainnya', '{{ $item->name }}')"/> onclick="toggleInputLainnya(this, 'kondisi_fisik_tanah_lainnya', '{{ $item->name }}')" />
{{ $item->name }} {{ $item->name }}
</label> </label>
@@ -326,9 +336,9 @@
@if (strcasecmp($item->name, 'lainnya') == 0) @if (strcasecmp($item->name, 'lainnya') == 0)
<div class="flex items-center"> <div class="flex items-center">
<input type="text" name="kondisi_fisik_tanah_lainnya" <input type="text" name="kondisi_fisik_tanah_lainnya"
id="kondisi_fisik_tanah_lainnya" class="input mt-2" id="kondisi_fisik_tanah_lainnya" class="input mt-2"
placeholder="Masukkan Kondisi Fisik Tanah..." style="display: none;" placeholder="Masukkan Kondisi Fisik Tanah..." style="display: none;"
value="{{ old('kondisi_fisik_tanah_lainnya', isset($forminspeksi['tanah']['kondisi_fisik_tanah']['lainnya'])) }}"> value="{{ old('kondisi_fisik_tanah_lainnya', isset($forminspeksi['tanah']['kondisi_fisik_tanah']['lainnya'])) }}">
</div> </div>
@endif @endif
@endforeach @endforeach

View File

@@ -101,6 +101,8 @@
@endsection @endsection
@push('scripts') @push('scripts')
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script> <script>
function surveyorFreeze(permohonanId, noReg, debitur) { function surveyorFreeze(permohonanId, noReg, debitur) {
@@ -308,12 +310,33 @@
<div class="text-left space-y-4"> <div class="text-left space-y-4">
<p class="text-gray-700 text-center">Untuk membuat jadwal kunjungan, silahkan isi form berikut!</p> <p class="text-gray-700 text-center">Untuk membuat jadwal kunjungan, silahkan isi form berikut!</p>
<div> <div>
<label for="waktu_penilaian" class="block text-sm font-medium text-gray-700 mb-1 " style="text-align: start;">Jadwal Kunjungan <span class="text-danger">*</span></label> <label for="tanggal_kunjungan" class="block text-sm font-medium text-gray-700 mb-1" style="text-align: start;">Tanggal Kunjungan <span class="text-danger">*</span></label>
<input type="datetime-local" id="waktu_penilaian" class="input" style="margin-top: 10px;" required> <input type="date" id="tanggal_kunjungan" class="input" style="margin-top: 10px; width: 100%;" required>
</div> </div>
<div> <div>
<label for="deskripsi_penilaian" class="block text-sm font-medium text-gray-700 mb-1 mt-2" style="text-align: start;">Keterangan <span class="text-danger">*</span> </label> <label class="block text-sm font-medium text-gray-700 mb-1 mt-2" style="text-align: start;">Waktu Kunjungan (Format 24 Jam) <span class="text-danger">*</span></label>
<textarea id="deskripsi-penilaian" class="textarea" placeholder="Masukkan keterangan" style="margin-top: 10px;" required></textarea> <div style="display: flex; align-items: center; gap: 10px; margin-top: 10px;">
<div style="position: relative; flex: 1;">
<input type="text" id="jam_kunjungan" class="input" maxlength="2" style="width: 100%; text-align: center; padding-right: 30px;" placeholder="00">
<div style="position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;">
<button type="button" id="jam_up" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px; margin-bottom: 2px;">▲</button>
<button type="button" id="jam_down" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px;">▼</button>
</div>
</div>
<span style="font-weight: bold;">:</span>
<div style="position: relative; flex: 1;">
<input type="text" id="menit_kunjungan" class="input" maxlength="2" style="width: 100%; text-align: center; padding-right: 30px;" placeholder="00">
<div style="position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;">
<button type="button" id="menit_up" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px; margin-bottom: 2px;">▲</button>
<button type="button" id="menit_down" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px;">▼</button>
</div>
</div>
</div>
</div>
<div>
<label for="deskripsi-penilaian" class="block text-sm font-medium text-gray-700 mb-1 mt-2" style="text-align: start;">Keterangan <span class="text-danger">*</span> </label>
<textarea id="deskripsi-penilaian" class="textarea" placeholder="Masukkan keterangan" style="margin-top: 10px;" required></textarea>
</div> </div>
</div> </div>
`, `,
@@ -322,14 +345,120 @@
cancelButtonColor: '#d33', cancelButtonColor: '#d33',
confirmButtonText: 'Submit', confirmButtonText: 'Submit',
cancelButtonText: 'Batal', cancelButtonText: 'Batal',
didOpen: () => {
// Set default value ke waktu saat ini
const now = new Date();
const dateString = now.toISOString().slice(0, 10);
const hours = now.getHours();
const minutes = now.getMinutes();
// Set default values
document.getElementById('tanggal_kunjungan').value = dateString;
document.getElementById('jam_kunjungan').value = hours.toString().padStart(2, '0');
document.getElementById('menit_kunjungan').value = minutes.toString().padStart(2, '0');
// Handler untuk input jam
const jamInput = document.getElementById('jam_kunjungan');
const jamUp = document.getElementById('jam_up');
const jamDown = document.getElementById('jam_down');
// Validasi hanya angka untuk jam
jamInput.addEventListener('input', function(e) {
this.value = this.value.replace(/[^0-9]/g, '').substring(0, 2);
let value = parseInt(this.value, 10);
if (!isNaN(value)) {
if (value > 23) {
this.value = "00";
} else {
this.value = value.toString().padStart(2, '0');
}
}
});
jamInput.addEventListener('blur', function() {
if (this.value === "" || isNaN(parseInt(this.value, 10))) {
this.value = "00";
} else {
this.value = parseInt(this.value, 10).toString().padStart(2, '0');
}
});
// Button handlers untuk jam
jamUp.addEventListener('click', function() {
let value = parseInt(jamInput.value, 10);
if (isNaN(value)) value = 0;
value = (value + 1) % 24;
jamInput.value = value.toString().padStart(2, '0');
});
jamDown.addEventListener('click', function() {
let value = parseInt(jamInput.value, 10);
if (isNaN(value)) value = 0;
value = (value - 1 + 24) % 24;
jamInput.value = value.toString().padStart(2, '0');
});
// Handler untuk input menit
const menitInput = document.getElementById('menit_kunjungan');
const menitUp = document.getElementById('menit_up');
const menitDown = document.getElementById('menit_down');
// Validasi hanya angka untuk menit
menitInput.addEventListener('input', function(e) {
this.value = this.value.replace(/[^0-9]/g, '').substring(0, 2);
let value = parseInt(this.value, 10);
if (!isNaN(value)) {
if (value > 59) {
this.value = "00";
} else {
this.value = value.toString().padStart(2, '0');
}
}
});
menitInput.addEventListener('blur', function() {
if (this.value === "" || isNaN(parseInt(this.value, 10))) {
this.value = "00";
} else {
this.value = parseInt(this.value, 10).toString().padStart(2, '0');
}
});
// Button handlers untuk menit
menitUp.addEventListener('click', function() {
let value = parseInt(menitInput.value, 10);
if (isNaN(value)) value = 0;
value = (value + 1) % 60;
menitInput.value = value.toString().padStart(2, '0');
});
menitDown.addEventListener('click', function() {
let value = parseInt(menitInput.value, 10);
if (isNaN(value)) value = 0;
value = (value - 1 + 60) % 60;
menitInput.value = value.toString().padStart(2, '0');
});
},
preConfirm: () => { preConfirm: () => {
// Ambil nilai input // Ambil nilai input
const tanggalInspeksi = document.getElementById('waktu_penilaian').value; const tanggalKunjungan = document.getElementById('tanggal_kunjungan').value;
let jamKunjungan = document.getElementById('jam_kunjungan').value;
let menitKunjungan = document.getElementById('menit_kunjungan').value;
const keteranganInspeksi = document.getElementById('deskripsi-penilaian').value; const keteranganInspeksi = document.getElementById('deskripsi-penilaian').value;
// Validasi input: cek apakah input kosong // Validasi input: cek apakah input kosong
if (!tanggalInspeksi.trim()) { if (!tanggalKunjungan.trim()) {
Swal.showValidationMessage('Harap mengisi Jadwal Kunjungan.'); Swal.showValidationMessage('Harap mengisi Tanggal Kunjungan.');
return false;
}
if (!jamKunjungan || !menitKunjungan) {
Swal.showValidationMessage('Harap mengisi Waktu Kunjungan.');
return false; return false;
} }
if (!keteranganInspeksi.trim()) { if (!keteranganInspeksi.trim()) {
@@ -337,9 +466,16 @@
return false; return false;
} }
// Pastikan format 2 digit
jamKunjungan = parseInt(jamKunjungan, 10).toString().padStart(2, '0');
menitKunjungan = parseInt(menitKunjungan, 10).toString().padStart(2, '0');
// Gabungkan tanggal dan waktu dalam format ISO
const datetimeValue = `${tanggalKunjungan}T${jamKunjungan}:${menitKunjungan}`;
// Jika semua valid, kembalikan data // Jika semua valid, kembalikan data
return { return {
tanggal: tanggalInspeksi, tanggal: datetimeValue,
keterangan: keteranganInspeksi keterangan: keteranganInspeksi
}; };
} }
@@ -360,17 +496,15 @@
deskripsi_penilaian: keterangan deskripsi_penilaian: keterangan
}; };
// Change from PUT to POST method
$.ajax({ $.ajax({
url: useURL, url: useURL,
type: "POST", // Changed from PUT to POST type: "POST",
cache: false, cache: false,
data: input_data, data: input_data,
success: function(response) { success: function(response) {
if (response.success) { if (response.success) {
// Arahkan langsung ke halaman inspeksi Swal.fire('Berhasil!', 'Berhasil membuat jadwal.', 'success').then(
Swal.fire('Berhasil!', 'Data berhasil disimpan.', 'success').then( () => {
() => {
window.location.reload(); window.location.reload();
}); });
} else { } else {

View File

@@ -3,19 +3,7 @@
const ruteLainnyaDiv = document.getElementById("ruteLainnya"); const ruteLainnyaDiv = document.getElementById("ruteLainnya");
const lantaiLainnyaDiv = document.getElementById("lantaiLainnya"); const lantaiLainnyaDiv = document.getElementById("lantaiLainnya");
// Function to add delete event listeners to existing buttons
function addDeleteListeners(container) {
container.querySelectorAll(".delete-btn").forEach(button => {
button.addEventListener("click", function() {
this.closest(
".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5")
.remove();
});
});
}
// Add delete listeners to existing buttons
addDeleteListeners(ruteLainnyaDiv);
// Create new div for additional items // Create new div for additional items
function createNewDiv(container, inputName) { function createNewDiv(container, inputName) {
@@ -64,13 +52,8 @@
} }
// Event listener for adding more items // Event listener for adding more items
document.getElementById("btnAddMore").addEventListener("click", function() {
createNewDiv(ruteLainnyaDiv, "rute_lainnya");
});
document.getElementById("btnAddMoreObject").addEventListener("click", function() {
createNewDiv(lantaiLainnyaDiv, "lantai_lainnya");
});
function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) { function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) {
const addButton = document.getElementById(buttonId); const addButton = document.getElementById(buttonId);

View File

@@ -600,7 +600,7 @@
Breadcrumbs::for('penilai.show', function (BreadcrumbTrail $trail) { Breadcrumbs::for('penilai.show', function (BreadcrumbTrail $trail) {
$trail->parent('penilai'); $trail->parent('penilai');
$trail->push('Detail Penilai'); $trail->push('Detail Penilaian');
}); });
Breadcrumbs::for('penilai.edit', function (BreadcrumbTrail $trail) { Breadcrumbs::for('penilai.edit', function (BreadcrumbTrail $trail) {

View File

@@ -583,6 +583,7 @@ Route::middleware(['auth'])->group(function () {
Route::put('store-approve-reschedule/{id}', [SurveyorController::class, 'approveReschedule'])->name('approveReschedule'); Route::put('store-approve-reschedule/{id}', [SurveyorController::class, 'approveReschedule'])->name('approveReschedule');
Route::put('store-rejected-reschedule/{id}', [SurveyorController::class, 'rejectReschedule'])->name('rejectReschedule'); Route::put('store-rejected-reschedule/{id}', [SurveyorController::class, 'rejectReschedule'])->name('rejectReschedule');
Route::put('store-proses-survey/{id}', [SurveyorController::class, 'storeProsesSurvey'])->name('storeProsesSurvey'); Route::put('store-proses-survey/{id}', [SurveyorController::class, 'storeProsesSurvey'])->name('storeProsesSurvey');
Route::post('save-edited-image/', [SurveyorController::class, 'saveEditedImage'])->name('saveEditedImage');
}); });