update form surveyor alat berat, kapal, kendaraan, mesin

This commit is contained in:
majid
2024-11-05 16:54:04 +07:00
parent 0395235ce0
commit 2ae29fae23
16 changed files with 1110 additions and 283 deletions

View File

@@ -30,43 +30,43 @@ class ActivityController extends Controller
*/ */
public function progres_activity() public function progres_activity()
{ {
// Ambil user yang sedang login // Ambil user yang sedang login
$user = auth()->user(); $user = auth()->user();
$roles = $user->load('roles'); $roles = $user->load('roles');
// Inisialisasi regionId dan teamId sebagai null agar bisa dinamis // Inisialisasi regionId dan teamId sebagai null agar bisa dinamis
$regionId = null; $regionId = null;
$teamId = null; $teamId = null;
if ($roles->roles->pluck('name')->contains('senior-officer')) { if ($roles->roles->pluck('name')->contains('senior-officer')) {
$userTeam = TeamsUsers::with('team') $userTeam = TeamsUsers::with('team')
->where('user_id', $user->id) ->where('user_id', $user->id)
->first(); ->first();
$regionId = $userTeam?->team->regions_id; $regionId = $userTeam?->team->regions_id;
$teamId = $userTeam?->teams_id; $teamId = $userTeam?->teams_id;
} }
$teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions', 'user.roles']) $teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions', 'user.roles'])
->whereHas('team', function ($q) use ($regionId, $teamId) { ->whereHas('team', function ($q) use ($regionId, $teamId) {
if ($regionId) { if ($regionId) {
$q->where('regions_id', $regionId); $q->where('regions_id', $regionId);
} }
if ($teamId) { if ($teamId) {
$q->where('id', $teamId); // Hanya tim yang sama $q->where('id', $teamId); // Hanya tim yang sama
} }
}) })
->where('user_id', '!=', $user->id) ->where('user_id', '!=', $user->id)
->whereHas('user.roles', function ($query) { ->whereHas('user.roles', function ($query) {
// Filter hanya peran 'surveyor' atau 'surveyor-penilai' // Filter hanya peran 'surveyor' atau 'surveyor-penilai'
$query->whereIn('name', ['surveyor', 'surveyor-penilai']); $query->whereIn('name', ['surveyor', 'surveyor-penilai']);
}) })
->get(); ->get();
return view('lpj::activity.progres_activity.index', compact('teamsActivity')); return view('lpj::activity.progres_activity.index', compact('teamsActivity'));
} }
@@ -119,6 +119,10 @@ class ActivityController extends Controller
* Update the specified resource in storage. * Update the specified resource in storage.
*/public function dataForDatatables(Request $request) */public function dataForDatatables(Request $request)
{ {
$user = auth()->user();
// Check permissions // Check permissions
if (is_null($this->user) || !$this->user->can('debitur.view')) { if (is_null($this->user) || !$this->user->can('debitur.view')) {
// abort(403, 'Sorry! You are not allowed to view users.'); // abort(403, 'Sorry! You are not allowed to view users.');
@@ -170,7 +174,23 @@ class ActivityController extends Controller
$filteredRecords = $query->count(); $filteredRecords = $query->count();
// Get data // Get data
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])->get();
$data = null;
$userRole = $user->roles[0]->name ?? null;
if (in_array($userRole, ['surveyor', 'surveyor-penilai'])) {
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian',])
->whereHas('penilaian.userPenilai', function ($q) use ($user) {
$q->where('user_id', $user->id);
})
->get();
} else {
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian'])
->get();
}
// Calculate total pages // Calculate total pages
$pageCount = ceil($totalRecords / $request->get('size', 10)); $pageCount = ceil($totalRecords / $request->get('size', 10));

View File

@@ -118,7 +118,7 @@ class PenilaianController extends Controller
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan'); return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
} catch (Exception $e) { } catch (Exception $e) {
DB::rollBack(); DB::rollBack();
return response()->json(array('error' => $e->getMessage())); return redirect()->route('penilaian.index')->with('error', $e->getMessage());
} }
} }
} }
@@ -170,7 +170,7 @@ class PenilaianController extends Controller
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan'); return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
} catch (Exception $e) { } catch (Exception $e) {
DB::rollBack(); DB::rollBack();
return response()->json(array('error' => $e->getMessage())); return redirect()->route('penilaian.index')->with('error', $e->getMessage());
} }
} }

View File

