update form menu surveyor

This commit is contained in:
majid
2024-10-23 17:38:38 +07:00
parent dfc9ea74ec
commit 0c976a7b5c
40 changed files with 3679 additions and 1145 deletions

View File

@@ -5,6 +5,7 @@ namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Response;
use Modules\Lpj\Models\Permohonan;
use Modules\Lpj\Models\Branch;
@@ -22,7 +23,21 @@ use Modules\Lpj\Models\SpekBangunan;
use Modules\Lpj\Models\SpekKategoritBangunan;
use Modules\Lpj\Models\SaranaPelengkap;
use Modules\Lpj\Models\ArahMataAngin;
use Modules\Lpj\Models\Analisa;
use Modules\Lpj\Models\AnalisaFakta;
use Modules\Lpj\Models\AnalisaLingkungan;
use Modules\Lpj\Models\AnalisaTanahBagunan;
use Modules\Lpj\Models\SpekBangunanAnalisa;
use Modules\Lpj\Models\Denah;
use Modules\Lpj\Models\FotoJaminan;
use Modules\Lpj\Models\Lingkungan;
use Modules\Lpj\Models\LantaiUnit;
use Modules\Lpj\Models\ObjekJaminan;
use Modules\Lpj\Models\RuteJaminan;
use Modules\Lpj\Models\AnalisaUnit;
use Modules\Lpj\Models\SpekBagunanAnalisaDetail;
use Modules\Lpj\Http\Requests\SurveyorRequest;
use Modules\Lpj\Http\Requests\FormSurveyorRequest;
class SurveyorController extends Controller
{
@@ -35,15 +50,12 @@ class SurveyorController extends Controller
return view('lpj::surveyor.index');
}
/**
* Show the specified resource.
*/
public function show($id)
{
$permohonan = Permohonan::with(
[
$permohonan = Permohonan::with([
'user',
'debiture.province',
'debiture.city',
@@ -53,8 +65,7 @@ class SurveyorController extends Controller
'tujuanPenilaian',
'penilaian',
'documents',
],
)->findOrFail($id);
])->findOrFail($id);
$surveyor = $id;
$branches = Branch::all();
@@ -72,8 +83,41 @@ class SurveyorController extends Controller
$saranaPelengkap = SaranaPelengkap::all();
$arahMataAngin = ArahMataAngin::all();
$jenisJaminanIds = $permohonan->debiture->documents;
$buttonDisable = false;
foreach ($jenisJaminanIds as $jenisJaminanId) {
$denah = Denah::where('permohonan_id', $id)
->where('jenis_jaminan_id', $jenisJaminanId->jenis_jaminan_id)
->first();
$fotojaminan = FotoJaminan::where('permohonan_id', $id)
->where('jenis_jaminan_id', $jenisJaminanId->jenis_jaminan_id)
->first();
$analisa = Analisa::where('permohonan_id', $id)
->where('jenis_jaminan_id', $jenisJaminanId->jenis_jaminan_id)
->first();
// cek jika tidak ada
if (!$denah || !$fotojaminan || !$analisa) {
$buttonDisable = true;
break;
}
}
$denah = Denah::where('permohonan_id', $id)->get();
$fotojaminan = FotoJaminan::where('permohonan_id', $id)->get();
$analisa = Analisa::with('analisaUnit', 'analisaTanahBangunan', 'analisaLingkungan', 'analisaFakta', 'jenisJaminan')
->where('permohonan_id', $id)
->get();
return view('lpj::surveyor.detail', compact(
'buttonDisable',
'fotojaminan',
'denah',
'analisa',
'permohonan',
'surveyor',
'branches',
@@ -89,26 +133,358 @@ class SurveyorController extends Controller
'spekKategoriBagunan',
'spekBangunan',
'saranaPelengkap',
'arahMataAngin',
'arahMataAngin'
));
}
/**
* Show the form for editing the specified resource.
* Store form inspeksi.
*/
public function edit($id)
public function store(FormSurveyorRequest $request)
{
return view('lpj::edit');
$validatedData = $request->validated();
DB::beginTransaction();
try {
$analisa = Analisa::create($validatedData);
if ($analisa) {
$validatedData['analisa_id'] = $analisa->id;
switch ($validatedData['action']) {
case 'tanah_bangunan':
$this->handleTanahBangunan($validatedData, $request);
break;
case 'unit':
$this->handleUnit($validatedData);
break;
default:
throw new \Exception('Invalid action type');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
AnalisaLingkungan::create($validatedData);
$validatedData['foto_tempat'] = $this->uploadFile($request->file('foto_tempat'), 'foto_tempat');
AnalisaFakta::create($validatedData);
}
DB::commit();
return redirect()->route('surveyor.show', [
'id' => $validatedData['permohonan_id'],
'form' => 'inspeksi'
])->with('success', 'Data form surveyor berhasil disimpan');
} catch (Exception $e) {
DB::rollback();
return response()->json(['error' => 'Failed to save data', 'details' => $e->getMessage()], 500);
}
}
private function handleTanahBangunan(array $validatedData, FormSurveyorRequest $request)
{
$analisaTanahBangunan = AnalisaTanahBagunan::create($validatedData);
if ($analisaTanahBangunan) {
$this->createSpekBangunanAnalisa($request, $analisaTanahBangunan);
}
}
private function handleUnit(array $validatedData)
{
AnalisaUnit::create($validatedData);
}
private function createSpekBangunanAnalisa($request, $analisaTanahBangunan)
{
foreach ($request->input('kategori', []) as $spek) {
$spek['analisa_tanah_bangunan_id'] = $analisaTanahBangunan->id;
$spekBangunan = SpekBangunanAnalisa::create($spek);
if ($spekBangunan) {
$this->createSpekBangunanAnalisaDetails($request, $spekBangunan);
}
}
}
private function createSpekBangunanAnalisaDetails($request, $spekBangunan)
{
foreach ($request->input('name', []) as $detail) {
$detail['spek_bangunan_analisa_id'] = $spekBangunan->id;
SpekBagunanAnalisaDetail::create($detail);
}
}
public function storeDenah(Request $request)
{
try {
$validatedData = $request->validate([
'foto_denah' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'luas' => 'required|numeric',
'permohonan_id' => 'required',
'jenis_jaminan_id' => 'required'
]);
$validatedData['foto_denah'] = $this->uploadFile($request->file('foto_denah'), 'foto_denah');
Denah::create($validatedData);
return redirect()->route('surveyor.show', [
'id' => $validatedData['permohonan_id'],
'form' => 'denah'
])->with('success', 'Data foto berhasil disimpan');
} catch (Exception $e) {
$failureRedirectUrl = route('surveyor.denah', [
'id' => $validatedData['permohonan_id'],
'jenis_jaminan_id' => $validatedData['jenis_jaminan_id']
]);
$failureRedirectUrl .= '?form=create-denah&denah=' . $validatedData['permohonan_id'] . '&jenis_jaminan=' . $validatedData['jenis_jaminan_id'];
return redirect($failureRedirectUrl)
->withInput()
->with(['error' => 'Gagal menyimpan data: ' . $e->getMessage()]);
}
}
public function storeFoto(Request $request)
{
$validatedData = $request->validate([
'permohonan_id' => 'required',
'jenis_jaminan_id' => 'required',
'analisa_type' => 'required|in:tanah_bangunan,unit',
'pendamping' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'foto_objek.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'name_objek.*' => 'required|string|max:255',
'foto_lingkungan.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'name_lingkungan.*' => 'required|string|max:255',
'foto_rute.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'name_rute.*' => 'required|string|max:255',
'lantai.*' => 'nullable|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'name_lantai_unit.*' => 'nullable|string|max:255',
'foto_lantai_unit.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',
]);
DB::beginTransaction();
try {
$pendampingPath = $this->uploadFile($request->file('pendamping'), 'pendamping');
$fotojaminan = FotoJaminan::create([
'pendamping' => $pendampingPath,
'permohonan_id' => $validatedData['permohonan_id'],
'jenis_jaminan_id' => $validatedData['jenis_jaminan_id'],
]);
$this->processObjekUploads($request, $fotojaminan);
$this->processLantaiUnitUploads($request, $fotojaminan);
$this->processUploads('rute', $request, $fotojaminan);
$this->processUploads('lingkungan', $request, $fotojaminan);
DB::commit();
return redirect()->route('surveyor.show', [
'id' => $validatedData['permohonan_id'],
'form' => 'foto'
])->with('success', 'Data foto berhasil disimpan');
} catch (Exception $e) {
DB::rollBack();
return response()->json(['success' => false, 'message' => 'Failed to upload: ' . $e->getMessage()], 500);
}
}
public function update(FormSurveyorRequest $request, $id)
{
$validatedData = $request->validated();
DB::beginTransaction();
try {
// Update Analisa entity
$analisa = Analisa::findOrFail($id);
$analisa->update($validatedData);
if ($analisa) {
$validatedData['analisa_id'] = $analisa->id;
$analisaTanahBangunan = AnalisaTanahBagunan::where('analisa_id', $analisa->id)->firstOrFail();
$analisaTanahBangunan->update($validatedData);
if ($analisaTanahBangunan) {
$this->updateSpekBangunanAnalisa($request, $analisaTanahBangunan);
}
$analisaLingkungan = AnalisaLingkungan::where('analisa_id', $analisa->id)->firstOrFail();
$analisaLingkungan->update($validatedData);
if ($request->hasFile('foto_tempat')) {
$validatedData['foto_tempat'] = $this->uploadFile($request->file('foto_tempat'), 'foto_tempat');
}
$analisaFakta = AnalisaFakta::where('analisa_id', $analisa->id)->firstOrFail();
$analisaFakta->update($validatedData);
}
DB::commit();
return redirect()->route('surveyor.show', [
'id' => $validatedData['permohonan_id'],
'form' => 'inspeksi'
])->with('success', 'Data form surveyor berhasil diperbarui');
} catch (Exception $e) {
DB::rollback();
return response()->json(['error' => 'Failed to update data', 'details' => $e->getMessage()], 500);
}
}
private function updateSpekBangunanAnalisa($request, $analisaTanahBangunan)
{
SpekBangunanAnalisa::where('analisa_tanah_bangunan_id', $analisaTanahBangunan->id)->delete();
foreach ($request->input('kategori', []) as $spek) {
$spek['analisa_tanah_bangunan_id'] = $analisaTanahBangunan->id;
$spekBangunan = SpekBangunanAnalisa::create($spek);
if ($spekBangunan) {
$this->updateSpekBangunanAnalisaDetails($request, $spekBangunan);
}
}
}
private function updateSpekBangunanAnalisaDetails($request, $spekBangunan)
{
// Delete existing SpekBagunanAnalisaDetail records
SpekBagunanAnalisaDetail::where('spek_bangunan_analisa_id', $spekBangunan->id)->delete();
// Create new SpekBagunanAnalisaDetail records
foreach ($request->input('name', []) as $detail) {
$detail['spek_bangunan_analisa_id'] = $spekBangunan->id;
SpekBagunanAnalisaDetail::create($detail);
}
}
public function updateDenah(Request $request, $id): RedirectResponse
{
}
private function processObjekUploads(Request $request, FotoJaminan $fotojaminan)
{
$fotoObjek = $request->file('foto_objek');
$nameObjek = $request->input('name_objek');
$analisaType = $request->input('analisa_type'); // Tambahkan input untuk tipe analisa
if (!is_array($fotoObjek) || !is_array($nameObjek) || count($fotoObjek) !== count($nameObjek)) {
throw new Exception("Mismatched foto_objek and name_objek inputs");
}
// Definisikan labels berdasarkan tipe analisa
$objekLabels = [];
if ($analisaType === 'tanah_bangunan') {
$objekLabels = [
'Tampak Samping Kiri',
'Tampak Samping Kanan',
'Nomor Rumah/Unit'
];
} elseif ($analisaType === 'unit') {
$objekLabels = [
'Tampak Loby',
'Tampak Lift',
'Tampak Samping Kiri Unit',
'Tampak Samping Kanan Unit',
'Tampak Depan Unit',
'Nomor Unit'
];
}
foreach ($fotoObjek as $index => $foto) {
if (!isset($nameObjek[$index])) {
throw new Exception("Missing description for foto_objek at index {$index}");
}
// Pastikan index ada dalam objekLabels
$label = isset($objekLabels[$index]) ? $objekLabels[$index] : "Foto {$index}";
$path = $this->uploadFile($foto, 'objek');
ObjekJaminan::create([
'foto_jaminan_id' => $fotojaminan->id,
'name_objek' => $label . ': ' . $nameObjek[$index],
'foto_objek' => $path,
]);
}
}
private function processUploads($type, Request $request, FotoJaminan $fotojaminan)
{
$files = $request->file("foto_{$type}");
$names = $request->input("name_{$type}");
if (!is_array($files) || !is_array($names) || count($files) !== count($names)) {
throw new Exception("Mismatched foto_{$type} and name_{$type} inputs");
}
foreach ($files as $index => $file) {
if (!isset($names[$index])) {
throw new Exception("Missing description for {$type} at index {$index}");
}
$path = $this->uploadFile($file, $type);
$data = [
'foto_jaminan_id' => $fotojaminan->id,
"name_{$type}" => $names[$index],
"foto_{$type}" => $path,
];
switch ($type) {
case 'rute':
RuteJaminan::create($data);
break;
case 'lingkungan':
Lingkungan::create($data);
break;
}
}
}
private function processLantaiUnitUploads(Request $request, FotoJaminan $fotojaminan)
{
$lantaiFiles = $request->file('foto_lantai_unit');
$lantaiNames = $request->input('name_lantai_unit');
if (!$lantaiFiles) {
return;
}
if (!is_array($lantaiFiles) || !is_array($lantaiNames) || count($lantaiFiles) !== count($lantaiNames)) {
throw new Exception("Mismatched foto_lantai_unit and name_lantai_unit inputs");
}
foreach ($lantaiFiles as $index => $file) {
$path = $this->uploadFile($file, 'lantai');
LantaiUnit::create([
'objek_jaminan_id' => $fotojaminan->id,
'name_lantai_unit' => "Lantai " . ($index + 1),
'foto_lantai_unit' => $path,
]);
}
}
private function uploadFile($file, $type)
{
if (!$file->isValid()) {
throw new Exception("Invalid file upload for {$type}");
}
$fileName = time() . '_' . $file->getClientOriginalName();
$path = $file->storeAs("public/surveyor/{$type}", $fileName);
if ($path === false) {
throw new Exception("Failed to store file for {$type}");
}
return str_replace('public/', '', $path);
}
public function dataForDatatables(Request $request)
{
if (is_null($this->user) || !$this->user->can('debitur.view')) {
@@ -172,74 +548,88 @@ class SurveyorController extends Controller
* Form inspeksi.
*/
public function formInspeksi($id)
public function formInspeksi($id, $jaminanId)
{
$permohonan = Permohonan::with(
[
'user',
'debiture.province',
'debiture.city',
'debiture.district',
'debiture.village',
'branch',
'tujuanPenilaian',
'penilaian'
],
)->findOrFail($id);
$permohonan = $this->getPermohonanJaminanId($id, $jaminanId);
$branches = Branch::all();
$provinces = Province::all();
return view('lpj::surveyor.detail', compact('permohonan', 'branches', 'provinces'));
$surveyor = $id;
$branches = Branch::all();
$provinces = Province::all();
$bentukTanah = BentukTanah::all();
$konturTanah = KonturTanah::all();
$posisiKavling = PosisiKavling::all();
$ketinggianTanah = KetinggianTanah::all();
$kondisiFisikTanah = KondisiFisikTanah::all();
$jenisBangunan = JenisBangunan::all();
$kondisiBangunan = KondisiBangunan::all();
$sifatBangunan = SifatBangunan::all();
$spekKategoriBagunan = SpekKategoritBangunan::all();
$spekBangunan = SpekBangunan::all();
$saranaPelengkap = SaranaPelengkap::all();
$arahMataAngin = ArahMataAngin::all();
$analisa = Analisa::with('analisaTanahBangunan', 'analisaLingkungan', 'analisaFakta', 'jenisJaminan')
->where('permohonan_id', $id)
->where('jenis_jaminan_id', $jaminanId)
->first();
return view('lpj::surveyor.components.inspeksi', compact(
'analisa',
'permohonan',
'surveyor',
'branches',
'provinces',
'bentukTanah',
'konturTanah',
'posisiKavling',
'kondisiFisikTanah',
'ketinggianTanah',
'kondisiBangunan',
'jenisBangunan',
'sifatBangunan',
'spekKategoriBagunan',
'spekBangunan',
'saranaPelengkap',
'arahMataAngin',
));
}
/**
* Denah.
*/
public function denah($id)
public function denah($id, $jaminanId)
{
$permohonan = Permohonan::with(
[
'user',
'debiture.province',
'debiture.city',
'debiture.district',
'debiture.village',
'branch',
'tujuanPenilaian',
'penilaian'
],
)->findOrFail($id);
$surveyor = $id;
$branches = Branch::all();
$provinces = Province::all();
$permohonan = $this->getPermohonanJaminanId($id, $jaminanId);
return view('lpj::surveyor.detail', compact('permohonan', 'surveyor', 'branches', 'provinces'));
$denah = Denah::where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
return view('lpj::surveyor.components.denah', compact('permohonan', 'denah'));
}
/**
* Foto.
*/
public function foto($id)
public function foto($id, $jaminanId)
{
$permohonan = Permohonan::with(
[
'user',
'debiture.province',
'debiture.city',
'debiture.district',
'debiture.village',
'branch',
'tujuanPenilaian',
'penilaian'
],
)->findOrFail($id);
$permohonan = $this->getPermohonanJaminanId($id, $jaminanId);
$surveyor = $id;
$branches = Branch::all();
$provinces = Province::all();
return view('lpj::surveyor.detail', compact('permohonan', 'surveyor', 'branches', 'provinces'));
$fotoJaminan = FotoJaminan::with(['objekJaminan', 'lantaiUnit' ,'ruteJaminan', 'lingkungan'])->where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
// return response()->json([
// 'data' => $fotoJaminan,
// ]);
return view('lpj::surveyor.components.foto', compact('permohonan', 'surveyor', 'branches', 'provinces', 'fotoJaminan'));
}
/**
@@ -537,4 +927,58 @@ class SurveyorController extends Controller
}
private function getPermohonanJaminanId($id, $jaminanId)
{
return Permohonan::with([
'user',
'debiture.province',
'debiture.city',
'debiture.district',
'debiture.village',
'branch',
'tujuanPenilaian',
'penilaian',
'debiture.documents' => function ($query) use ($jaminanId) {
$query->where('jenis_jaminan_id', $jaminanId);
}
])
->whereHas('debiture.documents', function ($query) use ($jaminanId) {
$query->where('jenis_jaminan_id', $jaminanId);
})
->findOrFail($id);
}
private function getCommonData()
{
return [
'branches' => Branch::all(),
'provinces' => Province::all(),
'bentukTanah' => BentukTanah::all(),
'konturTanah' => KonturTanah::all(),
'posisiKavling' => PosisiKavling::all(),
'ketinggianTanah' => KetinggianTanah::all(),
'kondisiFisikTanah' => KondisiFisikTanah::all(),
'jenisBangunan' => JenisBangunan::all(),
'kondisiBangunan' => KondisiBangunan::all(),
'sifatBangunan' => SifatBangunan::all(),
'spekKategoriBangunan' => SpekKategoritBangunan::all(),
'spekBangunan' => SpekBangunan::all(),
'saranaPelengkap' => SaranaPelengkap::all(),
'arahMataAngin' => ArahMataAngin::all()
];
}
public function submitSurveyor(Request $request, $id)
{
$permohonan = Permohonan::find($id);
$permohonan->update([
'status' => 'done',
]);
return redirect()
->route('surveyor.index')
->with('success', 'form surveyor submitted successfully');
}
}

View File

@@ -0,0 +1,133 @@
<?php
namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class FormSurveyorRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
$commonRules = $this->getCommonRules();
$actionSpecificRules = $this->getActionSpecificRules();
return array_merge($commonRules, $actionSpecificRules);
}
/**
* Get common rules that apply to all actions.
*/
private function getCommonRules(): array
{
return [
'jenis_jaminan_id' => 'required',
'type' => 'required',
'permohonan_id' => 'required',
'luas' => 'required',
'jarak_jalan_utama' => 'required',
'alamat' => 'required',
'jarak_cbd_point' => 'required',
'lebar_perkerasan_jalan' => 'required',
'perkerasan_jalan' => 'required',
'lalu_lintas' => 'required',
'gol_mas_sekitar' => 'required',
'tingkat_keramaian' => 'required',
'terletak_diarea' => 'required',
'disekitar_lokasi' => 'required',
'dekat_makam' => 'required',
'dekat_tps' => 'required',
'merupakan_daerah' => 'required',
'fasilitas_dekat_object' => 'required',
'fakta_positif' => 'required',
'fakta_negatif' => 'required',
'rute_menuju' => 'required',
'batas_batas' => 'required',
'kondisi_linkungan' => 'required',
'kondisi_lain_bangunan' => 'required',
'informasi_dokument' => 'required',
'peruntukan' => 'required',
'kdb' => 'required',
'kdh' => 'required',
'gsb' => 'required',
'max_lantai' => 'required',
'klb' => 'required',
'gss' => 'required',
'pelebaran_jalan' => 'required',
'nama_petugas' => 'required',
'lat' => 'required|numeric',
'lng' => 'required|numeric',
'foto_tempat' => 'required',
'keterangan' => 'required',
];
}
/**
* Get rules specific to the action.
*/
private function getActionSpecificRules(): array
{
$action = $this->input('action');
switch ($action) {
case 'tanah_bangunan':
return $this->getTanahBangunanRules();
case 'unit':
return $this->getUnitRules();
default:
return [];
}
}
/**
* Get rules specific to tanah_bangunan action.
*/
private function getTanahBangunanRules(): array
{
return [
'action' => 'required',
'bentuk_tanah' => 'required',
'kontur_tanah' => 'required',
'posisi_kavling' => 'required',
'ketinggian_jalan' => 'required',
'kondisi_fisik_tanah' => 'required',
'kontur_jalan' => 'required',
'kondisi_bangunan' => 'required',
'sifat_bangunan' => 'required',
'sarana_pelengkap' => 'required',
'luas_tanah_bagunan' => 'required',
'tusuk_sate' => 'required',
'name.*' => 'required|string',
'kategori.*' => 'required|string',
'lockland' => 'required',
'jenis_bangunan' => 'required',
'kondisi_bangunan' => 'required',
];
}
/**
* Get rules specific to unit action.
*/
private function getUnitRules(): array
{
return [
'action' => 'required',
'jenis_unit' => 'required',
'kondisi_unit' => 'required',
'posisi_unit' => 'required',
'lantai' => 'required',
'view' => 'required',
'bentuk_unit' => 'required',
];
}
}

View File

@@ -22,6 +22,7 @@ class SurveyorRequest extends FormRequest
'ketinggian-tanah' => 'ketinggian_tanah',
'kondisi-fisik-tanah' => 'kondisi_fisik_tanah',
'kondisi-bangunan' => 'kondisi_bangunan',
'jenis-bangunan' => 'jenis_bangunan',
'sifat-bangunan' => 'sifat_bangunan',
'sarana-pelengkap' => 'sarana_pelengkap',
'lalu_lintas_lokasi' => 'lalu_lintas_lokasi',

46
app/Models/Analisa.php Normal file
View File

@@ -0,0 +1,46 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\AnalisaFactory;
class Analisa extends Model
{
use HasFactory;
protected $table = 'analisa';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['permohonan_id', 'type', 'luas', 'jenis_jaminan_id'];
public function analisaTanahBangunan(){
return $this->hasOne(AnalisaTanahBagunan::class, 'analisa_id');
}
public function analisaLingkungan(){
return $this->hasOne(AnalisaLingkungan::class, 'analisa_id');
}
public function analisaFakta(){
return $this->hasOne(AnalisaFakta::class, 'analisa_id');
}
public function jenisJaminan(){
return $this->belongsTo(JenisJaminan::class, 'jenis_jaminan_id');
}
public function analisaUnit(){
return $this->hasOne(AnalisaUnit::class, 'analisa_id');
}
protected static function newFactory(): AnalisaFactory
{
//return AnalisaFactory::new();
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\AnalisaFaktaFactory;
class AnalisaFakta extends Model
{
use HasFactory;
protected $table = 'analisa_fakta';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['analisa_id', 'fakta_positif', 'fakta_negatif','rute_menju','batas_batas','kondisi_linkungan','kondisi_lain_bangunan','informasi_dokument','peruntukan','kdb','kdh','gsb','max_lantai','klb','gss','pelebaran_jalan','nama_petugas','foto_tempat','lat','lng', 'keterangan'];
protected static function newFactory(): AnalisaFaktaFactory
{
//return AnalisaFaktaFactory::new();
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\AnalisaLingkunganFactory;
class AnalisaLingkungan extends Model
{
use HasFactory;
protected $table = 'analisa_lingkungan';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['analisa_id', 'jarak_jalan_utama', 'alamat', 'jarak_cbd_point','lebar_perkerasan_jalan','perkerasan_jalan','lalu_lintas','gol_mas_sekitar','tingkat_keramaian','terletak_diarea','disekitar_lokasi','dekat_makam','dekat_tps','merupakan_daerah','fasilitas_dekat_object'];
protected static function newFactory(): AnalisaLingkunganFactory
{
//return AnalisaLingkunganFactory::new();
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\AnalisaTanahBagunanFactory;
class AnalisaTanahBagunan extends Model
{
use HasFactory;
protected $table = 'analisa_tanah_bangunan';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['bentuk_tanah', 'kontur_tanah', 'posisi_kavling', 'ketinggian_jalan','kontur_jalan', 'kondisi_fisik_tanah','jenis_bangunan', 'kondisi_bangunan', 'sifat_bangunan', 'sarana_pelengkap', 'analisa_id', 'tusuk_sate','lockland'];
public function analisa()
{
return $this->belongsTo(Analisa::class);
}
public function spekBangunanAnalisa()
{
return $this->hasMany(SpekBangunanAnalisa::class, 'analisa_tanah_bangunan_id');
}
public function spekBagunanAnalisaDetail()
{
return $this->hasMany(SpekBagunanAnalisaDetail::class, 'analisa_tanah_bangunan_id');
}
protected static function newFactory(): AnalisaTanahBagunanFactory
{
//return AnalisaTanahBagunanFactory::new();
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\AnalisaUnitFactory;
class AnalisaUnit extends Model
{
use HasFactory;
protected $table = 'analisa_unit';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['jenis_unit', 'analisa_id', 'kondisi_unit','posisi_unit', 'lantai', 'view', 'bentuk_unit'];
protected static function newFactory(): AnalisaUnitFactory
{
//return AnalisaUnitFactory::new();
}
}

27
app/Models/Denah.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\DenahFactory;
class Denah extends Model
{
use HasFactory;
protected $table = 'denah';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['permohonan_id', 'foto_denah', 'luas', 'jenis_jaminan_id'];
public function jenisJaminan(){
return $this->belongsTo(JenisJaminan::class, 'jenis_jaminan_id');
}
protected static function newFactory(): DenahFactory
{
//return DenahFactory::new();
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\FotoJaminanFactory;
class FotoJaminan extends Model
{
use HasFactory;
protected $table = 'foto_jaminan';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['permohonan_id', 'pendamping', 'jenis_jaminan_id'];
public function objekJaminan(){
return $this->hasMany(ObjekJaminan::class, 'foto_jaminan_id');
}
public function ruteJaminan(){
return $this->hasMany(RuteJaminan::class, 'foto_jaminan_id');
}
public function lingkungan(){
return $this->hasMany(Lingkungan::class, 'foto_jaminan_id');
}
public function lantaiUnit(){
return $this->hasMany(lantaiUnit::class, 'objek_jaminan_id', 'id');
}
}

24
app/Models/LantaiUnit.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\LantaiUnitFactory;
class LantaiUnit extends Model
{
use HasFactory;
protected $table = 'lantai_unit';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['name_lantai_unit','foto_lantai_unit', 'objek_jaminan_id'];
protected static function newFactory(): LantaiUnitFactory
{
//return LantaiUnitFactory::new();
}
}

23
app/Models/Lingkungan.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\LingkunganFactory;
class Lingkungan extends Model
{
use HasFactory;
protected $table = 'lingkungan';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['name_lingkungan', 'foto_jaminan_id', 'foto_lingkungan'];
protected static function newFactory(): LingkunganFactory
{
//return LingkunganFactory::new();
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\ObjekJaminanFactory;
class ObjekJaminan extends Model
{
use HasFactory;
protected $table = 'objek_jaminan';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['name_objek', 'foto_jaminan_id', 'foto_objek'];
public function lantaiUnit(){
return $this->hasMany(LantaiUnit::class, 'objek_jaminan_id', 'foto_jaminan_id');
}
protected static function newFactory(): ObjekJaminanFactory
{
//return ObjekJaminanFactory::new();
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\RuteJaminanFactory;
class RuteJaminan extends Model
{
use HasFactory;
protected $table = 'rute_jaminan';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['name_rute', 'foto_jaminan_id', 'foto_rute'];
protected static function newFactory(): RuteJaminanFactory
{
//return RuteJaminanFactory::new();
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\SpekBagunanAnalisaFactory;
class SpekBagunanAnalisa extends Model
{
use HasFactory;
protected $table = 'spek_bagunan_analisa';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['kategori', 'analisa_tanah_bagunan_id'];
protected static function newFactory(): SpekBagunanAnalisaFactory
{
//return SpekBagunanAnalisaFactory::new();
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\SpekBagunanAnalisaDetailFactory;
class SpekBagunanAnalisaDetail extends Model
{
use HasFactory;
protected $table = 'spek_bagunan_analisa_detail';
/**
* The attributes that are mass assignable.
*/
protected $fillable = ['name', 'spek_bagunan_analisa_id', 'kategori'];
protected static function newFactory(): SpekBagunanAnalisaDetailFactory
{
//return SpekBagunanAnalisaDetailFactory::new();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('analisa', function (Blueprint $table) {
$table->id();
$table->enum('type', ['unit', 'tanah_bangunan']);
$table->unsignedBigInteger('permohonan_id');
$table->foreign('permohonan_id')->references('id')->on('permohonan');
$table->string('luas');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('analisa');
}
};

View File

@@ -0,0 +1,51 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('analisa_tanah_bangunan', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('analisa_id');
$table->foreign('analisa_id')->references('id')->on('analisa');
$table->string('bentuk_tanah');
$table->string('kontur_tanah');
$table->string('ketinggian_jalan');
$table->string('kontur_jalan');
$table->string('posis_kavling');
$table->enum('tusuk_sate', ['yes', 'no']);
$table->enum('lockland', ['yes', 'no']);
$table->string('kondisi_fisik_tanah');
$table->string('jenis_bangunan');
$table->string('kondisi_bangunan');
$table->string('sifat_bangunan');
$table->string('sarana_pelengkap');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('analisa_tanah_bangunan');
}
};

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('analisa_unit', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('analisa_id');
$table->foreign('analisa_id')->references('id')->on('analisa');
$table->string('jenis_unit');
$table->string('kondisi_unit');
$table->string('posisi_unit');
$table->string('lantai');
$table->string('view');
$table->string('bentuk_unit');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('analisa_unit');
}
};

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('spek_bagunan_analisa', function (Blueprint $table) {
$table->id();
$table->string('name');
// Foreign key to analisa_tanah_bangunan
$table->unsignedBigInteger('analisa_tanah_bangunan_id');
$table->foreign('analisa_tanah_bangunan_id')->references('id')->on('analisa_tanah_bangunan');
$table->char('authorized_status', 1);
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps();
$table->unsignedBigInteger('created_by');
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('spek_bagunan_analisa');
}
};

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('spek_bagunan_analisa_detail', function (Blueprint $table) {
$table->id();
$table->string('kategori');
$table->string('name');
// Foreign key to spek_bangunan_analisa
$table->unsignedBigInteger('spek_bangunan_analisa_id');
$table->foreign('spek_bangunan_analisa_id')->references('id')->on('spek_bagunan_analisa');
$table->char('authorized_status', 1);
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps();
$table->unsignedBigInteger('created_by');
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('spek_bagunan_analisa_detail');
}
};

View File

@@ -0,0 +1,60 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('analisa_fakta', function (Blueprint $table) {
$table->id();
// Foreign key to analisa table
$table->unsignedBigInteger('analisa_id');
$table->foreign('analisa_id')->references('id')->on('analisa');
$table->text('fakta_positif');
$table->text('fakta_negatif');
$table->text('rute_menju');
$table->string('batas_batas');
$table->text('kondisi_linkungan');
$table->text('kondisi_lain_bangunan');
$table->text('informasi_dokument');
$table->string('peruntukan');
$table->string('kdb');
$table->string('kdh');
$table->string('gsb');
$table->string('max_lantai');
$table->string('klb');
$table->string('gss');
$table->string('pelebaran_jalan');
$table->string('nama_petugas');
$table->string('foto_tempat');
$table->string('lat');
$table->string('lng');
$table->text('keterangan');
$table->char('authorized_status', 1);
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps(); // created_at and updated_at
$table->unsignedBigInteger('created_by');
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('analisa_fakta');
}
};

View File

@@ -0,0 +1,53 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('analisa_lingkungan', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('analisa_id');
$table->foreign('analisa_id')->references('id')->on('analisa');
$table->string('jarak_jalan_utama');
$table->string('alamat');
$table->string('jarak_cbd_point');
$table->string('lebar_perkerasan_jalan');
$table->string('perkerasan_jalan');
$table->string('lalu_lintas');
$table->string('gol_mas_sekitar');
$table->string('tingkat_keramaian');
$table->string('terletak_diarea');
$table->string('disekitar_lokasi');
$table->string('dekat_makam');
$table->enum('dekat_tps', ['yes', 'no']);
$table->string('merupakan_daerah');
$table->string('fasilitas_dekat_object');
$table->char('authorized_status', 1);
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps(); // created_at and updated_at
$table->unsignedBigInteger('created_by');
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('analisa_lingkungan');
}
};

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('denah', function (Blueprint $table) {
$table->id();
// Foreign key to permohonan table
$table->unsignedBigInteger('permohonan_id');
$table->foreign('permohonan_id')->references('id')->on('permohonan');
$table->string('foto_denah');
$table->string('luas');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps(); // created_at and updated_at
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('denah');
}
};

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('foto_jaminan', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('permohonan_id');
$table->foreign('permohonan_id')->references('id')->on('permohonan');
$table->string('pendamping');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps(); // created_at and updated_at
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('foto_jaminan');
}
};

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('objek_jaminan', function (Blueprint $table) {
$table->id();
// Foreign key to foto_jaminan table
$table->unsignedBigInteger('foto_jaminan_id');
$table->foreign('foto_jaminan_id')->references('id')->on('foto_jaminan');
$table->string('name');
$table->string('foto_objek');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps(); // created_at and updated_at
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('objek_jaminan');
}
};

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('lingkungan', function (Blueprint $table) {
$table->id();
// Foreign key to foto_jaminan table
$table->unsignedBigInteger('foto_jaminan_id');
$table->foreign('foto_jaminan_id')->references('id')->on('foto_jaminan');
$table->string('name_lingkungan');
$table->string('foto_linkungan');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('lingkungan');
}
};

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('rute_jaminan', function (Blueprint $table) {
$table->id();
// Foreign key to foto_jaminan table
$table->unsignedBigInteger('foto_jaminan_id');
$table->foreign('foto_jaminan_id')->references('id')->on('foto_jaminan');
$table->string('name');
$table->string('foto_rute');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps(); // created_at and updated_at
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('rute_jaminan');
}
};

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('lantai_unit', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('objek_jaminan_id');
$table->string('name_lantai_unit');
$table->string('foto_lantai_unit');
$table->char('authorized_status', 1)->nullable();
$table->timestamp('authorized_at')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable();
$table->timestamps();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('lantai_unit');
}
};

View File

@@ -10,16 +10,18 @@
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
<label class="form-label flex items-center gap-3 text-nowrap">
<input type="radio" class="radio" name="luasTanah" value="sesuai">
<input type="radio" class="radio" name="luas" value="sesuai"
{{ old('luas', isset($analisa) && optional($analisa)->luas) == 'sesuai' ? 'checked' : '' }}>
<span class="ml-2">Sesuai</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="luasTanah" value="tidakSesuai">
<input type="radio" class="radio" name="luas" value="tidak sesuai"
{{ old('luas', isset($analisa) && optional($analisa)->luas) == 'tidak sesuai' ? 'checked' : '' }}>
<span class="ml-2">Tidak Sesuai</span>
</label>
</div>
@error('bentuk_tanah')
@error('luas')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -30,37 +32,41 @@
<label class="form-label max-w-56">Jenis Unit</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('bentuk_tanah') border-danger bg-danger-light @enderror"
name="bentuk_tanah">
class="input tomselect w-full @error('jenis_unit') border-danger bg-danger-light @enderror"
name="jenis_unit">
<option value="">Select Jenis Unit</option>
@if (isset($bentukTanah))
@foreach ($bentukTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@if (isset($jenisBangunan))
@foreach ($jenisBangunan as $item)
<option value="{{ $item->name }}"
{{ old('jenis_unit', isset($analisa) && optional($analisa->analisaUnit)->jenis_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('bentuk_tanah')
@error('jenis_unit')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kondidi Unit</label>
<label class="form-label max-w-56">Kondisi Unit</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('konturTanah') border-danger bg-danger-light @enderror"
name="konturTanah">
<option value="">Select Kondidi Unit</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
class="input tomselect w-full @error('kondisi_unit') border-danger bg-danger-light @enderror"
name="kondisi_unit">
<option value="">Select Kondisi Unit</option>
@if (isset($kondisiBangunan))
@foreach ($kondisiBangunan as $item)
<option value="{{ $item->name }}"
{{ old('kondisi_unit', isset($analisa) && optional($analisa->analisaUnit)->kondisi_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('konturTanah')
@error('kondisi_unit')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -72,17 +78,17 @@
<label class="form-label max-w-56">Posisi Unit</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('ketinggianTanah') border-danger bg-danger-light @enderror"
name="ketinggianTanah">
class="input tomselect w-full @error('posisi_unit') border-danger bg-danger-light @enderror"
name="posisi_unit">
<option value="">Select Posisi Unit</option>
@if (isset($ketinggianTanah))
@foreach ($ketinggianTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
<option value="{{ $item->name }}" {{ old('posisi_unit', isset($analisa) && optional($analisa->analisaUnit)->posisi_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('ketinggianTanah')
@error('posisi_unit')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -95,17 +101,17 @@
<label class="form-label max-w-56">Lantai</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('posisiKavling') border-danger bg-danger-light @enderror"
name="posisiKavling">
class="input tomselect w-full @error('lantai') border-danger bg-danger-light @enderror"
name="lantai">
<option value="">Select Lantai</option>
@if (isset($posisiKavling))
@foreach ($posisiKavling as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
<option value="{{ $item->name }}" {{ old('lantai', isset($analisa) && optional($analisa->analisaUnit)->lantai) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('posisiKavling')
@error('lantai')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -117,17 +123,17 @@
<label class="form-label max-w-56">View</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('kondisiFisikTanah') border-danger bg-danger-light @enderror"
name="kondisiFisikTanah">
class="input tomselect w-full @error('view') border-danger bg-danger-light @enderror"
name="view">
<option value="">Select View</option>
@if (isset($kondisiFisikTanah))
@foreach ($kondisiFisikTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
<option value="{{ $item->name }}" {{ old('view', isset($analisa) && optional($analisa->analisaUnit)->view) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('kondisiFisikTanah')
@error('view')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -137,17 +143,17 @@
<label class="form-label max-w-56">Bentuk Unit</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('kondisiFisikTanah') border-danger bg-danger-light @enderror"
name="kondisiFisikTanah">
class="input tomselect w-full @error('bentuk_unit') border-danger bg-danger-light @enderror"
name="bentuk_unit">
<option value="">Select Bentuk Unit</option>
@if (isset($kondisiFisikTanah))
@foreach ($kondisiFisikTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
<option value="{{ $item->name }}" {{ old('bentuk_unit', isset($analisa) && optional($analisa->analisaUnit)->bentuk_unit) == $item->name ? 'selected' : '' }}>{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('kondisiFisikTanah')
@error('bentuk_unit')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>

View File

@@ -0,0 +1,164 @@
<div class="grid grid-cols-1 lg:grid-cols-2 gap-5 lg:gap-7.5">
@foreach ($permohonan->debiture->documents as $dokumen)
@php
$jenisAnalisa = null;
$perbandingan = null;
if (request()->has('form') && request('form') === 'denah' && isset($denah)) {
$denahIds = [];
$permohonaDenahId = [];
foreach ($denah as $item) {
$denahIds[] = $item->jenis_jaminan_id;
$permohonaDenahId[] = $item->permohonan_id;
}
$perbandingan =
in_array($dokumen->jenisJaminan->id, $denahIds) && in_array($permohonan->id, $permohonaDenahId);
} elseif (request()->has('form') && request('form') === 'foto' && isset($fotojaminan)) {
$fotoIds = [];
$permohonanFotoId = [];
foreach ($fotojaminan as $item) {
$fotoIds[] = $item->jenis_jaminan_id;
$permohonanFotoId[] = $item->permohonan_id;
}
$perbandingan =
in_array($permohonan->id, $permohonanFotoId) && in_array($dokumen->jenisJaminan->id, $fotoIds);
} elseif (request()->has('form') && request('form') === 'inspeksi' && isset($analisa)) {
$jenisIds = [];
foreach ($analisa as $item) {
$jenisIds[] = $item->jenis_jaminan_id;
}
$perbandingan = isset($analisa) && in_array($dokumen->jenisJaminan->id, $jenisIds);
}
@endphp
@if ($perbandingan)
<div class="card flex flex-col gap-5 p-5 lg:p-7.5">
<div class="flex items-center flex-wrap justify-between gap-1">
<div class="flex items-center gap-2.5">
<div class="relative size-[44px] shrink-0">
<svg class="w-full h-full stroke-primary-clarity fill-primary-light" fill="none"
height="48" viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg">
<path
d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506 18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937 39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z"
fill=""></path>
<path
d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506 18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937 39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z"
stroke=""></path>
</svg>
<div class="absolute leading-none left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
<i class="ki-filled ki-add-files text-1.5xl text-primary"></i>
</div>
</div>
</div>
<div class="menu inline-flex" data-menu="true">
<div class="flex flex-nowrap justify-center gap-1.5">
@php
$formTypes = [
'denah' => [
'model' => $denah,
'route' => 'surveyor.denah',
'update' => 'update-denah',
],
'foto' => [
'model' => $fotojaminan,
'route' => 'surveyor.foto',
'update' => 'update-foto',
],
'inspeksi' => [
'model' => $analisa,
'route' => 'surveyor.inspeksi',
'update' => 'update-inspeksi',
],
];
$currentForm = request('form');
$formConfig = $formTypes[$currentForm] ?? null;
@endphp
@if ($formConfig && isset($formConfig['model']))
<a href="{{ route($formConfig['route'], ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form={{ $formConfig['update'] }}&{{ $currentForm }}={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}"
class="btn btn-sm btn-icon btn-outline btn-info">
<i class="ki-outline ki-notepad-edit"></i>
</a>
@endif
{{-- <a class="delete btn btn-sm btn-icon btn-outline btn-danger">
<i class="ki-outline ki-trash"></i>
</a> --}}
</div>
</div>
</div>
<div class="grid">
{{-- Display your analisa data here --}}
<div class="flex items-center justify-between flex-wrap mb-3.5 gap-2"><span
class="text-2xs text-gray-600uppercase">Tipe Analisa</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
{{-- {{ $analisa->type }} --}}
</p>
</div>
{{-- Add more fields as needed --}}
{{-- @endif
@if ($analisa->analisaLingkungan) --}}
<div class="border-t border-gray-300 border-dashed"></div>
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase">Analisa Lingkungan</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]">
{{-- Display relevant analisaLingkungan data --}}
</p>
</div>
{{-- @endif --}}
{{-- @if ($analisa->analisaFakta) --}}
<div class="border-t border-gray-300 border-dashed"></div>
<div class="flex items-start justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase">Analisa Fakta</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px]">{{-- Display relevant analisaFakta data --}}
</p>
</div>
{{-- @endif --}}
</div>
</div>
@else
@if (request()->has('form') && request('form') === 'denah')
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg"
href="{{ route('surveyor.denah', ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form=create-denah&denah={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}">
@elseif(request()->has('form') && request('form') === 'foto')
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg"
href="{{ route('surveyor.foto', ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form=create-foto&foto={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}">
@elseif(request()->has('form') && request('form') === 'inspeksi')
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg"
href="{{ route('surveyor.inspeksi', ['id' => $permohonan->id, 'jaminanId' => $dokumen->jenisJaminan->id]) }}?form=create-inspeksi&inspeksi={{ $permohonan->id }}&jenis_jaminan={{ $dokumen->jenisJaminan->id }}">
@endif
<div class="card-body grid items-center">
<div class="flex flex-col gap-3">
<div class="flex justify-center pt-5">
<div class="relative size-[60px] shrink-0">
<svg class="w-full h-full stroke-brand-clarity fill-light" fill="none" height="48"
viewBox="0 0 44 48" width="44" xmlns="http://www.w3.org/2000/svg">
<path
d="M16 2.4641C19.7128 0.320509 24.2872 0.320508 28 2.4641L37.6506 8.0359C41.3634 10.1795 43.6506 14.141 43.6506 18.4282V29.5718C43.6506 33.859 41.3634 37.8205 37.6506 39.9641L28 45.5359C24.2872 47.6795 19.7128 47.6795 16 45.5359L6.34937 39.9641C2.63655 37.8205 0.349365 33.859 0.349365 29.5718V18.4282C0.349365 14.141 2.63655 10.1795 6.34937 8.0359L16 2.4641Z"
fill=""></path>
<path
d="M16.25 2.89711C19.8081 0.842838 24.1919 0.842837 27.75 2.89711L37.4006 8.46891C40.9587 10.5232 43.1506 14.3196 43.1506 18.4282V29.5718C43.1506 33.6804 40.9587 37.4768 37.4006 39.5311L27.75 45.1029C24.1919 47.1572 19.8081 47.1572 16.25 45.1029L6.59937 39.5311C3.04125 37.4768 0.849365 33.6803 0.849365 29.5718V18.4282C0.849365 14.3196 3.04125 10.5232 6.59937 8.46891L16.25 2.89711Z"
stroke=""></path>
</svg>
<div class="absolute leading-none left-2/4 top-2/4 -translate-y-2/4 -translate-x-2/4">
<i class="ki-filled ki-additem text-2xl text-brand"></i>
</div>
</div>
</div>
<div class="flex flex-col text-center">
<span class="text-lg font-semibold text-gray-900 hover:text-primary-active mb-px">
Tambah {{ request('form') }}
</span>
<span class="text-2sm font-normal text-gray-600">
Inspeksi {{ $dokumen->jenisJaminan->name ?? '' }}
</span>
</div>
</div>
</div>
</a>
@endif
@endforeach
</div>

View File

@@ -1,117 +1,30 @@
<form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST" class="grid gap-5">
@if(isset($debitur->id))
<input type="hidden" name="id" value="{{ $debitur->id }}">
@method('PUT')
@endif
@csrf
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Address
</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="flex flex-col lg:flex-row gap-2 w-full">
<div class="flex flex-wrap items-baseline w-full">
<select id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
<option value="">Select Province</option>
@foreach($provinces as $province)
@if(isset($debitur))
<option value="{{ $province->code }}" {{ isset($debitur->province_code) && $debitur->province_code == $province->code?'selected' : '' }}>
{{ $province->name }}
</option>
@else
<option value="{{ $province->code }}">
{{ $province->name }}
</option>
@endif
@endforeach
</select>
@error('province_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<div class="flex flex-wrap items-baseline w-full">
<select id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
<option value="">Select City</option>
@if(isset($cities))
@foreach($cities as $city)
@if(isset($debitur))
<option value="{{ $city->code }}" {{ isset($debitur->city_code) && $debitur->city_code == $city->code?'selected' : '' }}>
{{ $city->name }}
</option>
@else
<option value="{{ $city->code }}">
{{ $city->name }}
</option>
@endif
@endforeach
<div class="grid">
<div class="card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="data-table" data-api-url="">
<div class="card-header py-5 flex-wrap">
@endif
</select>
@error('city_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex flex-col lg:flex-row gap-2 w-full mt-2 lg:mt-5">
<div class="flex flex-wrap items-baseline w-full">
<select id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
<option value="">Select District</option>
@if(isset($districts))
@foreach($districts as $district)
@if(isset($debitur))
<option value="{{ $district->code }}" {{ isset($debitur->district_code) && $debitur->district_code == $district->code?'selected' : '' }}>
{{ $district->name }}
</option>
@else
<option value="{{ $district->code }}">
{{ $district->name }}
</option>
@endif
@endforeach
<div class="card-body">
<div class="scrollable-x-auto">
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm" data-datatable-table="true">
<thead>
<tr>
@endif
</select>
@error('district_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
<th class="min-w-[250px]" data-datatable-column="code">
<span class="sort"> <span class="sort-label"> Nama </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Data Pembanding </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Data Pembading 2</th>
</tr>
</thead>
</table>
</div>
<div class="flex flex-wrap items-baseline w-full">
<select id="village_code" name="village_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
<option value="">Select Village</option>
@if(isset($villages))
@foreach($villages as $village)
@if(isset($debitur))
<option value="{{ $village->code }}" {{ isset($debitur->village_code) && $debitur->village_code == $village->code?'selected' : '' }}>
{{ $village->name }}
</option>
@else
<option value="{{ $village->code }}">
{{ $village->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('district_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('postal_code') border-danger bg-danger-light @enderror" type="number" id="postal_code" name="postal_code" value="{{ $debitur->postal_code ?? '' }}" placeholder="Postal Code">
@error('postal_code')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex flex-row w-full mt-2 lg:mt-5">
<textarea class="textarea @error('address') border-danger bg-danger-light @enderror" rows="3" type="number" id="address" name="address">{{ $debitur->address ?? '' }}</textarea>
@error('address')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</form>

View File

@@ -1,10 +1,155 @@
<form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST" class="grid gap-5">
@extends('layouts.main')
{{-- @section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection --}}
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card min-w-full">
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('surveyor.show', ['id' => request('denah')]) }}?form=denah"
class="btn btn-xs btn-info">
<i class="ki-filled ki-exit-left"></i> Back
</a>
</div>
</div>
<div data-accordion="true">
@foreach ($permohonan->debiture->documents as $dokumen)
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200"
data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</span>
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
</i>
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
</i>
</button>
<div class="accordion-content hidden" id="accordion_1_content_1">
<div class="card-body lg:py-7.5 grid grid-cols-2">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Jenis Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->jenisJaminan->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Hubungan Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->hubungan_pemilik->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Alamat Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->address ?? '' }},
<br> {{ $dokumen->pemilik->village->name ?? '' }},
{{ $dokumen->pemilik->district->name ?? '' }},
{{ $dokumen->pemilik->city->name ?? '' }},
{{ $dokumen->pemilik->province->name ?? '' }} -
{{ $dokumen->pemilik->village->postal_code ?? '' }}
</span>
</div>
</div>
<div class="card-table scrollable-x-auto pb-3">
<table class="table align-middle text-sm text-gray-500">
@foreach ($dokumen->detail as $detail)
<tr>
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $detail->name ?? '' }}
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@if (isset($detail->dokumen_jaminan))
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id]) }}"
class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
<i class="ki-filled ki-cloud-download"></i></a>
@endif
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Keterangan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $detail->keterangan ?? '' }}
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<form
action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('surveyor.storeDenah') }}"
method="POST" class="grid gap-5" enctype="multipart/form-data">
@if (isset($debitur->id))
<input type="hidden" name="id" value="{{ $debitur->id }}">
@method('PUT')
@endif
@csrf
<input type="hidden" value="{{ $permohonan->id }}" name="permohonan_id">
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
<div class="mt-2">
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div>
</div>
<div class="flex flex-wrap gap-4" style="margin-top: 20px">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Upload Denah</span>
</label>
<input type="file"
value="{{ old('foto_denah', isset($denah->foto_denah) ? $denah->foto_denah : '') }}"
name="foto_denah" class="file-input file-input-bordered w-full " accept="image/*">
</div>
</div>
@error('foto_denah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="mt-2">
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
@@ -12,14 +157,28 @@
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Upload Denah</span>
<span class="form-label">Masukkan total luas tanah</span>
</label>
<input type="file" name="ruteMenujuLokasi" class="file-input file-input-bordered w-full ">
<input type="text" name="luas" class="input w-full "
value="{{ old('luas', isset($denah->luas) ? $denah->luas : '') }}">
</div>
</div>
@error('luas')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
<button type="submit" class="btn btn-success">
Save
</button>
</div>
</form>
</div>
</div>
</div>
@endsection

View File

@@ -1,600 +0,0 @@
@push('scripts')
{{-- <script src="https://cdn.tailwindcss.com"></script> --}}
@endpush
<form id="debiturForm" action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST"
class="grid gap-5">
@if (isset($debitur->id))
<input type="hidden" name="id" value="{{ $debitur->id }}">
@method('PUT')
@endif
@csrf
@if (false)
@include('lpj::surveyor.components.apartemen-kantor')
@else
@include('lpj::surveyor.components.tanah-bangunan')
@endif
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-green-600 text-white py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1>
</div>
<div class="grid gap-5">
<!-- Jarak dari Objek Utama -->
<div class="bg-gray-50 rounded-lg">
<div class="grid grid-cols-3 gap-5">
<div>
<label class="block text-sm font-medium text-gray-700">Jarak Dari Jalan Utama</label>
<input type="text" class="input mt-2" name="jarakDariJalan" placeholder="Km">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Jarak ke CBD Point</label>
<input type="text" class="input mt-2" name="jarakkeCbdPoint" placeholder="Km">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Lebar Perkerasan Jalan Depan
objek</label>
<input type="text" name="lebarPerkerasanJalan" class="input mt-2" placeholder="Meter">
</div>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Perkerasan Jalan</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('perkerasanJalan') border-danger bg-danger-light @enderror"
name="perkerasanJalan">
<option value="">Select Perkerasan Jalan</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('perkerasanJalan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Lalulintas -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Lalulintas Depan Lokasi</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('laluLintasDepanLoaksi') border-danger bg-danger-light @enderror"
name="laluLintasDepanLoaksi">
<option value="">Select PLalulintas Depan Lokasi</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('laluLintasDepanLoaksi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Golongan Hidup Sekitar -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Golongan Hidup Sekitar</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('golHidupSekitar') border-danger bg-danger-light @enderror"
name="golHidupSekitar">
<option value="">Select Golongan Hidup Sekitar</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('golHidupSekitar')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Tingkat Keramaian -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tingkat Keramaian</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('tingkatKeramaian') border-danger bg-danger-light @enderror"
name="tingkatKeramaian">
<option value="">Select Tingkat Keramaian</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('tingkatKeramaian')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Tataletak di Area -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tataletak di Area</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('tataLetakArea') border-danger bg-danger-light @enderror"
name="tataLetakArea">
<option value="">Select Tataletak di Area</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('tataLetakArea')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Struktru tata letak -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Struktru tata letak</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 gap-4">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="checkbox" class="checkbox" name="telahAdaBagunan" value="komersial">
<span class="ml-2">Telah Ada Bangunan</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="checkbox" class="checkbox" name="telahAdaBagunan" value="komersial">
<span class="ml-2">Belum Ada Bangunan</span>
</label>
</div>
@error('telahAdaBagunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Dekat Makam -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Dekat Makamh</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 gap-4 mt-2">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="dekatMakam" value="ya">
<span class="ml-2">Ya</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="dekatMakam" value="tidak">
<span class="ml-2">Tidak</span>
</label>
</div>
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Dekat Tps</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 gap-4 mt-2">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="dekatTps" value="ya">
<span class="ml-2">Ya</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="dekatTps" value="tidak">
<span class="ml-2">Tidak</span>
</label>
</div>
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Merupakan daerah</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('merupakanDaerah') border-danger bg-danger-light @enderror"
name="merupakanDaerah">
<option value="">Select Merupakan daerah</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('merupakanDaerah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Fasilitas Umum Sekitar -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Fasilitas Umum dekat Object</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('fasilitasUmumDekat') border-danger bg-danger-light @enderror"
name="fasilitasUmumDekat">
<option value="">Select Fasilitas Umum Ddekat Object</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('fasilitasUmumDekat')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-blue-600 text-white py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1>
</div>
<div class="grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Faktor Positif</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="faktorPositif" rows="3"></textarea>
@error('faktorPositif')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Faktor Negatif</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="faktorNegatif" rows="3"></textarea>
@error('faktorNegatif')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Rute Menuju</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="ruteMenuju" rows="3"></textarea>
@error('ruteMenuju')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Batas batas</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 gap-4 items-center w-full">
<div>
<select class="select mt-2" name="BatasBatas">
@if (isset($arahMataAngin))
@foreach ($arahMataAngin as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
@endforeach
@endif
</select>
</div>
<div>
<input name="keteranganBatas" type="text" class="input mt-2">
</div>
</div>
@error('kondisiFisikTanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kondisi lain terkait lingkungan</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="kondisiLainTerkaitLingkungan" rows="3"></textarea>
@error('kondisiLainTerkaitLingkungan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kondisi lain terkait Bangunan</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="kondisiLainTerkaitBangunan" rows="3"></textarea>
@error('kondisiLainTerkaitBangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Informasi Terkait Dokumen</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="informasiTerkaitDokumen" rows="3"></textarea>
@error('informasiTerkaitDokumen')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div class="container mx-auto ">
<!-- Header -->
<div class="bg-blue-600 text-white py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Informasi Dinas Tata Ruang</h1>
</div>
<!-- Informasi Tata Ruang Form -->
<div class="grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Peruntukan</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="peruntukan" class="input" placeholder="Masukkan Peruntukan">
@error('peruntukan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">KDB</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="kdb" class="input" placeholder="Masukkan KDB">
@error('kdb')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">KDH</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="kdh" class="input" placeholder="Masukkan KDH">
@error('kdh')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">GSB</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="gsb" class="input" placeholder="Masukkan GSB">
@error('gsb')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Max Lantai</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="maxLantai" class="input" placeholder="Masukkan Max Lantai">
@error('maxLantai')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">KLB</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="klb" class="input" placeholder="Masukkan KLB">
@error('klb')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">GSS</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="gss" class="input" placeholder="Masukkan GSS">
@error('gss')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Pelebaran Jalan</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="pelebaranJalan" class="input"
placeholder="Masukkan Pelebaran Jalan">
@error('pelebaranJalan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Nama Petugas TK</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="petugasTK" class="input" placeholder="Masukkan Petugas TK">
@error('petugasTK')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
<!-- Peta Section -->
<div class="mt-2">
<div class="bg-info border p-6 rounded-lg shadow-lg flex items-center justify-center" style="height: 300px">
<iframe id="mapFrame" frameborder="0" style="width: 100%; height: 100%;"></iframe>
</div>
</div>
<!-- Upload Photo Button -->
<div class=" flex w-full mt-2">
<div class="input-group w-full">
<input class="file-input" name="foto" type="file" />
</div>
</div>
<!-- Notes Section -->
<div class="mt-2">
<div class="bg-white p-6 rounded-lg shadow-lg">
<h4 class="block text-sm font-medium text-gray-700 mt-2">Catatan yang Perlu Diperhatikan</h4>
<textarea name="notes" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="3"></textarea>
</div>
</div>
</div>
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
<button type="submit" class="btn btn-success">
Save
</button>
<button type="submit" class="btn btn-primary">
Submit
</button>
</div>
</form>
@push('scripts')
<script>
// Fungsi untuk mengambil lokasi pengguna
function getUserLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
alert("Geolocation tidak didukung oleh browser ini.");
}
}
// Fungsi untuk menampilkan posisi
function showPosition(position) {
var lat = position.coords.latitude;
var lng = position.coords.longitude;
var mapUrl = `https://www.google.com/maps?q=${lat},${lng}&z=15&output=embed`;
document.getElementById('mapFrame').src = mapUrl;
}
// Fungsi untuk menangani error jika lokasi tidak bisa diambil
function showError(error) {
switch(error.code) {
case error.PERMISSION_DENIED:
alert("Pengguna menolak permintaan geolokasi.");
break;
case error.POSITION_UNAVAILABLE:
alert("Informasi lokasi tidak tersedia.");
break;
case error.TIMEOUT:
alert("Permintaan lokasi pengguna berakhir.");
break;
case error.UNKNOWN_ERROR:
alert("Terjadi kesalahan yang tidak diketahui.");
break;
}
}
window.onload = getUserLocation;
</script>
<script>
// Fungsi untuk menyimpan data ke localStorage saat ada perubahan input
const formElement = document.getElementById('debiturForm');
// Mengambil nilai dari localStorage saat halaman dimuat
window.onload = () => {
const storedData = localStorage.getItem('debiturData');
if (storedData) {
const formData = JSON.parse(storedData);
// Mengisi nilai untuk elemen select
for (const [key, value] of Object.entries(formData)) {
const inputElement = formElement.querySelector(`[name="${key}"]`);
if (inputElement) {
if (inputElement.tagName === 'SELECT') {
inputElement.value = value; // Atur nilai select
} else if (inputElement.type === 'radio') {
const radioButton = document.getElementById(`${key}${value.charAt(0).toUpperCase() + value.slice(1)}`);
if (radioButton) {
radioButton.checked = true; // Atur radio button yang sesuai sebagai checked
}
}
}
}
}
};
// Simpan data ke localStorage dalam bentuk JSON
formElement.addEventListener('change', () => {
const formData = {};
const inputs = formElement.querySelectorAll('input, select');
inputs.forEach(input => {
if (input.type === 'radio' && input.checked) {
formData[input.name] = input.value; // Hanya ambil nilai radio yang terpilih
} else if (input.type !== 'radio') {
formData[input.name] = input.value; // Ambil nilai dari elemen lain
}
});
localStorage.setItem('debiturData', JSON.stringify(formData)); // Simpan objek sebagai JSON
});
// Opsi: Reset localStorage saat form disubmit
formElement.onsubmit = () => {
localStorage.removeItem('debiturData'); // Menghapus data spesifik dari localStorage
};
// Opsi: Reset localStorage saat form disubmit
document.getElementById('debiturForm').onsubmit = (event) => {
event.preventDefault(); // Mencegah pengiriman form
// Menyimpan semua input ke localStorage
inputs.forEach(input => {
localStorage.setItem(input.name, input.value);
});
// Opsional: Tampilkan pesan bahwa data telah disimpan
alert('Data telah disimpan ke localStorage!');
// Jika ingin menghapus localStorage, uncomment baris di bawah
// localStorage.clear();
};
</script>
@endpush

View File

@@ -1,89 +1,557 @@
<form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST"
class="grid gap-5">
@if (isset($debitur->id))
<input type="hidden" name="id" value="{{ $debitur->id }}">
@extends('layouts.main')
{{-- @section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection --}}
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card min-w-full">
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('surveyor.show', ['id' => request('foto')]) }}?form=foto"
class="btn btn-xs btn-info">
<i class="ki-filled ki-exit-left"></i> Back
</a>
</div>
</div>
@php
$jenisJaminanData = null;
@endphp
<div data-accordion="true">
@foreach ($permohonan->debiture->documents as $dokumen)
@php
$jenisJaminanData = $dokumen->jenisJaminan->name ?? '';
@endphp
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200"
data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</span>
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
</i>
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
</i>
</button>
<div class="accordion-content hidden" id="accordion_1_content_1">
<div class="card-body lg:py-7.5 grid grid-cols-2">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Jenis Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->jenisJaminan->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Hubungan Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->hubungan_pemilik->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Alamat Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->address ?? '' }},
<br> {{ $dokumen->pemilik->village->name ?? '' }},
{{ $dokumen->pemilik->district->name ?? '' }},
{{ $dokumen->pemilik->city->name ?? '' }},
{{ $dokumen->pemilik->province->name ?? '' }} -
{{ $dokumen->pemilik->village->postal_code ?? '' }}
</span>
</div>
</div>
<div class="card-table scrollable-x-auto pb-3">
<table class="table align-middle text-sm text-gray-500">
@foreach ($dokumen->detail as $detail)
<tr>
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $detail->name ?? '' }}
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@if (isset($detail->dokumen_jaminan))
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id]) }}"
class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
<i class="ki-filled ki-cloud-download"></i></a>
@endif
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Keterangan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $detail->keterangan ?? '' }}
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<form action="{{ route('surveyor.storeFoto') }}" method="POST" class="grid gap-5"
enctype="multipart/form-data">
@if (isset($fotoJaminan->id))
<input type="hidden" name="id" value="{{ $fotoJaminan->id }}">
@method('PUT')
@endif
@csrf
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
@php
$data = [
'tanah' => 'Tanah',
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
'tanah_bangunan' => 'Mall',
];
$analisaType = 'unknown';
if (isset($analisa->id)) {
$analisaType = $analisa->type ?? 'unknown';
} else {
foreach ($data as $key => $value) {
if (
isset($jenisJaminanData) &&
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))
) {
$analisaType = $key;
break;
}
}
}
if ($analisaType === 'tanah') {
$analisaType = 'tanah_bangunan';
}
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
$analisaType = 'unit';
}
@endphp
<input type="hidden" name="analisa_type" value="{{ $analisaType }}">
<div class="bg-white rounded-lg shadow-md">
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Rute Menuju Lokasi</h1>
<a id="btn-add" class="btn btn-primary btn-sm">
<button id="btnRute" type="button" class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</a>
</button>
</div>
<div class="flex w-ful items-center justify-center gap-4">
@if (isset($fotoJaminan))
@foreach ($fotoJaminan->ruteJaminan as $item)
<div id="inputContainerRute" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Rute Menuju Lokasi</span>
<input type="checkbox" name="ruteMenujuLokasi" class="checkbox">
</label>
<input type="file" name="ruteMenujuLokasi" class="file-input file-input-bordered w-full ">
<div class="w-full grid gap-5">
@if (isset($item->foto_rute))
<img src="{{ asset('storage/' . old('foto_rute', $item->foto_rute)) }}"
alt="Gambar Pendamping" style="width: 12rem;">
@endif
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
<input id="inputRute" type="file" name="foto_rute[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Objeck Jaminan </h1>
<a class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</a>
@error('foto_rute.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_rute.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
<div class="flex flex-wrap gap-4">
<div class="flex w-full items-center justify-center gap-4">
@endforeach
@else
<div id="inputContainerRute" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Tampak Samping kiri</span>
<input type="checkbox" name="ruteMenujuLokasi" class="checkbox">
<span class="form-label">Foto Rute Menuju Lokasi</span>
</label>
<input type="file" name="ruteMenujuLokasi" class="file-input file-input-bordered w-full ">
<input class="name_rute" type="hidden" name="name_rute[]" value="rute">
<input id="inputRute" type="file" name="foto_rute[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
<textarea name="ruteMenujuLokasi" id="" class="textarea" rows="3" rows="10"></textarea>
@error('foto_rute.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_rute.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endif
</div>
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-white rounded-lg shadow-md">
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Linkungan </h1>
<a class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</a>
<h1 class="text-md font-medium text-gray-900">Objek Jaminan</h1>
</div>
<div class="flex w-ful items-center justify-center gap-4">
@php
$objekViews = [];
if ($analisaType === 'tanah_bangunan') {
$objekViews = [
['label' => 'Tampak Samping Kiri', 'index' => 0],
['label' => 'Tampak Samping Kanan', 'index' => 1],
['label' => 'Nomor Rumah/Unit', 'index' => 2],
];
} elseif ($analisaType === 'unit') {
$objekViews = [
['label' => 'Tampak Loby', 'index' => 0],
['label' => 'Tampak Lift', 'index' => 1],
['label' => 'Tampak Samping Kiri Unit', 'index' => 2],
['label' => 'Tampak Samping Kanan Unit', 'index' => 3],
['label' => 'Tampak Depan Unit', 'index' => 4],
['label' => 'Nomor Unit', 'index' => 5],
];
}
@endphp
@if (count($objekViews) > 0)
@foreach ($objekViews as $view)
<div class="flex flex-wrap gap-4 {{ !$loop->first ? 'mt-2' : '' }}">
<div class="flex w-full gap-4">
<label class="form-label max-w-56"><span
class="form-label">{{ $view['label'] }}</span>
</label>
<div class="w-full grid gap-5">
@if (isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']]))
<img src="{{ asset('storage/' . $fotoJaminan->objekJaminan[$view['index']]->foto_objek) }}"
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
style="width: 12rem;">
@endif
<input type="file" name="foto_objek[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<textarea name="name_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($fotoJaminan) && isset($fotoJaminan->objekJaminan[$view['index']]) ? str_replace($view['label'] . ': ', '', $fotoJaminan->objekJaminan[$view['index']]->name_objek) : '' }}</textarea>
</div>
</div>
@error('foto_objek.' . $view['index'])
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_objek.' . $view['index'])
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endforeach
@else
<div class="p-4">
<p class="text-gray-500">Tipe analisa tidak valid atau belum dipilih.</p>
</div>
@endif
<div class="flex flex-wrap gap-4 w-full">
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between w-full">
<label class="form-label">
<span class="form-label">Lantai</span>
</label>
<button type="button" id="btnLantai" class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</button>
</div>
@if (isset($fotoJaminan))
@foreach ($fotoJaminan->lantaiUnit as $item)
<div id="inputContainerLantai" class="w-full">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Lantai 1</span>
</label>
<div class="w-full grid gap-5">
@if (isset($fotoJaminan))
<img src="{{ asset('storage/' . old('foto_lantai_unit', $item->foto_lantai_unit)) }}"
alt="Gambar Pendamping" style="width: 12rem;">
@endif
<input type="hidden" name="name_lantai_unit[]" value="lantai">
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('foto_lantai_unit.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endforeach
@else
<div id="inputContainerLantai" class="w-full">
<div class="flex w-full items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Foto Lantai 1</span>
</label>
<input type="hidden" name="name_lantai_unit[]" value="lantai">
<input id="inputLantai" type="file" name="foto_lantai_unit[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
@error('foto_lantai_unit.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endif
</div>
</div>
<div class=" bg-white rounded-lg shadow-md">
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Lingkungan</h1>
<button id="btnLingkungan" type="button" class="btn btn-primary btn-sm">
<i class="ki-filled ki-plus text-lg"></i>
</button>
</div>
@if (isset($fotoJaminan))
@foreach ($fotoJaminan->lingkungan as $item)
<div id="inputContainerLingkungan" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Lingkungan</span>
</label>
<div class="w-full grid gap-5">
@if (isset($fotoJaminan))
<img src="{{ asset('storage/' . old('foto_lingkungan', $item->foto_lingkungan)) }}"
alt="Gambar Pendamping" style="width: 12rem;">
@endif
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
class="file-input file-input-bordered w-full" accept="image/*"
capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('foto_lingkungan.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_lingkungan.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endforeach
@else
<div id="inputContainerLingkungan" style="margin-top: 10px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Lingkungan</span>
</label>
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
<input id="inputLingkungan" type="file" name="foto_lingkungan[]"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
@error('foto_lingkungan.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
@error('name_lingkungan.*')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
@endif
</div>
<div class=" bg-white rounded-lg shadow-md">
<div class="bg-blue-600 text-white py-4 px-6 flex items-center justify-between">
<h1 class="text-md font-medium text-gray-900">Pendamping</h1>
</div>
<div style="margin-top: 5px">
<div class="flex w-full items-center justify-center gap-4 mb-4">
<label class="form-label max-w-56">
<span class="form-label">Pendamping</span>
<input type="checkbox" name="ruteMenujuLokasi" class="checkbox">
</label>
<input type="file" name="ruteMenujuLokasi" class="file-input file-input-bordered w-full ">
<div class="w-full grid gap-5">
@if (isset($fotoJaminan))
<img src="{{ asset('storage/' . old('pendamping', $fotoJaminan->pendamping)) }}"
alt="Gambar Pendamping" style="width: 12rem;">
@endif
<input id="inputPendamping" type="file" name="pendamping"
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
<button type="button" class="btn btn-danger btn-sm delete-btn"
style="display: none;" id="btnDelete">
<i class="ki-filled ki-trash"></i>
</button>
</div>
</div>
@error('pendamping')
<span class="alert text-danger text-sm">{{ $message }}</span>
@enderror
</div>
</div>
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
<button type="submit" class="btn btn-success">
Save
</button>
</div>
</form>
@push('script')
<script>
const btnAdd = document.getElementById('btn-add');
btnAdd.addEventListener('click', () => {
const div = document.createElement('div');
div.innerHTML = `
<div class="flex w-ful items-center justify-center gap-4">
<label class="form-label max-w-56">
<span class="form-label">Pendamping</span>
<input type="checkbox" name="ruteMenujuLokasi" class="checkbox">
</label>
<input type="file" name="ruteMenujuLokasi" class="file-input file-input-bordered w-full ">
</div>
`;
document.querySelector('.flex-wrap').appendChild(div);
})
</div>
</div>
@endsection
@push('scripts')
<script>
document.addEventListener('DOMContentLoaded', function() {
// Generic function to handle adding new input and delete functionality
function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) {
const inputContainer = document.getElementById(containerId);
const addButton = document.getElementById(buttonId);
// Function to update the labels with the correct number
function updateLabels() {
const labels = inputContainer.querySelectorAll('.form-label span');
labels.forEach((label, index) => {
label.textContent = `${labelText} ${index + 1}`;
});
}
// Function to show or hide delete buttons
function handleDeleteButtons() {
const deleteBtns = inputContainer.querySelectorAll(`.${buttonDeleteClass}`);
deleteBtns.forEach(btn => {
btn.style.display = inputContainer.children.length > 1 ? 'block' : 'none';
});
}
// Function to create a new input
function createNewInput() {
// Clone the first child (input group) and reset input values
const newDiv = inputContainer.children[0].cloneNode(true);
// Clear the input file value
const inputFile = newDiv.querySelector(`.${inputDataClass}`);
if (inputFile) {
inputFile.value = ''; // Ensure the input field exists before resetting
}
// Find and set up the delete button for the new input group
const deleteBtn = newDiv.querySelector(`.${buttonDeleteClass}`);
if (deleteBtn) { // Ensure the delete button exists before adding the listener
deleteBtn.addEventListener('click', function() {
inputContainer.removeChild(newDiv);
handleDeleteButtons();
updateLabels();
});
} else {
console.error('Delete button not found in the cloned element.');
}
// Add margin to new inputs
newDiv.style.marginTop = '10px';
// Append the new input group
inputContainer.appendChild(newDiv);
updateLabels();
handleDeleteButtons();
}
// Add event listener for the "Add" button
if (addButton) { // Ensure the add button exists
addButton.addEventListener('click', createNewInput);
} else {
console.error('Add button not found.');
}
// Initialize delete button on the first input
const firstDeleteBtn = inputContainer.children[0].querySelector(`.${buttonDeleteClass}`);
if (firstDeleteBtn) {
firstDeleteBtn.addEventListener('click', function() {
if (inputContainer.children.length > 1) {
inputContainer.removeChild(this.closest('.flex'));
handleDeleteButtons();
updateLabels();
}
});
} else {
console.error('Initial delete button not found.');
}
// Initial update of the labels
updateLabels();
}
// Call the function for both "Rute Menuju Lokasi" and "Lantai"
setupInputHandlers('inputContainerRute', 'btnRute', 'Foto Rute Menuju Lokasi', 'file-input',
'delete-btn');
setupInputHandlers('inputContainerLantai', 'btnLantai', 'Foto Lantai', 'file-input', 'delete-btn');
setupInputHandlers('inputContainerLingkungan', 'btnLingkungan', 'linkungan', 'file-input',
'delete-btn');
});
</script>
@endpush

View File

@@ -0,0 +1,761 @@
@extends('layouts.main')
{{-- @section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection --}}
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card min-w-full">
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('surveyor.show', ['id' => request('inspeksi')]) }}?form=inspeksi"
class="btn btn-xs btn-info">
<i class="ki-filled ki-exit-left"></i> Back
</a>
</div>
</div>
@php
$jenisJaminanData = null;
@endphp
<div data-accordion="true">
@foreach ($permohonan->debiture->documents as $dokumen)
@php
$jenisJaminanData = $dokumen->jenisJaminan->name ?? '';
@endphp
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200"
data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</span>
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
</i>
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
</i>
</button>
<div class="accordion-content hidden" id="accordion_1_content_1">
<div class="card-body lg:py-7.5 grid grid-cols-2">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Jenis Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->jenisJaminan->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Hubungan Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->hubungan_pemilik->name ?? '' }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Alamat Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->address ?? '' }},
<br> {{ $dokumen->pemilik->village->name ?? '' }},
{{ $dokumen->pemilik->district->name ?? '' }},
{{ $dokumen->pemilik->city->name ?? '' }},
{{ $dokumen->pemilik->province->name ?? '' }} -
{{ $dokumen->pemilik->village->postal_code ?? '' }}
</span>
</div>
</div>
<div class="card-table scrollable-x-auto pb-3">
<table class="table align-middle text-sm text-gray-500">
@foreach ($dokumen->detail as $detail)
<tr>
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $detail->name ?? '' }}
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@if (isset($detail->dokumen_jaminan))
<a href="{{ route('debitur.jaminan.download', ['id' => $permohonan->debiture->id, 'dokumen' => $detail->id]) }}"
class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
<i class="ki-filled ki-cloud-download"></i></a>
@endif
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Keterangan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $detail->keterangan ?? '' }}
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
<div class="card">
<div class="card-body">
<form id="debiturForm"
action="{{ isset($analisa->id) ? route('debitur.update', $analisa->id) : route('surveyor.store') }}"
method="POST" enctype="multipart/form-data" class="grid gap-5">
@if (isset($analisa->id))
<input type="hidden" name="id" value="{{ $analisa->id }}">
@method('PUT')
@endif
@csrf
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
@php
$analisaType = 'unknown';
$data = [
'tanah' => 'Tanah',
'unit_rumah' => 'Rumah Tinggal / Ruko (Unit) / Apartemen (Unit) / Gudang',
'tanah_bangunan' => 'Kawasan Industrial / Komersil / Residensial - Perumahan',
'unit_gedung' => 'Gedung Apartement / Kantor / Condotel (Strata Title)',
'tanah_bangunan' => 'Mall',
];
if (isset($analisa->id)) {
$analisaType = $analisa->type;
} else {
foreach ($data as $key => $value) {
if (isset($jenisJaminanData) &&
trim(strtolower($jenisJaminanData)) === trim(strtolower($value))) {
$analisaType = $key;
break;
}
}
}
if ($analisaType === 'tanah') {
$analisaType = 'tanah_bangunan';
}
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
$analisaType = 'unit';
}
@endphp
<input type="hidden" name="action" value="{{ $analisaType }}">
<input type="hidden" name="type" value="{{ $analisaType }}">
@if ($analisaType == 'tanah_bangunan')
@include('lpj::surveyor.components.tanah-bangunan')
@else
@include('lpj::surveyor.components.apartemen-kantor')
@endif
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-green-600 text-white py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1>
</div>
<div class="grid gap-5">
<!-- Jarak dari Objek Utama -->
<div class="bg-gray-50 rounded-lg">
<div class="grid grid-cols-3 gap-5">
<div>
<label class="block text-sm font-medium text-gray-700">Jarak Dari Jalan
Utama</label>
<input type="text" class="input mt-2" name="jarak_jalan_utama" placeholder="Km"
value="{{ old('jarak_jalan_utama', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->jarak_jalan_utama : '') }}">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Jarak ke CBD Point</label>
<input type="text" class="input mt-2" name="jarak_cbd_point" placeholder="Km"
value="{{ old('jarak_cbd_point', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->jarak_cbd_point : '') }}">
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Lebar Perkerasan Jalan Depan
objek</label>
<input type="text" name="lebar_perkerasan_jalan" class="input mt-2"
placeholder="Meter"
value="{{ old('lebar_perkerasan_jalan', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lebar_perkerasan_jalan : '') }}">
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700">Alamat</label>
<input type="text" name="alamat" class="input mt-2"
placeholder="Masukkan Nama Jalan"
value="{{ old('alamat', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->alamat : '') }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Perkerasan Jalan</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('perkerasan_jalan') border-danger bg-danger-light @enderror"
name="perkerasan_jalan">
<option value="">Select Perkerasan Jalan</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->name }}"
{{ old('perkerasan_jalan', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->perkerasan_jalan : '') == $item->name ? 'selected' : '' }}>
{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('perkerasan_jalan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Lalulintas -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Lalulintas Depan Lokasi</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('lalu_lintas') border-danger bg-danger-light @enderror"
name="lalu_lintas">
<option value="">Select PLalulintas Depan Lokasi</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->name }}"
{{ old('lalu_lintas', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->lalu_lintas : '') == $item->name ? 'selected' : '' }}>
{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('lalu_lintas')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Golongan Hidup Sekitar -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Golongan Hidup Sekitar</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('gol_mas_sekitar') border-danger bg-danger-light @enderror"
name="gol_mas_sekitar">
<option value="">Select Golongan Hidup Sekitar</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->name }}"
{{ old('gol_mas_sekitar', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->gol_mas_sekitar : '') == $item->name ? 'selected' : '' }}>
{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('gol_mas_sekitar')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Tingkat Keramaian -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tingkat Keramaian</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('tingkat_keramaian') border-danger bg-danger-light @enderror"
name="tingkat_keramaian">
<option value="">Select Tingkat Keramaian</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->name }}"
{{ old('tingkat_keramaian', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->tingkat_keramaian : '') == $item->name ? 'selected' : '' }}>
{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('tingkat_keramaian')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Tataletak di Area -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tataletak di Area</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('terletak_diarea') border-danger bg-danger-light @enderror"
name="terletak_diarea">
<option value="">Select Tataletak di Area</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->name }}"
{{ old('terletak_diarea', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->terletak_diarea : '') == $item->name ? 'selected' : '' }}>
{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('terletak_diarea')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Struktru tata letak -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Struktru tata letak</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 gap-4">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="disekitar_lokasi" value="tidak"
{{ old('disekitar_lokasi', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->disekitar_lokasi : '') == 'tidak' ? 'checked' : '' }}>
<span class="ml-2">Telah Ada Bangunan</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="disekitar_lokasi" value="ya"
{{ old('disekitar_lokasi', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->disekitar_lokasi : '') == 'ya' ? 'checked' : '' }}>
<span class="ml-2">Belum Ada Bangunan</span>
</label>
</div>
@error('disekitar_lokasi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Dekat Makam -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Dekat Makamh</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 gap-4 mt-2">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="dekat_makam" value="ya"
{{ old('dekat_makam', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->dekat_makam : '') == 'ya' ? 'checked' : '' }}>
<span class="ml-2">Ya</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="dekat_makam" value="tidak"
{{ old('dekat_makam', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->dekat_makam : '') == 'tidak' ? 'checked' : '' }}>
<span class="ml-2">Tidak</span>
</label>
</div>
@error('dekatMakam')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Dekat Tps</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 gap-4 mt-2">
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="dekat_tps" value="ya"
{{ old('dekat_tps', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->dekat_tps : '') == 'ya' ? 'checked' : '' }}>
<span class="ml-2">Ya</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="dekat_tps" value="tidak"
{{ old('dekat_tps', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->dekat_tps : '') == 'tidak' ? 'checked' : '' }}>
<span class="ml-2">Tidak</span>
</label>
</div>
@error('dekatTps')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Merupakan daerah</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('merupakan_daerah') border-danger bg-danger-light @enderror"
name="merupakan_daerah">
<option value="">Select Merupakan daerah</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->name }}"
{{ old('merupakan_daerah', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->merupakan_daerah : '') == $item->name ? 'selected' : '' }}>
{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('merupakan_daerah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Fasilitas Umum Sekitar -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Fasilitas Umum dekat Object</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('fasilitas_dekat_object') border-danger bg-danger-light @enderror"
name="fasilitas_dekat_object">
<option value="">Select Fasilitas Umum Ddekat Object</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->name }}"
{{ old('fasilitas_dekat_object', isset($analisa->analisaLingkungan) ? $analisa->analisaLingkungan->fasilitas_dekat_object : '') == $item->name ? 'selected' : '' }}>
{{ $item->name }}</option>
@endforeach
@endif
</select>
@error('fasilitas_dekat_object')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-blue-600 text-white py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1>
</div>
<div class="grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Faktor Positif</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="fakta_positif" rows="3">{{ old('fakta_positif', isset($analisa->analisaFakta) ? $analisa->analisaFakta->fakta_positif : '') }}</textarea>
@error('fakta_positif')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Faktor Negatif</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="fakta_negatif" rows="3">{{ old('fakta_negatif', isset($analisa->analisaFakta) ? $analisa->analisaFakta->fakta_negatif : '') }}</textarea>
@error('fakta_negatif')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Rute Menuju</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="rute_menuju" rows="3">{{ old('rute_menuju', isset($analisa->analisaFakta) ? $analisa->analisaFakta->rute_menuju : '') }}</textarea>
@error('rute_menuju')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Batas batas</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 gap-4 items-center w-full">
<div>
<select class="select mt-2" name="batas_batas">
@if (isset($arahMataAngin))
@foreach ($arahMataAngin as $item)
<option value="{{ $item->id }}"
{{ old('batas_batas', isset($analisa->analisaFakta) ? $analisa->analisaFakta->batas_batas : '') == $item->id ? 'selected' : '' }}>
{{ $item->name }}</option>
@endforeach
@endif
</select>
</div>
<div>
<input name="keteranganBatas" type="text" class="input mt-2">
</div>
</div>
@error('batas_batas')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kondisi lain terkait lingkungan</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="kondisi_linkungan" rows="3">{{ old('kondisi_linkungan', isset($analisa->analisaFakta) ? $analisa->analisaFakta->kondisi_linkungan : '') }}</textarea>
@error('kondisi_linkungan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kondisi lain terkait Bangunan</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="kondisi_lain_bangunan" rows="3">{{ old('kondisi_lain_bangunan', isset($analisa->analisaFakta) ? $analisa->analisaFakta->kondisi_lain_bangunan : '') }}</textarea>
@error('kondisi_lain_bangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Informasi Terkait Dokumen</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea mt-2" name="informasi_dokument" rows="3">{{ old('informasi_dokument', isset($analisa->analisaFakta) ? $analisa->analisaFakta->informasi_dokument : '') }}</textarea>
@error('informasi_dokument')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div class="container mx-auto ">
<!-- Header -->
<div class="bg-blue-600 text-white py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Informasi Dinas Tata Ruang</h1>
</div>
<!-- Informasi Tata Ruang Form -->
<div class="grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Peruntukan</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="peruntukan" class="input"
placeholder="Masukkan Peruntukan"
value="{{ old('peruntukan', isset($analisa->analisaFakta) ? $analisa->analisaFakta->peruntukan : '') }}">
@error('peruntukan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">KDB</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="kdb" class="input" placeholder="Masukkan KDB"
value="{{ old('kdb', isset($analisa->analisaFakta) ? $analisa->analisaFakta->kdb : '') }}">
@error('kdb')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">KDH</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="kdh" class="input" placeholder="Masukkan KDH"
value="{{ old('kdh', isset($analisa->analisaFakta) ? $analisa->analisaFakta->kdh : '') }}">
@error('kdh')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">GSB</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="gsb" class="input" placeholder="Masukkan GSB"
value="{{ old('gsb', isset($analisa->analisaFakta) ? $analisa->analisaFakta->gsb : '') }}">
@error('gsb')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Max Lantai</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="max_lantai" class="input"
placeholder="Masukkan Max Lantai"
value="{{ old('max_lantai', isset($analisa->analisaFakta) ? $analisa->analisaFakta->max_lantai : '') }}">
@error('maxLantai')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">KLB</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="klb" class="input" placeholder="Masukkan KLB"
value="{{ old('klb', isset($analisa->analisaFakta) ? $analisa->analisaFakta->klb : '') }}">
@error('klb')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">GSS</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="gss" class="input" placeholder="Masukkan GSS"
value="{{ old('gss', isset($analisa->analisaFakta) ? $analisa->analisaFakta->gss : '') }}">
@error('gss')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Pelebaran Jalan</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="pelebaran_jalan" class="input"
placeholder="Masukkan Pelebaran Jalan"
value="{{ old('pelebaran_jalan', isset($analisa->analisaFakta) ? $analisa->analisaFakta->pelebaran_jalan : '') }}">
@error('pelebaran_jalan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Nama Petugas TK</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="nama_petugas" class="input"
placeholder="Masukkan Petugas TK"
value="{{ old('nama_petugas', isset($analisa->analisaFakta) ? $analisa->analisaFakta->nama_petugas : '') }}">
@error('nama_petugas')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
<!-- Peta Section -->
<div class="mt-2" style="margin-top: 20px">
<input type="hidden" name="lat" id="lat"
value="{{ old('lat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lat : '') }}">
<input type="hidden" name="lng" id="lng"
value="{{ old('lng', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lng : '') }}">
<div class="bg-info border p-6 rounded-lg shadow-lg flex items-center justify-center"
style="height: 300px">
<iframe id="mapFrame" frameborder="0" style="width: 100%; height: 100%;"></iframe>
</div>
</div>
<!-- Upload Photo Button -->
<div class=" flex w-full mt-2" style="margin-top: 20px">
<div class="flex flex-col input-group w-full">
<div>
@if (old('foto_tempat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->foto_tempat : ''))
<img src="{{ asset('storage/' . old('foto_tempat', $analisa->analisaFakta->foto_tempat)) }}"
alt="Gambar Tempat" style="width: 18rem;">
@endif
</div>
<label for="" class="block text-sm font-medium text-gray-700">Upload Photo</label>
<input class="file-input" name="foto_tempat"
value="{{ old('foto_tempat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->foto_tempat : '') }}"
type="file" accept="image/*" />
@error('foto_tempat')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Notes Section -->
<div class="mt-2" style="margin-top: 20px">
<div class="bg-white p-6 rounded-lg">
<h4 class="block text-sm font-medium text-gray-700 mt-2">Catatan yang Perlu Diperhatikan
</h4>
<textarea name="keterangan" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="3">{{ old('keterangan', isset($analisa->analisaFakta) ? $analisa->analisaFakta->keterangan : '') }}</textarea>
</div>
</div>
</div>
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
<button type="submit" class="btn btn-success">
Save
</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
// Fungsi untuk mengambil lokasi pengguna
function getUserLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
} else {
alert("Geolocation tidak didukung oleh browser ini.");
}
}
// Fungsi untuk menampilkan posisi
function showPosition(position) {
var lat = position.coords.latitude;
var lng = position.coords.longitude;
document.getElementById('lat').value = lat;
document.getElementById('lng').value = lng;
var mapUrl = `https://www.google.com/maps?q=${lat},${lng}&z=15&output=embed`;
document.getElementById('mapFrame').src = mapUrl;
}
// Fungsi untuk menangani error jika lokasi tidak bisa diambil
function showError(error) {
switch (error.code) {
case error.PERMISSION_DENIED:
alert("Pengguna menolak permintaan geolokasi.");
break;
case error.POSITION_UNAVAILABLE:
alert("Informasi lokasi tidak tersedia.");
break;
case error.TIMEOUT:
alert("Permintaan lokasi pengguna berakhir.");
break;
case error.UNKNOWN_ERROR:
alert("Terjadi kesalahan yang tidak diketahui.");
break;
}
}
window.onload = getUserLocation;
</script>
@endpush

View File

@@ -10,11 +10,13 @@
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
<label class="form-label flex items-center gap-3 text-nowrap">
<input type="radio" class="radio" name="luasTanah" value="sesuai">
<input type="radio" class="radio" name="luas" value="sesuai"
{{ old('luas') == 'sesuai' && $analisa->luas ? 'checked' : '' }}>
<span class="ml-2">Sesuai</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="luasTanah" value="tidakSesuai">
<input type="radio" class="radio" name="luas" value="tidak sesuai"
{{ old('luas') == 'tidak sesuai' && $analisa->luas ? 'checked' : '' }}>
<span class="ml-2">Tidak Sesuai</span>
</label>
</div>
@@ -29,18 +31,19 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Hadap Mata Angin</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('bentuk_tanah') border-danger bg-danger-light @enderror"
name="bentuk_tanah">
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
name="hadapMataAngin">
<option value="">Select Hadap Mata Angin</option>
@if (isset($arahMataAngin))
@foreach ($arahMataAngin as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('bentuk_tanah')
@error('hadapMataAngin')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -50,13 +53,24 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Bentuk Tanah</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('bentuk_tanah') border-danger bg-danger-light @enderror"
<select class="input tomselect w-full @error('bentuk_tanah') border-danger bg-danger-light @enderror"
name="bentuk_tanah">
<option value="">Select Bentuk Tanah</option>
@if (isset($bentukTanah))
@foreach ($bentukTanah as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
@if (isset($analisa) && isset($analisa->analisaTanahBangunan))
<option value="{{ $item->name }}"
{{ $analisa->analisaTanahBangunan->bentuk_tanah == $item->name ? 'selected' : '' }}>
{{ $item->name }}
</option>
@else
<option value="{{ $item->name }}"
{{ old('bentuk_tanah') == $item->name ? 'selected' : '' }}>
{{ $item->name }}
</option>
@endif
@endforeach
@endif
</select>
@@ -67,21 +81,25 @@
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kontur Tanah</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('konturTanah') border-danger bg-danger-light @enderror"
name="konturTanah">
<select class="input tomselect w-full @error('kontur_tanah') border-danger bg-danger-light @enderror"
name="kontur_tanah">
<option value="">Select Kontur Tanah</option>
@if (isset($konturTanah))
@foreach ($konturTanah as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('kontur_tanah', isset($analisa) && optional($analisa->analisaTanahBangunan)->kontur_tanah) == $item->name ? 'selected' : '' }}>
{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('konturTanah')
@error('kontur_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -93,17 +111,19 @@
<label class="form-label max-w-56">Beda Ketinggian Dengan Jalan</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('ketinggianTanah') border-danger bg-danger-light @enderror"
name="ketinggianTanah">
class="input tomselect w-full @error('ketinggian_jalan') border-danger bg-danger-light @enderror"
name="ketinggian_jalan">
<option value="">Select Ketinggian Dengan Jalan</option>
@if (isset($ketinggianTanah))
@foreach ($ketinggianTanah as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('ketinggian_jalan', isset($analisa) && optional($analisa->analisaTanahBangunan)->ketinggian_jalan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('ketinggianTanah')
@error('ketinggian_jalan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -111,22 +131,23 @@
<!-- Kontur Jalan Depan Objek -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kontur Jalan Depan Objek</label>
<div class="flex flex-wrap items-baseline w-full">
<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">
<input type="radio" class="radio" name="konturJalan" value="menurun">
<input type="radio" class="radio" name="kontur_jalan" value="menurun"
{{ old('kontur_jalan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kontur_jalan) == 'menurun' ? 'checked' : '' }}>
<span class="ml-2">Menurun</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="konturJalan" value="rata">
<input type="radio" class="radio" name="kontur_jalan" value="rata"
{{ old('kontur_jalan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kontur_jalan) == 'rata' ? 'checked' : '' }}>
<span class="ml-2">Rata</span>
</label>
</div>
@error('bentuk_tanah')
@error('kontur_jalan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -136,18 +157,18 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Posisi Kavling</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('posisiKavling') border-danger bg-danger-light @enderror"
name="posisiKavling">
<select class="input tomselect w-full @error('posisi_kavling') border-danger bg-danger-light @enderror"
name="posisi_kavling">
<option value="">Select Posisi Kavling</option>
@if (isset($posisiKavling))
@foreach ($posisiKavling as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('posisi_kavling', isset($analisa) && optional($analisa->analisaTanahBangunan)->posisi_kavling) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('posisiKavling')
@error('posisi_kavling')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -160,16 +181,18 @@
<div class="flex flex-wrap items-baseline w-full">
<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">
<input type="radio" class="radio" name="tusukSate" value="ya">
<input type="radio" class="radio" name="tusuk_sate" value="yes"
{{ old('tusuk_sate', isset($analisa) && optional($analisa->analisaTanahBangunan)->tusuk_sate) == 'yes' ? 'checked' : '' }}>
<span class="ml-2">Ya</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="tusukSate" value="tidak">
<input type="radio" class="radio" name="tusuk_sate" value="no"
{{ old('tusuk_sate', isset($analisa) && optional($analisa->analisaTanahBangunan)->tusuk_sate) == 'no' ? 'checked' : '' }}>
<span class="ml-2">Tidak</span>
</label>
</div>
@error('bentuk_tanah')
@error('tusuk_sate')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -181,16 +204,17 @@
<div class="flex flex-wrap items-baseline w-full">
<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">
<input type="radio" class="radio" name="lockland" value="ya">
<input type="radio" class="radio" name="lockland" value="yes"
{{ old('lockland', isset($analisa) && optional($analisa->analisaTanahBangunan)->lockland) == 'yes' ? 'checked' : '' }}>
<span class="ml-2">Ya</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="lockland" value="tidak">
<input type="radio" class="radio" name="lockland" value="no"
{{ old('lockland', isset($analisa) && optional($analisa->analisaTanahBangunan)->lockland) == 'no' ? 'checked' : '' }}>
<span class="ml-2">Tidak</span>
</label>
</div>
@error('bentuk_tanah')
@error('lockland')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -202,17 +226,19 @@
<label class="form-label max-w-56">Kondisi Fisik Tanah</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('kondisiFisikTanah') border-danger bg-danger-light @enderror"
name="kondisiFisikTanah">
class="input tomselect w-full @error('kondisi_fisik_tanah') border-danger bg-danger-light @enderror"
name="kondisi_fisik_tanah">
<option value="">Select Posisi Kavling</option>
@if (isset($kondisiFisikTanah))
@foreach ($kondisiFisikTanah as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('kondisi_fisik_tanah', isset($analisa) && optional($analisa->analisaTanahBangunan)->kondisi_fisik_tanah) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('kondisiFisikTanah')
@error('kondisi_fisik_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -220,28 +246,30 @@
</div>
</div>
@if ($analisaType == 'tanah_bangunan')
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
<div class="bg-blue-600 text-white py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Analisa Bangunan</h1>
</div>
<div class="grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Luas Tanah</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
<label class="form-label flex items-center gap-3 text-nowrap">
<input type="radio" class="radio" name="luasTanah" value="sesuai">
<input type="radio" class="radio" name="luas_tanah_bagunan" value="sesuai"
{{ old('luas_tanah_bagunan') == 'sesuai' ? 'checked' : '' }}>
<span class="ml-2">Sesuai</span>
</label>
<label class="form-label flex items-center gap-2.5 text-nowrap">
<input type="radio" class="radio" name="luasTanah" value="tidakSesuai">
<input type="radio" class="radio" name="luas_tanah_bagunan" value="tidak sesuai"
{{ old('luas_tanah_bagunan') == 'tidak sesuai' ? 'checked' : '' }}>
<span class="ml-2">Tidak Sesuai</span>
</label>
</div>
@error('bentuk_tanah')
@error('luas_tanah_bagunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -253,17 +281,19 @@
<label class="form-label max-w-56">Jenis Bangunan</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('jenisBangunan') border-danger bg-danger-light @enderror"
name="jenisBangunan">
class="input tomselect w-full @error('jenis_bangunan') border-danger bg-danger-light @enderror"
name="jenis_bangunan">
<option value="">Select Jenis Bangunan</option>
@if (isset($jenisBangunan))
@foreach ($jenisBangunan as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('jenis_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->jenis_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('jenisBangunan')
@error('jenis_bangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -274,17 +304,19 @@
<label class="form-label max-w-56">Kondisi Bangunan</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('kondisiBangunan') border-danger bg-danger-light @enderror"
name="kondisiBangunan">
class="input tomselect w-full @error('kondisi_bangunan') border-danger bg-danger-light @enderror"
name="kondisi_bangunan">
<option value="">Select Kondisi Bangunan</option>
@if (isset($kondisiBangunan))
@foreach ($kondisiBangunan as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('kondisi_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kondisi_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('kondisiBangunan')
@error('kondisi_bangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
@@ -295,27 +327,32 @@
<label class="form-label max-w-56"> Sifat Bangunan</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('sifatBangunan') border-danger bg-danger-light @enderror"
name="sifatBangunan">
class="input tomselect w-full @error('sifat_bangunan') border-danger bg-danger-light @enderror"
name="sifat_bangunan">
<option value="">Select Sifat Bangunan</option>
@if (isset($sifatBangunan))
@foreach ($sifatBangunan as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('sifat_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->sifat_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('sifatBangunan')
@error('sifat_bangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Spek Bangunan -->
<div class="gap-2.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Spek Bangunan</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="flex flex-wrap items-baseline w-full" id="spek-bangunan-container">
<div class="spek-bangunan w-full gap-4">
<input type="hidden" name="nama_bagunan[]" value="Bangunan">
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2 w-full">
@if (@isset($spekKategoriBagunan))
@foreach ($spekKategoriBagunan as $item)
@@ -324,36 +361,38 @@
class="form-label flex items-center gap-3 text-nowrap">{{ $item->name }}</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('kondisiFisikTanah') border-danger bg-danger-light @enderror"
name="kondisiFisikTanah">
class="input tomselect w-full @error('name') border-danger bg-danger-light @enderror"
name="name[]">
<option value="">Select {{ $item->name }}</option>
@if (isset($spekBangunan))
@foreach ($spekBangunan as $spek)
@if ($spek->spek_kategori_bagunan_id == $item->id)
<option value="{{ $spek->name }}">{{ $spek->name }}
@if ($spek->spek_kategori_bangunan_id == $item->id)
<option value="{{ $spek->name }}"
{{ old('name') == $spek->name ? 'selected' : '' }}>
{{ $spek->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('kondisiFisikTanah')
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
</div>
<button type="button"
class="mt-2 btn btn-danger btn-outline btn-xs delete-button">Hapus</button>
</div>
</div>
</div>
<div class="flex justify-end">
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
tambah bangunan
<i class="ki-filled ki-plus"></i>
</button>
</div>
</div>
@@ -364,21 +403,78 @@
<label class="form-label max-w-56">Sarana pelengkap</label>
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('saranaPelengkap') border-danger bg-danger-light @enderror"
name="saranaPelengkap">
class="input tomselect w-full @error('sarana_pelengkap') border-danger bg-danger-light @enderror"
name="sarana_pelengkap">
<option value="">Select Posisi Kavling</option>
@if (isset($saranaPelengkap))
@foreach ($saranaPelengkap as $item)
<option value="{{ $item->id }}">{{ $item->name }}</option>
<option value="{{ $item->name }}"
{{ old('sarana_pelengkap', isset($analisa) && optional($analisa->analisaTanahBangunan)->sarana_pelengkap) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('saranaPelengkap')
@error('sarana_pelengkap')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
@endif
</div>
</div>
@push('scripts')
<script>
const spekBangunanContainer = document.getElementById('spek-bangunan-container');
function updateDeleteButtonsVisibility() {
const allDeleteButtons = spekBangunanContainer.querySelectorAll('.delete-button');
// Only show the delete buttons if there are more than one form
allDeleteButtons.forEach(button => {
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
button.style.display = 'inline-block';
} else {
button.style.display = 'none';
}
});
}
document.getElementById('addBagunan').addEventListener('click', function() {
const newDiv = spekBangunanContainer.querySelector('.spek-bangunan').cloneNode(true);
// Clear the selected values of the cloned input fields
newDiv.querySelectorAll('select').forEach(select => {
select.value = '';
});
// Append the cloned div to the container
spekBangunanContainer.appendChild(newDiv);
// Add event listener to the delete button in the cloned div
newDiv.querySelector('.delete-button').addEventListener('click', function() {
spekBangunanContainer.removeChild(newDiv);
updateDeleteButtonsVisibility();
});
// Update delete buttons visibility
updateDeleteButtonsVisibility();
});
// Initial delete button visibility
updateDeleteButtonsVisibility();
// Add delete functionality to the initial form
spekBangunanContainer.querySelectorAll('.delete-button').forEach(button => {
button.addEventListener('click', function() {
const spekBangunan = this.closest('.spek-bangunan');
// Make sure not to delete the last remaining form
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
spekBangunan.remove();
updateDeleteButtonsVisibility();
}
});
});
</script>
@endpush

View File

@@ -5,6 +5,18 @@
@endsection
@section('content')
@push('style')
<style>
.add-new-bg {
background-image: url('/assets/media/images/2600x1200/bg-4.png');
}
.dark .add-new-bg {
background-image: url('/assets/media/images/2600x1200/bg-4-dark.png');
}
</style>
@endpush
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card">
<div class="card-header" id="advanced_settings_appearance">
@@ -43,11 +55,10 @@
{{ $permohonan->penilaian->keterangan }}
</span>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
@@ -56,8 +67,8 @@
</div>
<div data-accordion="true">
@foreach ($permohonan->debiture->documents as $dokumen)
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true"
id="accordion_1_item_1">
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200"
data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
@@ -146,43 +157,60 @@
@endforeach
</div>
</div>
</div>
<div class="card min-w-full py-2 px-2">
<div class="card-header" id="basic_settings">
<div class="card-title flex flex-row gap-1.5">
<a href="{{ route('surveyor.show',array_merge(request()->query(),['id'=>$surveyor])) }}" class="btn btn-xs {{ request()->routeIs('surveyor.show') ? 'btn-outline btn-primary' : 'btn-light' }}" class="btn btn-xs btn-outline btn-primary">FORM INSPEKSI</a>
<a href="{{ route('surveyor.show', array_merge(request()->query(), ['id' => $surveyor, 'form' => 'inspeksi'])) }}"
class="btn btn-xs {{ request()->has('form') && request('form') == 'inspeksi' ? 'btn-outline btn-primary' : 'btn-light' }}">FORM
INSPEKSI</a>
<a href="{{ route('surveyor.denah',array_merge(request()->query(),['id'=>$surveyor])) }}" class="btn btn-xs {{ request()->routeIs('surveyor.denah') ? 'btn-outline btn-primary' : 'btn-light' }}" class="btn btn-xs btn-outline btn-primary">DENAH TANAH DAN BANGUNAN</a>
<a href="{{ route('surveyor.show', array_merge(request()->query(), ['id' => $surveyor, 'form' => 'denah'])) }}"
class="btn btn-xs {{ request()->has('form') && request('form') == 'denah' ? 'btn-outline btn-primary' : 'btn-light' }}">DENAH
TANAH DAN BANGUNAN</a>
<a href="{{ route('surveyor.foto',array_merge(request()->query(),['id'=>$surveyor])) }}" class="btn btn-xs {{ request()->routeIs('surveyor.foto') ? 'btn-outline btn-primary' : 'btn-light' }}" class="btn btn-xs btn-outline btn-primary">FOTO</a>
<a href="{{ route('surveyor.show', array_merge(request()->query(), ['id' => $surveyor, 'form' => 'foto'])) }}"
class="btn btn-xs {{ request()->has('form') && request('form') == 'foto' ? 'btn-outline btn-primary' : 'btn-light' }}">FOTO</a>
<a href="{{ route('surveyor.data-pembanding',array_merge(request()->query(),['id'=>$surveyor])) }}" class="btn btn-xs {{ request()->routeIs('surveyor.data-pembanding') ? 'btn-outline btn-primary' : 'btn-light' }}" class="btn btn-xs btn-outline btn-primary">DATA PEMBANDING</a>
{{-- <a href="{{ route('surveyor.show', array_merge(request()->query(), ['id' => $surveyor, 'form' => 'data-pembanding'])) }}"
class="btn btn-xs {{ request()->has('form') && request('form') == 'data-pembanding' ? 'btn-outline btn-primary' : 'btn-light' }}">DATA
PEMBANDING</a> --}}
</div>
</div>
</div>
<div class="card-body">
@if(request()->routeIs('surveyor.show',$surveyor))
@include('lpj::surveyor.components.form-inspeksi')
@elseif(request()->routeIs('surveyor.denah',$surveyor))
@include('lpj::surveyor.components.denah')
@elseif(request()->routeIs('surveyor.foto', $surveyor))
@include('lpj::surveyor.components.foto')
@elseif(request()->routeIs('surveyor.data-pembanding', $surveyor))
@include('lpj::surveyor.components.data-pembanding')
@endif
@if (request()->has('form') && request('form') == 'denah')
@include('lpj::surveyor.components.card-tambah')
{{-- @elseif(request()->has('form') && request('form') == 'data-pembanding')
@include('lpj::surveyor.components.data-pembanding') --}}
@elseif(request()->has('form') && request('form') == 'foto')
@include('lpj::surveyor.components.card-tambah')
@else
@include('lpj::surveyor.components.card-tambah')
@endIf
</div>
@if (request()->has('form') && request('form') !== 'data-pembanding')
<div class="card-footer">
<form action="{{ route('surveyor.submitSurveyor', $surveyor) }}" method="POST">
@csrf
@method('PUT')
<button type="submit" class="btn btn-primary " {{ $buttonDisable ? 'disabled' : '' }}>
Submit
</button>
</form>
</div>
@endif
</div>
</div>
@endsection
@push('scripts')
<script>
$('.card-title a').on('click', function(e) {
e.preventDefault();
@@ -192,7 +220,5 @@
$('.card-body').html(response);
});
});
</script>
@endpush

View File

@@ -234,7 +234,7 @@
<a class="btn btn-sm btn-icon btn-clear btn-info" data-modal-toggle="#modal_revisi" >
<i class="ki-outline ki-notepad-edit"></i>
</a>
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${data.id}/show">
<a class="btn btn-sm btn-icon btn-clear btn-warning" href="surveyor/${data.id}/show?form=inspeksi">
<i class="ki-outline ki-eye"></i>
</a>
</div>`,

View File

@@ -530,11 +530,15 @@ Route::middleware(['auth'])->group(function () {
Route::name('surveyor.')->prefix('surveyor')->group(function () {
Route::get('/', [SurveyorController::class, 'index'])->name('index');
Route::get('{id}/show', [SurveyorController::class, 'show'])->name('show');
Route::post('store', [SurveyorController::class, 'store'])->name('store');
Route::post('storeDenah', [SurveyorController::class, 'storeDenah'])->name('storeDenah');
Route::post('storeFoto', [SurveyorController::class, 'storeFoto'])->name('storeFoto');
Route::get('datatables', [SurveyorController::class, 'dataForDatatables'])->name('datatables');
Route::get('form-inspeksi/{id}', [SurveyorController::class, 'formInspeksi'])->name('form-inspeksi');
Route::get('denah/{id}', [SurveyorController::class, 'denah'])->name('denah');
Route::get('foto/{id}', [SurveyorController::class, 'foto'])->name('foto');
Route::get('inspeksi/{id}/{jaminanId}', [SurveyorController::class, 'formInspeksi'])->name('inspeksi');
Route::get('denah/{id}/{jaminanId}', [SurveyorController::class, 'denah'])->name('denah');
Route::get('foto/{id}/{jaminanId}', [SurveyorController::class, 'foto'])->name('foto');
Route::get('data-pembanding/{id}', [SurveyorController::class, 'dataPembanding'])->name('data-pembanding');
Route::put('submitSurveyor/{id}', [SurveyorController::class, 'submitSurveyor'])->name('submitSurveyor');
});