Merge remote-tracking branch 'composer/feature/senior-officer' into staging
This commit is contained in:
@@ -30,43 +30,43 @@ class ActivityController extends Controller
|
||||
*/
|
||||
|
||||
|
||||
public function progres_activity()
|
||||
{
|
||||
// Ambil user yang sedang login
|
||||
$user = auth()->user();
|
||||
$roles = $user->load('roles');
|
||||
public function progres_activity()
|
||||
{
|
||||
// Ambil user yang sedang login
|
||||
$user = auth()->user();
|
||||
$roles = $user->load('roles');
|
||||
|
||||
// Inisialisasi regionId dan teamId sebagai null agar bisa dinamis
|
||||
$regionId = null;
|
||||
$teamId = null;
|
||||
// Inisialisasi regionId dan teamId sebagai null agar bisa dinamis
|
||||
$regionId = null;
|
||||
$teamId = null;
|
||||
|
||||
if ($roles->roles->pluck('name')->contains('senior-officer')) {
|
||||
$userTeam = TeamsUsers::with('team')
|
||||
->where('user_id', $user->id)
|
||||
->first();
|
||||
$regionId = $userTeam?->team->regions_id;
|
||||
$teamId = $userTeam?->teams_id;
|
||||
if ($roles->roles->pluck('name')->contains('senior-officer')) {
|
||||
$userTeam = TeamsUsers::with('team')
|
||||
->where('user_id', $user->id)
|
||||
->first();
|
||||
$regionId = $userTeam?->team->regions_id;
|
||||
$teamId = $userTeam?->teams_id;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions', 'user.roles'])
|
||||
->whereHas('team', function ($q) use ($regionId, $teamId) {
|
||||
if ($regionId) {
|
||||
$q->where('regions_id', $regionId);
|
||||
}
|
||||
if ($teamId) {
|
||||
$q->where('id', $teamId); // Hanya tim yang sama
|
||||
}
|
||||
})
|
||||
->where('user_id', '!=', $user->id)
|
||||
->whereHas('user.roles', function ($query) {
|
||||
// Filter hanya peran 'surveyor' atau 'surveyor-penilai'
|
||||
$query->whereIn('name', ['surveyor', 'surveyor-penilai']);
|
||||
})
|
||||
->get();
|
||||
$teamsActivity = TeamsUsers::with(['user', 'team', 'team.regions', 'user.roles'])
|
||||
->whereHas('team', function ($q) use ($regionId, $teamId) {
|
||||
if ($regionId) {
|
||||
$q->where('regions_id', $regionId);
|
||||
}
|
||||
if ($teamId) {
|
||||
$q->where('id', $teamId); // Hanya tim yang sama
|
||||
}
|
||||
})
|
||||
->where('user_id', '!=', $user->id)
|
||||
->whereHas('user.roles', function ($query) {
|
||||
// Filter hanya peran 'surveyor' atau 'surveyor-penilai'
|
||||
$query->whereIn('name', ['surveyor', 'surveyor-penilai']);
|
||||
})
|
||||
->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.
|
||||
*/public function dataForDatatables(Request $request)
|
||||
{
|
||||
|
||||
$user = auth()->user();
|
||||
|
||||
|
||||
// Check permissions
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
@@ -170,7 +174,23 @@ class ActivityController extends Controller
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// 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
|
||||
$pageCount = ceil($totalRecords / $request->get('size', 10));
|
||||
|
||||
@@ -67,7 +67,13 @@ class PenilaianController extends Controller
|
||||
} else {
|
||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi)->first();
|
||||
$teams_ids[] = $validatedData['teams_id'];
|
||||
$user_ids[] = $validatedData['surveyor_id'];
|
||||
|
||||
if (isset($validatedData['penilai_surveyor_id'])) {
|
||||
$user_ids[] = $validatedData['penilai_surveyor_id'];
|
||||
} else {
|
||||
$user_ids[] = $validatedData['surveyor_id'];
|
||||
}
|
||||
|
||||
$roles[] = 'surveyor';
|
||||
|
||||
}
|
||||
@@ -89,7 +95,13 @@ class PenilaianController extends Controller
|
||||
} else {
|
||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi)->first();
|
||||
$teams_ids[] = $validatedData['teams_id'];
|
||||
$user_ids[] = $validatedData['penilai_id'];
|
||||
|
||||
if (isset($validatedData['penilai_surveyor_id'])) {
|
||||
$user_ids[] = $validatedData['penilai_surveyor_id'];
|
||||
}else {
|
||||
$user_ids[] = $validatedData['penilai_id'];
|
||||
}
|
||||
|
||||
$roles[] = 'penilai';
|
||||
|
||||
}
|
||||
@@ -118,7 +130,7 @@ class PenilaianController extends Controller
|
||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
return response()->json(array('error' => $e->getMessage()));
|
||||
return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,7 +182,7 @@ class PenilaianController extends Controller
|
||||
return redirect()->route('penilaian.index')->with('success', 'Penilaian berhasil disimpan');
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
return response()->json(array('error' => $e->getMessage()));
|
||||
return redirect()->route('penilaian.index')->with('error', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -711,7 +711,8 @@ class SurveyorController extends Controller
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
|
||||
$type = $request->route('type');
|
||||
try {
|
||||
$type = $request->route('type');
|
||||
|
||||
$modelClass = $this->getModelClass($type);
|
||||
|
||||
@@ -733,6 +734,14 @@ class SurveyorController extends Controller
|
||||
return redirect()
|
||||
->route('basicdata.' . $type .'.index')
|
||||
->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)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$permohonan = Permohonan::find($id);
|
||||
$permohonan->update([
|
||||
'status' => 'done',
|
||||
@@ -978,6 +987,7 @@ class SurveyorController extends Controller
|
||||
'tingkat-keramaian' => TingkatKeramaian::class,
|
||||
'gol-mas-sekitar' => GolonganMasySekitar::class,
|
||||
'spek-kategori-bangunan' => SpekKategoritBangunan::class,
|
||||
'spek-bangunan' => SpekBangunan::class,
|
||||
'lantai-unit' => Lantai::class,
|
||||
'view-unit' => ViewUnit::class,
|
||||
];
|
||||
|
||||
@@ -34,6 +34,7 @@ class TeamsController extends Controller
|
||||
{
|
||||
|
||||
$regionTeam = Teams::pluck('regions_id')->toArray();
|
||||
|
||||
$regions = Regions::whereNotIn('id', $regionTeam)->get();
|
||||
|
||||
$userTeam = TeamsUsers::pluck('user_id')->toArray();
|
||||
@@ -47,8 +48,6 @@ class TeamsController extends Controller
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
return view('lpj::teams.form', compact('regions', 'user'));
|
||||
}
|
||||
|
||||
@@ -103,7 +102,7 @@ class TeamsController extends Controller
|
||||
{
|
||||
$teams = Teams::find($id);
|
||||
|
||||
$region = Regions::all();
|
||||
$regions = Regions::all();
|
||||
$usedUsers = TeamsUsers::where('teams_id', '!=', $id)->pluck('user_id')->toArray();
|
||||
$usersWithRole = User::whereNotIn('id', $usedUsers)
|
||||
->with('roles')
|
||||
@@ -119,7 +118,7 @@ class TeamsController extends Controller
|
||||
// Ambil user yang sudah ada di tim ini
|
||||
$selectedUsers = $teams->teamsUsers->pluck('user_id')->toArray();
|
||||
|
||||
return view('lpj::teams.form', compact('teams', 'region', 'user', 'selectedUsers'));
|
||||
return view('lpj::teams.form', compact('teams', 'regions', 'user', 'selectedUsers'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,14 +33,16 @@ class PenilaianRequest extends FormRequest
|
||||
'tanggal_kunjungan' => 'required|max:255',
|
||||
'status' => 'required|string',
|
||||
'nomor_registrasi' => 'required|string',
|
||||
'surveyor_id' => 'nullable| required_without:penilai_surveyor_id',
|
||||
'penilai_id' => 'nullable|required_without:penilai_surveyor_id',
|
||||
'penilai_surveyor_id' => 'nullable|required_without_all:surveyor_id,penilai_id',
|
||||
'surveyor_region_id' => 'nullable|required_without:surveyor_id',
|
||||
'penilai_region_id' => 'nullable|required_without:penilai_id',
|
||||
|
||||
'surveyor_id' => 'nullable|required_without_all:penilai_surveyor_id,surveyor_region_id,penilai_region_id,penilai_id',
|
||||
'penilai_id' => 'nullable|required_without_all:penilai_surveyor_id,surveyor_region_id,penilai_region_id,surveyor_id',
|
||||
'penilai_surveyor_id' => 'nullable',
|
||||
'surveyor_region_id' => 'nullable|required_without_all:penilai_surveyor_id,penilai_region_id,penilai_id,surveyor_id',
|
||||
'penilai_region_id' => 'nullable|required_without_all:penilai_surveyor_id,surveyor_region_id,penilai_id,surveyor_id',
|
||||
|
||||
'keterangan' => 'nullable',
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -70,7 +70,8 @@ class SurveyorRequest extends FormRequest
|
||||
return match ($action) {
|
||||
'spek-bangunan' => [
|
||||
'spek_kategori_bangunan_id' => [
|
||||
'required'
|
||||
'required',
|
||||
|
||||
],
|
||||
],
|
||||
// Add more action specific rules here
|
||||
|
||||
@@ -17,7 +17,7 @@ class Penilaian extends Model
|
||||
*/
|
||||
protected $table = 'penilaian';
|
||||
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',
|
||||
'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');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class PenilaianTeam extends Model
|
||||
|
||||
public function penilaian(){
|
||||
|
||||
return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id');
|
||||
return $this->hasMany(Penilaian::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): PenilaianTeamFactory
|
||||
|
||||
@@ -553,7 +553,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('penilaian_id').addEventListener('change', function() {
|
||||
document.getElementById('penilai_id').addEventListener('change', function() {
|
||||
const selectedValue = this.value;
|
||||
const penilaiRegion = document.getElementById('penilaiRegion');
|
||||
|
||||
|
||||
232
resources/views/surveyor/components/bangunan.blade.php
Normal file
232
resources/views/surveyor/components/bangunan.blade.php
Normal 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
|
||||
@@ -168,21 +168,32 @@
|
||||
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')
|
||||
@include('lpj::surveyor.components.tanah')
|
||||
@elseif($analisaType == 'unit')
|
||||
@include('lpj::surveyor.components.apartemen-kantor')
|
||||
@elseif($analisaType == 'kendaraan')
|
||||
@elseif($analisaType == '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
|
||||
|
||||
@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">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisis Lingkungan</h1>
|
||||
</div>
|
||||
@@ -450,8 +461,9 @@
|
||||
</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">
|
||||
<h1 class="text-md font-medium text-gray-900">Analisis Fakta</h1>
|
||||
</div>
|
||||
@@ -476,6 +488,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
|
||||
<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">
|
||||
@@ -543,11 +556,14 @@
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Informasi Tata Ruang -->
|
||||
@if ($analisaType != 'mesin' && $analisaType != 'kapal')
|
||||
|
||||
<div class="">
|
||||
<!-- Header -->
|
||||
<div class="py-4 px-6">
|
||||
@@ -700,7 +716,7 @@
|
||||
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"
|
||||
<div class=" 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>
|
||||
@@ -742,6 +758,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="submit" class="btn btn-success">
|
||||
|
||||
488
resources/views/surveyor/components/kapal.blade.php
Normal file
488
resources/views/surveyor/components/kapal.blade.php
Normal 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>
|
||||
160
resources/views/surveyor/components/kendaraan.blade.php
Normal file
160
resources/views/surveyor/components/kendaraan.blade.php
Normal 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>
|
||||
133
resources/views/surveyor/components/mesin.blade.php
Normal file
133
resources/views/surveyor/components/mesin.blade.php
Normal 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>
|
||||
|
||||
|
||||
|
||||
@@ -246,235 +246,3 @@
|
||||
</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
|
||||
@@ -232,9 +232,6 @@
|
||||
title: 'Action',
|
||||
render: (item, data) => `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<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?form=inspeksi">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
|
||||
@@ -61,14 +61,14 @@
|
||||
class="input tomselect w-full @error('regions_id') border-danger bg-danger-light @enderror"
|
||||
name="regions_id">
|
||||
<option value="">Select Region</option>
|
||||
@if (isset($region))
|
||||
@foreach ($region as $regions)
|
||||
@if (isset($regions))
|
||||
@foreach ($regions as $region)
|
||||
@if (isset($teams))
|
||||
<option value="{{ $regions->id }}"
|
||||
{{ $teams->regions_id == $regions->id ? 'selected' : '' }}>
|
||||
{{ $regions->name }}</option>
|
||||
<option value="{{ $region->id }}"
|
||||
{{ $teams->regions_id == $region->id ? 'selected' : '' }}>
|
||||
{{ $region->name }}</option>
|
||||
@else
|
||||
<option value="{{ $regions->id }}">{{ $regions->name }}</option>
|
||||
<option value="{{ $region->id }}">{{ $region->name }}</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@@ -424,6 +424,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('restore/{id}', [ActivityController::class, 'restore'])->name('restore');
|
||||
Route::get('datatables', [ActivityController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [ActivityController::class, 'export'])->name('export');
|
||||
|
||||
Route::get('/', [ActivityController::class, 'index'])->name('index');
|
||||
|
||||
Route::get('/{id}/show', [ActivityController::class, 'show'])->name('show');
|
||||
|
||||
Reference in New Issue
Block a user