@@ -711,7 +711,8 @@ class SurveyorController extends Controller
$validate = $request->validated(); $validate = $request->validated();
if ($validate) { if ($validate) {
$type = $request->route('type'); try {
$type = $request->route('type');
$modelClass = $this->getModelClass($type); $modelClass = $this->getModelClass($type);
@@ -733,6 +734,14 @@ class SurveyorController extends Controller
return redirect() return redirect()
->route('basicdata.' . $type .'.index') ->route('basicdata.' . $type .'.index')
->with('success', 'created successfully'); ->with('success', 'created successfully');
} catch (Exeception $e) {
return response()->json(array('error' => $e->getMessage()), 400);
// return redirect()
// ->route('basicdata.' . $type .'.index')
// ->with('error', $th->getMessage());
}
} }
} }
@@ -940,7 +949,7 @@ class SurveyorController extends Controller
public function submitSurveyor(Request $request, $id) public function submitSurveyor(Request $request, $id)
{ {
$permohonan = Permohonan::find($id); $permohonan = Permohonan::find($id);
$permohonan->update([ $permohonan->update([
'status' => 'done', 'status' => 'done',
@@ -978,6 +987,7 @@ class SurveyorController extends Controller
'tingkat-keramaian' => TingkatKeramaian::class, 'tingkat-keramaian' => TingkatKeramaian::class,
'gol-mas-sekitar' => GolonganMasySekitar::class, 'gol-mas-sekitar' => GolonganMasySekitar::class,
'spek-kategori-bangunan' => SpekKategoritBangunan::class, 'spek-kategori-bangunan' => SpekKategoritBangunan::class,
'spek-bangunan' => SpekBangunan::class,
'lantai-unit' => Lantai::class, 'lantai-unit' => Lantai::class,
'view-unit' => ViewUnit::class, 'view-unit' => ViewUnit::class,
]; ];

View File

@@ -70,7 +70,8 @@ class SurveyorRequest extends FormRequest
return match ($action) { return match ($action) {
'spek-bangunan' => [ 'spek-bangunan' => [
'spek_kategori_bangunan_id' => [ 'spek_kategori_bangunan_id' => [
'required' 'required',
], ],
], ],
// Add more action specific rules here // Add more action specific rules here

View File

@@ -14,7 +14,7 @@ class KondisiBangunan extends Model
/** /**
* The attributes that are mass assignable. * The attributes that are mass assignable.
*/ */
protected $fillable = []; protected $fillable = ['code', 'name'];
protected static function newFactory(): KondisiBangunanFactory protected static function newFactory(): KondisiBangunanFactory
{ {

View File

@@ -17,7 +17,7 @@ class Penilaian extends Model
*/ */
protected $table = 'penilaian'; protected $table = 'penilaian';
protected $fillable = [ protected $fillable = [
'jenis_penilaian_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi', 'jenis_penilaian_id', 'penilaian_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi',
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by' 'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
]; ];
@@ -47,6 +47,4 @@ class Penilaian extends Model
{ {
return $this->belongsTo(Permohonan::class, 'nomor_registrasi', 'nomor_registrasi'); return $this->belongsTo(Permohonan::class, 'nomor_registrasi', 'nomor_registrasi');
} }
} }

View File

@@ -29,7 +29,7 @@ class PenilaianTeam extends Model
public function penilaian(){ public function penilaian(){
return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id'); return $this->hasMany(Penilaian::class, 'penilaian_id', 'id');
} }
protected static function newFactory(): PenilaianTeamFactory protected static function newFactory(): PenilaianTeamFactory

View File

@@ -183,7 +183,6 @@
"attributes": [], "attributes": [],
"permission": "", "permission": "",
"roles": ["senior-officer"] "roles": ["senior-officer"]
"roles": ["senior-officer"]
} }
] ]
}, },

View File

@@ -553,7 +553,7 @@
} }
}); });
document.getElementById('penilaian_id').addEventListener('change', function() { document.getElementById('penilai_id').addEventListener('change', function() {
const selectedValue = this.value; const selectedValue = this.value;
const penilaiRegion = document.getElementById('penilaiRegion'); const penilaiRegion = document.getElementById('penilaiRegion');

View File

@@ -0,0 +1,232 @@
{{-- @if ($analisaType == 'tanah_bangunan') --}}
<div class=" bg-white rounded-lg shadow-md overflow-hidden">
<div class="y-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="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="luas_tanah_bagunan" value="tidak sesuai"
{{ old('luas_tanah_bagunan') == 'tidak sesuai' ? 'checked' : '' }}>
<span class="ml-2">Tidak Sesuai</span>
</label>
</div>
@error('luas_tanah_bagunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Jenis Bangunan -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<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('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 }}"
{{ old('jenis_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->jenis_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('jenis_bangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Kondisi Bangunan -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<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('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 }}"
{{ old('kondisi_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kondisi_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('kondisi_bangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Sifat Bangunan -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<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('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 }}"
{{ old('sifat_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->sifat_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@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" 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)
<div>
<label
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('name') border-danger bg-danger-light @enderror"
name="name[]">
<option value="">Select {{ $item->name }}</option>
@foreach ($spekBangunan as $spek)
@if ($spek->spek_kategori_bangunan_id == $item->id)
<option value="{{ $spek->name }}"
{{ old('name') == $spek->name ? 'selected' : '' }}>
{{ $spek->name }}
</option>
@endif
@endforeach
</select>
@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>
<!-- Sarana pelengkap -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<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('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->name }}"
{{ old('sarana_pelengkap', isset($analisa) && optional($analisa->analisaTanahBangunan)->sarana_pelengkap) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('sarana_pelengkap')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
{{-- @endif --}}
@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

@@ -168,21 +168,32 @@
if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') { if ($analisaType === 'unit_rumah' || $analisaType === 'unit_gedung') {
$analisaType = 'unit'; $analisaType = 'unit';
} }
@endphp @endphp
<input type="hidden" name="action" value="{{ $analisaType }}"> <input type="hidden" name="action" value="{{ $analisaType }}">
<input type="hidden" name="type" value="{{ $analisaType }}"> <input type="hidden" name="type" value="{{ $analisaType }}">
@if ($analisaType == 'tanah_bangunan') @if ($analisaType == 'tanah_bangunan')
@include('lpj::surveyor.components.tanah-bangunan') @include('lpj::surveyor.components.tanah')
@elseif($analisaType == 'unit') @elseif($analisaType == 'unit')
@include('lpj::surveyor.components.apartemen-kantor') @include('lpj::surveyor.components.apartemen-kantor')
@elseif($analisaType == 'kendaraan') @elseif($analisaType == 'alat-berat')
@include('lpj::surveyor.components.alat-berat') @include('lpj::surveyor.components.alat-berat')
@elseif($analisaType == 'mesin')
@include('lpj::surveyor.components.mesin')
@elseif($analisaType == 'kapal')
@include('lpj::surveyor.components.kapal')
@elseif($analisaType == 'kendaraan')
@include('lpj::surveyor.components.kendaraan')
@endif @endif
@if($analisaType == 'tanah_bangunan')
@include('lpj::surveyor.components.bangunan')
@endif
<div class=" bg-white rounded-lg shadow-md overflow-hidden"> @if ($analisaType != 'mesin' && $analisaType != 'kapal')
<div class=" bg-white rounded-lg overflow-hidden">
<div class=" text-white py-4 px-6"> <div class=" text-white py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1> <h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1>
</div> </div>
@@ -450,8 +461,9 @@
</div> </div>
</div> </div>
</div> </div>
@endif
<div class=" bg-white rounded-lg shadow-md overflow-hidden"> <div class=" bg-white rounded-lg overflow-hidden">
<div class=" py-4 px-6"> <div class=" py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1> <h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1>
</div> </div>
@@ -476,6 +488,7 @@
</div> </div>
</div> </div>
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Rute Menuju</label> <label class="form-label max-w-56">Rute Menuju</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
@@ -543,11 +556,14 @@
@enderror @enderror
</div> </div>
</div> </div>
@endif
</div> </div>
</div> </div>
<!-- Informasi Tata Ruang -->
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
<div class=""> <div class="">
<!-- Header --> <!-- Header -->
<div class="py-4 px-6"> <div class="py-4 px-6">
@@ -700,7 +716,7 @@
value="{{ old('lat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lat : '') }}"> value="{{ old('lat', isset($analisa->analisaFakta) ? $analisa->analisaFakta->lat : '') }}">
<input type="hidden" name="lng" id="lng" <input type="hidden" name="lng" id="lng"
value="{{ old('lng', isset($analisa->analisaFakta) ? $analisa->analisaFakta->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" <div class=" border p-6 rounded-lg shadow-lg flex items-center justify-center"
style="height: 300px"> style="height: 300px">
<iframe id="mapFrame" frameborder="0" style="width: 100%; height: 100%;"></iframe> <iframe id="mapFrame" frameborder="0" style="width: 100%; height: 100%;"></iframe>
</div> </div>
@@ -742,6 +758,7 @@
</div> </div>
</div> </div>
</div> </div>
@endif
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px"> <div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
<button type="submit" class="btn btn-success"> <button type="submit" class="btn btn-success">

View File

@@ -0,0 +1,488 @@
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</h1>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Hubungan Calon Debitur</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan Hubungan Calon Debitur">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Nama Jalan', 'index' => 0],
['label' => 'Perumahan/Gang', 'index' => 1],
['label' => 'Blok/Nomor', 'index' => 2],
['label' => 'Desa/Kelurahan', 'index' => 3],
['label' => 'Kecamatan', 'index' => 4],
['label' => 'Kota/Kotamadya', 'index' => 5],
['label' => 'Provinsi', 'index' => 6]
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
</div>
</div>
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</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">Jenis</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
name="hadapMataAngin">
<option value="">Select Jenis</option>
@if (isset($arahMataAngin))
@foreach ($arahMataAngin as $item)
<option value="{{ $item->name }}"
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('hadapMataAngin')
<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">Size</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
name="hadapMataAngin">
<option value="">Select Size</option>
@if (isset($arahMataAngin))
@foreach ($arahMataAngin as $item)
<option value="{{ $item->name }}"
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('hadapMataAngin')
<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</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
name="hadapMataAngin">
<option value="">Select Jenis</option>
@if (isset($arahMataAngin))
@foreach ($arahMataAngin as $item)
<option value="{{ $item->name }}"
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('hadapMataAngin')
<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">Klasifikasi</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
name="hadapMataAngin">
<option value="">Select Jenis</option>
@if (isset($arahMataAngin))
@foreach ($arahMataAngin as $item)
<option value="{{ $item->name }}"
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('hadapMataAngin')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@php
$inputDataJaminan = [];
$inputDataJaminan = [
['label' => 'Nama Kapal', 'index' => 0],
['label' => 'Pemilik Kapal', 'index' => 1],
['label' => 'Bendera', 'index' => 2],
['label' => 'Nomor Tanda Selar', 'index' => 3],
['label' => 'Kapal', 'index' => 4],
['label' => 'Galangan', 'index' => 5],
['label' => 'Kapal/Shipyard', 'index' => 6],
['label' => 'Tahun Pembuatan', 'index' => 7],
['label' => 'Tahun Lanuncing', 'index' => 8],
['label' => 'DWT (ton)', 'index' => 9],
['label' => 'LWT (ton)', 'index' => 10],
['label' => 'Gross Tonnage (ton)', 'index' => 11],
['label' => 'Net Tonnage (ton)', 'index' => 12],
['label' => 'Tenaga Mesin (HP)', 'index' => 13],
['label' => 'LOA', 'index' => 14],
['label' => 'LBP', 'index' => 15],
['label' => 'Beam', 'index' => 16],
['label' => 'Depth', 'index' => 17],
['label' => 'Draft', 'index' => 18],
];
@endphp
@if (count($inputDataJaminan) > 0)
@foreach ($inputDataJaminan as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
</div>
<div class="flex justify-end" style="margin-top: 10px">
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
tambah mesin
<i class="ki-filled ki-plus"></i>
</button>
</div>
</div>
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Struktur Kapal</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Lambung Kapal', 'index' => 0],
['label' => 'Dek', 'index' => 1],
['label' => 'Struktur Rangka', 'index' => 2],
['label' => 'Palka', 'index' => 3],
['label' => 'Pondasi Mesin', 'index' => 4],
['label' => 'Area Mesin', 'index' => 5],
['label' => 'Cat dan Korosi', 'index' => 6],
['label' => 'Sistem Pengelasan', 'index' => 7]
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
<div class="flex flex-wrap items-baseline w-full">
<textarea name="deskripsi" id="" class="textarea"></textarea>
@error('deskripsi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
{{-- Peralatan Keselamatan --}}
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Peralatan Keselamatan</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Sekoci/Lifeboat', 'index' => 0],
['label' => 'Jaket Pelampung', 'index' => 1],
['label' => 'Alat Pemadam', 'index' => 2],
['label' => 'Rambu Darurat', 'index' => 3],
['label' => 'Sistem Alarm', 'index' => 4],
['label' => 'Sistem Pencegah', 'index' => 5],
['label' => 'Kebaran', 'index' => 6],
['label' => 'Lampu Darurat', 'index' => 7]
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
<div class="flex flex-wrap items-baseline w-full">
<textarea name="deskripsi" id="" class="textarea"></textarea>
@error('deskripsi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
{{-- Sistwm Navigasi dan Komunikasi --}}
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Sistem Navigasi dan Komunikasi</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Gps', 'index' => 0],
['label' => 'Radat', 'index' => 1],
['label' => 'Radio Komunikasi', 'index' => 2],
['label' => 'Lampu Navigasi', 'index' => 3],
['label' => 'Sistem Kendali otomatis', 'index' => 4],
['label' => 'Kompas', 'index' => 5],
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
<div class="flex flex-wrap items-baseline w-full">
<textarea name="deskripsi" id="" class="textarea"></textarea>
@error('deskripsi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
{{-- Sistwm Mesin dan Penggerak Kapal --}}
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Sistem Mesin dan Penggerak Kapal</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Mesin Utama', 'index' => 0],
['label' => 'Mesin Bantu', 'index' => 1],
['label' => 'Pompa Pendingin', 'index' => 2],
['label' => 'Sistem Pelumasan', 'index' => 3],
['label' => 'Propeller', 'index' => 4],
['label' => 'Sistem Kelistrikan', 'index' => 5],
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
<div class="flex flex-wrap items-baseline w-full">
<textarea name="deskripsi" id="" class="textarea"></textarea>
@error('deskripsi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
{{-- Sistwm kelistrikan dan Elektronik --}}
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Sistem Kelistrikan dan Elektronik</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Lampu Navigasi', 'index' => 0],
['label' => 'Sistem Penerangan', 'index' => 1],
['label' => 'Sistem Panel Distribusi', 'index' => 2],
['label' => 'Kabel dan Perangkat Pendukung', 'index' => 3],
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
<div class="flex flex-wrap items-baseline w-full">
<textarea name="deskripsi" id="" class="textarea"></textarea>
@error('deskripsi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
{{-- Linkungan dan Kebersihan Kapal --}}
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Linkungan dan Kebersihan Kapal</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Kebersihan Dek Luar', 'index' => 0],
['label' => 'Tangki Limbah', 'index' => 1],
['label' => 'Sistem Pengelolaan Limbah', 'index' => 2],
['label' => 'Pengelolaan Air Ballast', 'index' => 3],
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
<div class="flex flex-wrap items-baseline w-full">
<textarea name="deskripsi" id="" class="textarea"></textarea>
@error('deskripsi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,160 @@
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Order Penilaian</h1>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tanggal Survey</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="date" name="tanggal_survey" class="input" placeholder="Masukkan Hubungan Calon Debitur">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</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">Nama Wakil Debitur</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input" placeholder="Masukkan Hubungan Calon Debitur">
@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">Hubungan Calon Debitur</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input" placeholder="Masukkan Hubungan Calon Debitur">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Nama Jalan', 'index' => 0],
['label' => 'Perumahan/Gang', 'index' => 1],
['label' => 'Blok/Nomor', 'index' => 2],
['label' => 'Desa/Kelurahan', 'index' => 3],
['label' => 'Kecamatan', 'index' => 4],
['label' => 'Kota/Kotamadya', 'index' => 5],
['label' => 'Provinsi', 'index' => 6],
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
</div>
</div>
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</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">BPKB</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="tanggal_survey" class="input" placeholder="BPKP">
@error('hadapMataAngin')
<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">STNK</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="tanggal_survey" class="input" placeholder="STNK">
@error('hadapMataAngin')
<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">Deskripsi kendaraan sesuai dokument</label>
<div class="flex flex-wrap items-baseline w-full">
@error('hadapMataAngin')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@php
$inputDataJaminan = [];
$inputDataJaminan = [
['label' => 'Tipe/Model', 'index' => 0],
['label' => 'Merek', 'index' => 1],
['label' => 'Tahun Pembuatan', 'index' => 2],
['label' => 'Negara Pembuat', 'index' => 3],
['label' => 'Kondisi Mesin', 'index' => 4],
];
@endphp
@if (count($inputDataJaminan) > 0)
@foreach ($inputDataJaminan as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
<div class="flex flex-wrap items-baseline w-full">
<textarea name="deskripsi" id="" class="textarea"></textarea>
@error('deskripsi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,133 @@
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Identitas Debitur</h1>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Hubungan Calon Debitur</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan Hubungan Calon Debitur">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Lokasi Jaminan</h1>
</div>
<div class="grid gap-5">
@php
$inputDataLoaksi = [];
$inputDataLoaksi = [
['label' => 'Nama Jalan', 'index' => 0],
['label' => 'Perumahan/Gang', 'index' => 1],
['label' => 'Blok/Nomor', 'index' => 2],
['label' => 'Desa/Kelurahan', 'index' => 3],
['label' => 'Kecamatan', 'index' => 4],
['label' => 'Kota/Kotamadya', 'index' => 5],
['label' => 'Provinsi', 'index' => 6]
];
@endphp
@if (count($inputDataLoaksi) > 0)
@foreach ($inputDataLoaksi as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
</div>
</div>
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
<div class="py-4 px-6">
<h1 class="text-md font-medium text-gray-900">Data Data Jaminan</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">Model</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('hadapMataAngin') border-danger bg-danger-light @enderror"
name="hadapMataAngin">
<option value="">Select Model Kendaraan </option>
@if (isset($arahMataAngin))
@foreach ($arahMataAngin as $item)
<option value="{{ $item->name }}"
{{ old('hadapMataAngin') == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('hadapMataAngin')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@php
$inputDataJaminan = [];
$inputDataJaminan = [
['label' => 'Tipe/Model', 'index' => 0],
['label' => 'Merek', 'index' => 1],
['label' => 'Tahun Pembuatan', 'index' => 2],
['label' => 'Negara Pembuat', 'index' => 3],
['label' => 'Kondisi Mesin', 'index' => 4],
];
@endphp
@if (count($inputDataJaminan) > 0)
@foreach ($inputDataJaminan as $item)
<!-- Nomor Lambung -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">{{ $item['label'] }}</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" name="bentuk_tanah" class="input"
placeholder="Masukkan {{ $item['label'] }}">
@error('bentuk_tanah')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
@endforeach
@endif
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
<div class="flex flex-wrap items-baseline w-full">
<textarea name="deskripsi" id="" class="textarea"></textarea>
@error('deskripsi')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
<div class="flex justify-end" style="margin-top: 10px">
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
tambah mesin
<i class="ki-filled ki-plus"></i>
</button>
</div>
</div>

View File

@@ -246,235 +246,3 @@
</div> </div>
</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="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="luas_tanah_bagunan" value="tidak sesuai"
{{ old('luas_tanah_bagunan') == 'tidak sesuai' ? 'checked' : '' }}>
<span class="ml-2">Tidak Sesuai</span>
</label>
</div>
@error('luas_tanah_bagunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Jenis Bangunan -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<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('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 }}"
{{ old('jenis_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->jenis_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('jenis_bangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Kondisi Bangunan -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<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('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 }}"
{{ old('kondisi_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->kondisi_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('kondisi_bangunan')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<!-- Sifat Bangunan -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<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('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 }}"
{{ old('sifat_bangunan', isset($analisa) && optional($analisa->analisaTanahBangunan)->sifat_bangunan) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@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" 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)
<div>
<label
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('name') border-danger bg-danger-light @enderror"
name="name[]">
<option value="">Select {{ $item->name }}</option>
@foreach ($spekBangunan as $spek)
@if ($spek->spek_kategori_bangunan_id == $item->id)
<option value="{{ $spek->name }}"
{{ old('name') == $spek->name ? 'selected' : '' }}>
{{ $spek->name }}
</option>
@endif
@endforeach
</select>
@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>
<!-- Sarana pelengkap -->
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<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('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->name }}"
{{ old('sarana_pelengkap', isset($analisa) && optional($analisa->analisaTanahBangunan)->sarana_pelengkap) == $item->name ? 'selected' : '' }}>{{ $item->name }}
</option>
@endforeach
@endif
</select>
@error('sarana_pelengkap')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
@endif
@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

@@ -437,6 +437,7 @@ Route::middleware(['auth'])->group(function () {
Route::get('restore/{id}', [ActivityController::class, 'restore'])->name('restore'); Route::get('restore/{id}', [ActivityController::class, 'restore'])->name('restore');
Route::get('datatables', [ActivityController::class, 'dataForDatatables'])->name('datatables'); Route::get('datatables', [ActivityController::class, 'dataForDatatables'])->name('datatables');
Route::get('export', [ActivityController::class, 'export'])->name('export'); Route::get('export', [ActivityController::class, 'export'])->name('export');
Route::get('/', [ActivityController::class, 'index'])->name('index'); Route::get('/', [ActivityController::class, 'index'])->name('index');
Route::get('/{id}/show', [ActivityController::class, 'show'])->name('show'); Route::get('/{id}/show', [ActivityController::class, 'show'])->name('show');