Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into andydev
This commit is contained in:
@@ -217,7 +217,7 @@ class SurveyorController extends Controller
|
|||||||
try {
|
try {
|
||||||
$maxSize = getMaxFileSize('Foto');
|
$maxSize = getMaxFileSize('Foto');
|
||||||
$validatedData = $request->validate([
|
$validatedData = $request->validate([
|
||||||
'foto_denah' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:'. $maxSize,
|
'foto_denah' => 'required|file|mimes:jpeg,jpg,png,pdf,svg|max:'. $maxSize,
|
||||||
'luas' => 'required|numeric',
|
'luas' => 'required|numeric',
|
||||||
'permohonan_id' => 'required',
|
'permohonan_id' => 'required',
|
||||||
'jenis_jaminan_id' => 'required'
|
'jenis_jaminan_id' => 'required'
|
||||||
@@ -718,10 +718,8 @@ class SurveyorController extends Controller
|
|||||||
|
|
||||||
$branches = Branch::all();
|
$branches = Branch::all();
|
||||||
$provinces = Province::all();
|
$provinces = Province::all();
|
||||||
$debitur = Debiture::find($permohonan->debiture_id);
|
|
||||||
$cities = City::where('province_code', $debitur->province_code)->get();
|
|
||||||
$districts = District::where('city_code', $debitur->city_code)->get();
|
|
||||||
$villages = Village::where('district_code', $debitur->district_code)->get();
|
|
||||||
|
|
||||||
$surveyor = $id;
|
$surveyor = $id;
|
||||||
$basicData = $this->getCommonData();
|
$basicData = $this->getCommonData();
|
||||||
@@ -731,6 +729,28 @@ class SurveyorController extends Controller
|
|||||||
if ($inpeksi) {
|
if ($inpeksi) {
|
||||||
$forminspeksi = json_decode($inpeksi->data_form, true);
|
$forminspeksi = json_decode($inpeksi->data_form, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Default: gunakan data dari debitur
|
||||||
|
$debitur = Debiture::find($permohonan->debiture_id);
|
||||||
|
|
||||||
|
$provinceCode = $debitur->province_code;
|
||||||
|
$cityCode = $debitur->city_code;
|
||||||
|
$districtCode = $debitur->district_code;
|
||||||
|
|
||||||
|
// Jika alamat tidak sesuai, override dengan kode dari alamat
|
||||||
|
|
||||||
|
$cekAlamat = $forminspeksi['asset']['alamat']['tidak sesuai'] ?? null;
|
||||||
|
|
||||||
|
if ($cekAlamat) {
|
||||||
|
$provinceCode = $cekAlamat['province_code'] ?? $provinceCode;
|
||||||
|
$cityCode = $cekAlamat['city_code'] ?? $cityCode;
|
||||||
|
$districtCode = $cekAlamat['district_code'] ?? $districtCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ambil data menggunakan kode yang telah ditentukan
|
||||||
|
$cities = City::where('province_code', $provinceCode)->get();
|
||||||
|
$districts = District::where('city_code', $cityCode)->get();
|
||||||
|
$villages = Village::where('district_code', $districtCode)->get();
|
||||||
return view('lpj::surveyor.components.inspeksi', compact(
|
return view('lpj::surveyor.components.inspeksi', compact(
|
||||||
'permohonan',
|
'permohonan',
|
||||||
'surveyor',
|
'surveyor',
|
||||||
@@ -742,7 +762,8 @@ class SurveyorController extends Controller
|
|||||||
'villages',
|
'villages',
|
||||||
'link_url_region',
|
'link_url_region',
|
||||||
'forminspeksi',
|
'forminspeksi',
|
||||||
'basicData'
|
'basicData',
|
||||||
|
'cekAlamat'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -822,7 +843,7 @@ class SurveyorController extends Controller
|
|||||||
|
|
||||||
$inspectionData = json_decode($inspeksi->data_form, true);
|
$inspectionData = json_decode($inspeksi->data_form, true);
|
||||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||||
throw new \Exception('Error decoding inspection data: ' . json_last_error_msg());
|
throw new \Exception('Harap mengisi form inspeksi terlebih dahulu.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($inspeksi->data_pembanding) {
|
if ($inspeksi->data_pembanding) {
|
||||||
@@ -868,7 +889,8 @@ class SurveyorController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getCodeAlamat($code, $inspectionData){
|
public function getCodeAlamat($code, $inspectionData)
|
||||||
|
{
|
||||||
$cekAlamat = isset(
|
$cekAlamat = isset(
|
||||||
$inspectionData['asset']['alamat']['sesuai'],
|
$inspectionData['asset']['alamat']['sesuai'],
|
||||||
)
|
)
|
||||||
@@ -1443,18 +1465,10 @@ class SurveyorController extends Controller
|
|||||||
$data['alamat_sesuai'] => $alamatData
|
$data['alamat_sesuai'] => $alamatData
|
||||||
],
|
],
|
||||||
'hub_cadeb' => [
|
'hub_cadeb' => [
|
||||||
$data['hub_cadeb'] => $this->getFieldData(
|
$data['hub_cadeb'] => ($data['hub_cadeb'] == 'sesuai') ? $data['hub_cadeb_sesuai'] : $data['hub_cadeb_tidak_sesuai']
|
||||||
$data,
|
|
||||||
'hub_cadeb',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
'hub_cadeb_penghuni' => [
|
'hub_cadeb_penghuni' => [
|
||||||
$data['hub_cadeb_penghuni'] => $this->getFieldData(
|
$data['hub_cadeb_penghuni'] => ($data['hub_cadeb_penghuni'] == 'sesuai') ? $data['hub_cadeb_penghuni_sesuai'] : $data['hub_penghuni_tidak_sesuai']
|
||||||
$data,
|
|
||||||
'hub_cadeb_penghuni',
|
|
||||||
true
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
|
|
||||||
'kordinat_lng' => $data['kordinat_lng'] ?? null,
|
'kordinat_lng' => $data['kordinat_lng'] ?? null,
|
||||||
@@ -1473,11 +1487,9 @@ class SurveyorController extends Controller
|
|||||||
'luas_tanah',
|
'luas_tanah',
|
||||||
true
|
true
|
||||||
),
|
),
|
||||||
'hadap_mata_angin' => $this->getFieldData(
|
'hadap_mata_angin' => [
|
||||||
$data,
|
$data['hadap_mata_angin'] => ($data['hadap_mata_angin'] == 'sesuai') ? $data['hadap_mata_angin_sesuai'] : $data['hadap_mata_angin_tidak_sesuai']
|
||||||
'hadap_mata_angin',
|
],
|
||||||
true
|
|
||||||
),
|
|
||||||
'bentuk_tanah' => $this->getFieldData(
|
'bentuk_tanah' => $this->getFieldData(
|
||||||
$data,
|
$data,
|
||||||
'bentuk_tanah',
|
'bentuk_tanah',
|
||||||
@@ -1486,7 +1498,7 @@ class SurveyorController extends Controller
|
|||||||
),
|
),
|
||||||
'kontur_tanah' => $data['kontur_tanah'] ?? [],
|
'kontur_tanah' => $data['kontur_tanah'] ?? [],
|
||||||
'ketinggian_tanah' => [
|
'ketinggian_tanah' => [
|
||||||
'ketinggian' => $data['kontur_tanah'] ?? null,
|
'ketinggian' => $data['ketinggian_jalan'] ?? null,
|
||||||
'lebih_tinggi' => $data['ketinggian_lebih_tinggi'] ?? null,
|
'lebih_tinggi' => $data['ketinggian_lebih_tinggi'] ?? null,
|
||||||
'lebih_rendah' => $data['ketinggian_lebih_rendah'] ?? null
|
'lebih_rendah' => $data['ketinggian_lebih_rendah'] ?? null
|
||||||
],
|
],
|
||||||
@@ -1518,7 +1530,9 @@ class SurveyorController extends Controller
|
|||||||
|
|
||||||
|
|
||||||
foreach ($request->input('nama_bangunan') as $index => $buildingName) {
|
foreach ($request->input('nama_bangunan') as $index => $buildingName) {
|
||||||
if (empty($buildingName)) continue; // Skip if building name is empty
|
if (empty($buildingName)) {
|
||||||
|
continue;
|
||||||
|
} // Skip if building name is empty
|
||||||
|
|
||||||
$buildingData = [];
|
$buildingData = [];
|
||||||
$buildingData['bagunan'] = $buildingName;
|
$buildingData['bagunan'] = $buildingName;
|
||||||
@@ -1528,7 +1542,9 @@ class SurveyorController extends Controller
|
|||||||
|
|
||||||
if (!empty($specCategories)) {
|
if (!empty($specCategories)) {
|
||||||
foreach ($specCategories as $category) {
|
foreach ($specCategories as $category) {
|
||||||
if (empty($category)) continue; // Skip empty categories
|
if (empty($category)) {
|
||||||
|
continue;
|
||||||
|
} // Skip empty categories
|
||||||
|
|
||||||
$specs = $request->input("spek_bangunan.{$index}.{$category}", []);
|
$specs = $request->input("spek_bangunan.{$index}.{$category}", []);
|
||||||
|
|
||||||
@@ -1575,17 +1591,27 @@ class SurveyorController extends Controller
|
|||||||
'jarak_cbd_point' => $data['jarak_cbd_point'] ?? null,
|
'jarak_cbd_point' => $data['jarak_cbd_point'] ?? null,
|
||||||
'nama_cbd_point' => $data['nama_cbd_point'] ?? null,
|
'nama_cbd_point' => $data['nama_cbd_point'] ?? null,
|
||||||
'lebar_perkerasan_jalan' => $data['lebar_perkerasan_jalan'] ?? null,
|
'lebar_perkerasan_jalan' => $data['lebar_perkerasan_jalan'] ?? null,
|
||||||
'perkerasan_jalan' => $data['perkerasan_jalan'] ?? null,
|
'perkerasan_jalan' => $this->getFieldData(
|
||||||
|
$data,
|
||||||
|
'perkerasan_jalan',
|
||||||
|
false,
|
||||||
|
'lainnya'
|
||||||
|
),
|
||||||
'lalu_lintas' => $data['lalu_lintas'] ?? null,
|
'lalu_lintas' => $data['lalu_lintas'] ?? null,
|
||||||
'gol_mas_sekitar' => $data['gol_mas_sekitar'] ?? null,
|
'gol_mas_sekitar' => $data['gol_mas_sekitar'] ?? null,
|
||||||
'tingkat_keramaian' => $data['tingkat_keramaian'] ?? null,
|
'tingkat_keramaian' => $data['tingkat_keramaian'] ?? null,
|
||||||
'terletak_diarea' => $data['terletak_diarea'] ?? null,
|
'terletak_diarea' => $this->getFieldData(
|
||||||
|
$data,
|
||||||
|
'terletak_diarea',
|
||||||
|
false,
|
||||||
|
'lainnya'
|
||||||
|
),
|
||||||
'disekitar_lokasi' => $data['disekitar_lokasi'] === 'yes' ? [
|
'disekitar_lokasi' => $data['disekitar_lokasi'] === 'yes' ? [
|
||||||
'kondisi' => $data['kondisi_bagunan_disekitar_lokasi'] ?? null,
|
'kondisi' => $data['kondisi_bagunan_disekitar_lokasi'] ?? null,
|
||||||
'sifat' => $data['sifat_bagunan_disekitar_lokasi'] ?? null,
|
'sifat' => $data['sifat_bagunan_disekitar_lokasi'] ?? null,
|
||||||
] : $data['disekitar_lokasi'],
|
] : $data['disekitar_lokasi'],
|
||||||
'kondisi_bangunan_sekitar' => $data['kondisi_bangunan_sekitar'] ?? null,
|
'kondisi_bagunan_disekitar_lokasi' => $data['kondisi_bagunan_disekitar_lokasi'] ?? null,
|
||||||
'sifat_bangunan_sekitar' => $data['sifat_bangunan_sekitar'] ?? null,
|
'sifat_bagunan_disekitar_lokasi' => $data['sifat_bagunan_disekitar_lokasi'] ?? null,
|
||||||
'dekat_makam' => $data['dekat_makam'] ?? null,
|
'dekat_makam' => $data['dekat_makam'] ?? null,
|
||||||
'jarak_makam' => $data['jarak_makam'] ?? null,
|
'jarak_makam' => $data['jarak_makam'] ?? null,
|
||||||
'nama_makam' => $data['nama_makam'] ?? null,
|
'nama_makam' => $data['nama_makam'] ?? null,
|
||||||
@@ -1593,7 +1619,12 @@ class SurveyorController extends Controller
|
|||||||
'jarak_tps' => $data['jarak_tps'] ?? null,
|
'jarak_tps' => $data['jarak_tps'] ?? null,
|
||||||
'nama_tps' => $data['nama_tps'] ?? null,
|
'nama_tps' => $data['nama_tps'] ?? null,
|
||||||
'merupakan_daerah' => $data['merupakan_daerah'] ?? null,
|
'merupakan_daerah' => $data['merupakan_daerah'] ?? null,
|
||||||
'fasilitas_dekat_object' => $data['fasilitas_dekat_object'] ?? null,
|
'fasilitas_dekat_object' => $this->getFieldData(
|
||||||
|
$data,
|
||||||
|
'fasilitas_dekat_object',
|
||||||
|
false,
|
||||||
|
'lainnya'
|
||||||
|
),
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ class FormSurveyorRequest extends FormRequest
|
|||||||
'tusuk_sate' => 'required',
|
'tusuk_sate' => 'required',
|
||||||
'lockland' => 'required',
|
'lockland' => 'required',
|
||||||
'kondisi_fisik_tanah' => 'required|array',
|
'kondisi_fisik_tanah' => 'required|array',
|
||||||
|
'ketinggian_lebih_tinggi' => 'nullable',
|
||||||
|
'ketinggian_lebih_rendah' => 'nullable',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,12 +149,14 @@ class FormSurveyorRequest extends FormRequest
|
|||||||
'jarak_cbd_point' => 'nullable',
|
'jarak_cbd_point' => 'nullable',
|
||||||
'nama_cbd_point' => 'nullable',
|
'nama_cbd_point' => 'nullable',
|
||||||
'lebar_perkerasan_jalan' => 'nullable',
|
'lebar_perkerasan_jalan' => 'nullable',
|
||||||
'perkerasan_jalan.*' => 'nullable',
|
'perkerasan_jalan' => 'nullable|array',
|
||||||
|
'perkerasan_jalan_lainnya' => 'nullable',
|
||||||
'lalu_lintas' => 'nullable',
|
'lalu_lintas' => 'nullable',
|
||||||
'gol_mas_sekitar' => 'nullable',
|
'gol_mas_sekitar' => 'nullable',
|
||||||
'tingkat_keramaian' => 'nullable',
|
'tingkat_keramaian' => 'nullable',
|
||||||
'terletak_diarea' => 'nullable',
|
'terletak_diarea' => 'nullable',
|
||||||
'disekitar_lokasi' => 'nullable',
|
'terletak_diarea_lainnya' => 'nullable',
|
||||||
|
'disekitar_lokasi' => 'required',
|
||||||
'kondisi_bagunan_disekitar_lokasi' => 'nullable',
|
'kondisi_bagunan_disekitar_lokasi' => 'nullable',
|
||||||
'sifat_bagunan_disekitar_lokasi' => 'nullable',
|
'sifat_bagunan_disekitar_lokasi' => 'nullable',
|
||||||
'dekat_makam' => 'nullable',
|
'dekat_makam' => 'nullable',
|
||||||
@@ -162,7 +166,8 @@ class FormSurveyorRequest extends FormRequest
|
|||||||
'jarak_tps' => 'nullable',
|
'jarak_tps' => 'nullable',
|
||||||
'nama_tpu' => 'nullable',
|
'nama_tpu' => 'nullable',
|
||||||
'merupakan_daerah' => 'nullable',
|
'merupakan_daerah' => 'nullable',
|
||||||
'fasilitas_dekat_object' => 'nullable',
|
'fasilitas_dekat_object' => 'nullable|array',
|
||||||
|
'fasilitas_dekat_object_lainnya' => 'nullable',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -530,7 +535,7 @@ class FormSurveyorRequest extends FormRequest
|
|||||||
'hub_cadeb_tidak_sesuai' => 'nullable',
|
'hub_cadeb_tidak_sesuai' => 'nullable',
|
||||||
'hub_cadeb_penghuni' => 'required',
|
'hub_cadeb_penghuni' => 'required',
|
||||||
'hub_cadeb_penghuni_sesuai' => 'nullable',
|
'hub_cadeb_penghuni_sesuai' => 'nullable',
|
||||||
'hub_cadeb_penghuni_tidak_sesuai' => 'nullable',
|
'hub_penghuni_tidak_sesuai' => 'nullable',
|
||||||
|
|
||||||
'address' => 'nullable',
|
'address' => 'nullable',
|
||||||
'village_code' => 'nullable',
|
'village_code' => 'nullable',
|
||||||
@@ -557,7 +562,7 @@ class FormSurveyorRequest extends FormRequest
|
|||||||
'batas_batas_input' => 'nullable|array',
|
'batas_batas_input' => 'nullable|array',
|
||||||
'kondisi_lingkungan' => 'nullable|array',
|
'kondisi_lingkungan' => 'nullable|array',
|
||||||
'kondisi_lain_bangunan' => 'nullable|array',
|
'kondisi_lain_bangunan' => 'nullable|array',
|
||||||
'informasi_dokument' => 'nullable',
|
'informasi_dokument' => 'nullable|array',
|
||||||
'peruntukan' => 'nullable',
|
'peruntukan' => 'nullable',
|
||||||
'kdb' => 'nullable',
|
'kdb' => 'nullable',
|
||||||
'kdh' => 'nullable',
|
'kdh' => 'nullable',
|
||||||
|
|||||||
@@ -130,8 +130,8 @@
|
|||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<div class="flex-wrap items-stretch">
|
<div class="flex-wrap items-stretch">
|
||||||
<div class="flex flex-col items-start gap-2">
|
<div class="flex flex-col items-start gap-2">
|
||||||
@if (isset($basicDdata['viewUnit']))
|
@if (isset($basicData['viewUnit']))
|
||||||
@foreach ($basicDdata['viewUnit'] as $item)
|
@foreach ($basicData['viewUnit'] as $item)
|
||||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||||
<input class="checkbox" name="view[]" type="checkbox"
|
<input class="checkbox" name="view[]" type="checkbox"
|
||||||
value="{{ $item->name }}"
|
value="{{ $item->name }}"
|
||||||
|
|||||||
@@ -38,13 +38,19 @@
|
|||||||
{{ old('luas_tanah_bagunan', isset($forminspeksi['bangunan']['luas_tanah_bagunan']['tidak sesuai'])) ? 'checked' : '' }}>
|
{{ old('luas_tanah_bagunan', isset($forminspeksi['bangunan']['luas_tanah_bagunan']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||||
<span class="ml-2">Tidak Sesuai</span>
|
<span class="ml-2">Tidak Sesuai</span>
|
||||||
</label>
|
</label>
|
||||||
|
@php
|
||||||
|
$statusKey = isset($forminspeksi['bangunan']['luas_tanah_bagunan']['sesuai'])
|
||||||
|
? 'sesuai'
|
||||||
|
: 'tidak sesuai';
|
||||||
|
$selectedData = $forminspeksi['bangunan']['luas_tanah_bagunan'][$statusKey] ?? null;
|
||||||
|
@endphp
|
||||||
|
|
||||||
<div id="luas_tanah_bagunan_tidak_sesuai" class="flex items-baseline gap-2"
|
<div id="luas_tanah_bagunan_tidak_sesuai" class="flex items-baseline gap-2"
|
||||||
style="{{ isset($forminspeksi['bangunan']['luas_tanah_bagunan']['tidak_sesuai']) ? '' : 'display: none;' }}">
|
style="{{ old('luas_tanah_bagunan_tidak_sesuai', $selectedData) ? '' : 'display: none'}}">
|
||||||
<input type="text" id="analisa_bangunan_tidak_sesuai"
|
<input type="text" id="analisa_bangunan_tidak_sesuai"
|
||||||
name="luas_tanah_bagunan_tidak_sesuai" class="input w-full"
|
name="luas_tanah_bagunan_tidak_sesuai" class="input w-full"
|
||||||
placeholder="Masukan Luas Bangunan Tidak Sesuai..."
|
placeholder="Masukan Luas Bangunan Tidak Sesuai..."
|
||||||
value="{{ old('luas_tanah_bagunan_tidak_sesuai', $forminspeksi['bangunan']['luas_tanah_bagunan']['tidak_sesuai'] ?? '') }}">
|
value="{{ old('luas_tanah_bagunan_tidak_sesuai', $forminspeksi['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ?? '') }}">
|
||||||
<button type="button" class="btn btn-md btn-primary"
|
<button type="button" class="btn btn-md btn-primary"
|
||||||
onclick="updateAnalisa('analisa_bangunan')">
|
onclick="updateAnalisa('analisa_bangunan')">
|
||||||
Save
|
Save
|
||||||
@@ -197,9 +203,8 @@
|
|||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@else
|
@else
|
||||||
<!-- Default empty building form when no data exists -->
|
|
||||||
<div class="spek-bangunan w-full gap-4 mt-5">
|
<div class="spek-bangunan w-full gap-4 mt-5">
|
||||||
<input type="text" name="nama_bangunan[]" value="Bangunan 1" required>
|
<input type="hidden" name="nama_bangunan[]" value="Bangunan 1" required>
|
||||||
<label class="building-label form-label">Bangunan 1</label>
|
<label class="building-label form-label">Bangunan 1</label>
|
||||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2 w-full">
|
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2 w-full">
|
||||||
@if (@isset($basicData['spekKategoriBangunan']))
|
@if (@isset($basicData['spekKategoriBangunan']))
|
||||||
|
|||||||
@@ -241,12 +241,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<select id="province_code_pembanding" name="province_code_pembanding[]"
|
<select id="province_code_pembanding" name="province_code_pembanding[]"
|
||||||
class="input w-full">
|
onchange="handleProvinceChange(this)" class="input w-full">
|
||||||
<option value="">Select Province</option>
|
<option value="">Pilih Provinsi</option>
|
||||||
@foreach ($provinces as $province)
|
@foreach ($provinces as $province)
|
||||||
<option value="{{ $province->code }}"
|
<option value="{{ $province->code }}">{{ $province->name }}
|
||||||
{{ $selectedProvince == $province->code ? 'selected' : '' }}>
|
|
||||||
{{ $province->name }}
|
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
@@ -280,10 +278,8 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<select id="city_code_pembanding" name="city_code_pembanding[]"
|
<select id="city_code_pembanding" name="city_code_pembanding[]"
|
||||||
class="input w-full">
|
onchange="handleCityChange(this)" class="input w-full">
|
||||||
|
|
||||||
<option value="">Pilih Kota/Kabupaten</option>
|
<option value="">Pilih Kota/Kabupaten</option>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -316,10 +312,8 @@
|
|||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
|
|
||||||
<select id="district_code_pembanding" name="district_code_pembanding[]"
|
<select id="district_code_pembanding" name="district_code_pembanding[]"
|
||||||
class="input w-full">
|
onchange="handleDistrictChange(this)" class="input w-full">
|
||||||
|
|
||||||
<option value="">Pilih Kecamatan</option>
|
<option value="">Pilih Kecamatan</option>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -351,9 +345,7 @@
|
|||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<select id="village_code_pembanding" name="village_code_pembanding[]"
|
<select id="village_code_pembanding" name="village_code_pembanding[]"
|
||||||
class="input w-full">
|
class="input w-full">
|
||||||
|
<option value="">Pilih Desa/Kelurahan</option>
|
||||||
<option value="">Pilih Kecamatan</option>
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -539,7 +531,6 @@
|
|||||||
const newCell = document.createElement('td');
|
const newCell = document.createElement('td');
|
||||||
newCell.className = 'px-4 py-2';
|
newCell.className = 'px-4 py-2';
|
||||||
|
|
||||||
// Clone the last input cell
|
|
||||||
const lastInputCell = row.querySelector('td:last-child');
|
const lastInputCell = row.querySelector('td:last-child');
|
||||||
if (lastInputCell) {
|
if (lastInputCell) {
|
||||||
const clonedContent = lastInputCell.innerHTML;
|
const clonedContent = lastInputCell.innerHTML;
|
||||||
@@ -547,7 +538,7 @@
|
|||||||
|
|
||||||
// Update IDs and names for the new cell
|
// Update IDs and names for the new cell
|
||||||
const inputs = newCell.querySelectorAll('input, select, textarea');
|
const inputs = newCell.querySelectorAll('input, select, textarea');
|
||||||
inputs.forEach((input, index) => {
|
inputs.forEach((input) => {
|
||||||
if (input.type === 'file') {
|
if (input.type === 'file') {
|
||||||
const newImageId = `uploadedImage${columnCount + 1}`;
|
const newImageId = `uploadedImage${columnCount + 1}`;
|
||||||
const preview = newCell.querySelector('img');
|
const preview = newCell.querySelector('img');
|
||||||
@@ -561,19 +552,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input.id) {
|
// Menangani select alamat
|
||||||
input.id = updateDynamicId(input.id, columnCount);
|
if (input.tagName === 'SELECT') {
|
||||||
|
const oldId = input.id;
|
||||||
|
const newId = `${oldId}_${columnCount}`;
|
||||||
|
input.id = newId;
|
||||||
|
|
||||||
|
// Menambahkan event listener untuk select alamat
|
||||||
|
if (oldId.includes('city')) {
|
||||||
|
input.onchange = function() {
|
||||||
|
handleCityChange(this);
|
||||||
|
};
|
||||||
|
} else if (oldId.includes('district')) {
|
||||||
|
input.onchange = function() {
|
||||||
|
handleDistrictChange(this);
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear values
|
// Clear values
|
||||||
if (input.type !== 'file') {
|
if (input.type !== 'file') {
|
||||||
input.value = '';
|
input.value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
loadIdSelectAddres(input.id);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
row.appendChild(newCell);
|
row.appendChild(newCell);
|
||||||
});
|
});
|
||||||
@@ -582,6 +583,7 @@
|
|||||||
reinitializeEventListeners();
|
reinitializeEventListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function updateDynamicId(currentId, columnCount) {
|
function updateDynamicId(currentId, columnCount) {
|
||||||
return `${currentId.split('_')[0]}_${'code_pembanding'}_${columnCount}`;
|
return `${currentId.split('_')[0]}_${'code_pembanding'}_${columnCount}`;
|
||||||
}
|
}
|
||||||
@@ -739,112 +741,176 @@
|
|||||||
'district_code_pembanding',
|
'district_code_pembanding',
|
||||||
'village_code_pembanding'
|
'village_code_pembanding'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
// Memuat data provinsi saat halaman dimuat
|
// Inisialisasi event listener untuk data pembanding pertama
|
||||||
loadProvinces();
|
initializeFirstPembandingListeners();
|
||||||
|
|
||||||
// Event listener untuk perubahan pada dropdown Province
|
try {
|
||||||
document.getElementById('province_code_pembanding').addEventListener('change', function() {
|
const inspectionData = {!! isset($inspectionData) ? json_encode($inspectionData) : 'null' !!};
|
||||||
|
const comparisons = {!! isset($comparisons) ? json_encode($comparisons) : 'null' !!};
|
||||||
|
|
||||||
|
if (comparisons) {
|
||||||
|
comparisons.data_pembanding.forEach((comparison, index) => {
|
||||||
|
if (index > 0) {
|
||||||
|
addColumn();
|
||||||
|
}
|
||||||
|
fillPembandingData(comparison, index);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
updateRemoveButtonVisibility();
|
||||||
|
initializeEventListeners();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error initializing form:', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function initializeFirstPembandingListeners() {
|
||||||
|
// Event listener untuk province pembanding pertama
|
||||||
|
const firstProvinceSelect = document.getElementById('province_code_pembanding');
|
||||||
|
if (firstProvinceSelect) {
|
||||||
|
firstProvinceSelect.addEventListener('change', function() {
|
||||||
const provinceId = this.value;
|
const provinceId = this.value;
|
||||||
if (provinceId) {
|
if (provinceId) {
|
||||||
getCity(provinceId); // Kirimkan provinceId ke fungsi getCity
|
getCity(provinceId, 1);
|
||||||
} else {
|
|
||||||
resetDropdown('city_code_pembanding', 'Select City');
|
|
||||||
resetDropdown('district_code_pembanding', 'Select District');
|
|
||||||
resetDropdown('village_code_pembanding', 'Select Village');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Event listener untuk perubahan pada dropdown City
|
// Event listener untuk city pembanding pertama
|
||||||
document.getElementById('city_code_pembanding').addEventListener('change', function() {
|
const firstCitySelect = document.getElementById('city_code_pembanding');
|
||||||
|
if (firstCitySelect) {
|
||||||
|
firstCitySelect.addEventListener('change', function() {
|
||||||
const cityId = this.value;
|
const cityId = this.value;
|
||||||
if (cityId) {
|
if (cityId) {
|
||||||
getDistrict(cityId);
|
getDistrict(cityId, 1);
|
||||||
} else {
|
|
||||||
resetDropdown('district_code_pembanding', 'Select District');
|
|
||||||
resetDropdown('village_code_pembanding', 'Select Village');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Event listener untuk perubahan pada dropdown District
|
// Event listener untuk district pembanding pertama
|
||||||
document.getElementById('district_code_pembanding').addEventListener('change', function() {
|
const firstDistrictSelect = document.getElementById('district_code_pembanding');
|
||||||
|
if (firstDistrictSelect) {
|
||||||
|
firstDistrictSelect.addEventListener('change', function() {
|
||||||
const districtId = this.value;
|
const districtId = this.value;
|
||||||
if (districtId) {
|
if (districtId) {
|
||||||
getVillage(districtId);
|
getVillage(districtId, 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleProvinceChange(provinceSelect) {
|
||||||
|
const provinceId = provinceSelect.value;
|
||||||
|
let columnIndex;
|
||||||
|
|
||||||
|
// Cek apakah ini pembanding pertama atau tambahan
|
||||||
|
if (provinceSelect.id === 'province_code_pembanding') {
|
||||||
|
columnIndex = 1;
|
||||||
} else {
|
} else {
|
||||||
resetDropdown('village_code_pembanding', 'Select Village');
|
columnIndex = provinceSelect.id.split('_').pop();
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
function loadProvinces() {
|
|
||||||
const provinces =
|
|
||||||
@json($provinces); // Using Laravel's Blade templating to pass the provinces array to JS
|
|
||||||
|
|
||||||
const provinceDropdown = document.getElementById('province_code_pembanding');
|
|
||||||
provinceDropdown.innerHTML = '<option value="">Select Province</option>';
|
|
||||||
|
|
||||||
provinces.forEach(province => {
|
|
||||||
provinceDropdown.innerHTML += `<option value="${province.code}">${province.name}</option>`;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getCity(provinceId) {
|
if (provinceId) {
|
||||||
|
getCity(provinceId, columnIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleCityChange(citySelect) {
|
||||||
|
const cityId = citySelect.value;
|
||||||
|
let columnIndex;
|
||||||
|
|
||||||
|
if (citySelect.id === 'city_code_pembanding') {
|
||||||
|
columnIndex = 1;
|
||||||
|
} else {
|
||||||
|
columnIndex = citySelect.id.split('_').pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cityId) {
|
||||||
|
getDistrict(cityId, columnIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDistrictChange(districtSelect) {
|
||||||
|
const districtId = districtSelect.value;
|
||||||
|
let columnIndex;
|
||||||
|
|
||||||
|
if (districtSelect.id === 'district_code_pembanding') {
|
||||||
|
columnIndex = 1;
|
||||||
|
} else {
|
||||||
|
columnIndex = districtSelect.id.split('_').pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (districtId) {
|
||||||
|
getVillage(districtId, columnIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getCity(provinceId, columnIndex) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(`/locations/cities/province/${provinceId}`);
|
||||||
`/locations/cities/province/${provinceId}`); // Assuming this is still your API
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
const cityDropdown = document.getElementById('city_code_pembanding');
|
// Pilih dropdown berdasarkan index
|
||||||
cityDropdown.innerHTML = '<option value="">Select City</option>';
|
const cityDropdown = columnIndex === 1 ?
|
||||||
|
document.getElementById('city_code_pembanding') :
|
||||||
|
document.getElementById(`city_code_pembanding_${columnIndex}`);
|
||||||
|
|
||||||
|
if (cityDropdown) {
|
||||||
|
cityDropdown.innerHTML = '<option value="">Pilih Kota/Kabupaten</option>';
|
||||||
data.forEach(city => {
|
data.forEach(city => {
|
||||||
cityDropdown.innerHTML += `<option value="${city.code}">${city.name}</option>`;
|
cityDropdown.innerHTML += `<option value="${city.code}">${city.name}</option>`;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching cities:', error);
|
console.error('Error fetching cities:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getDistrict(cityId) {
|
async function getDistrict(cityId, columnIndex) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`/locations/districts/city/${cityId}`);
|
const response = await fetch(`/locations/districts/city/${cityId}`);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
const districtDropdown = document.getElementById('district_code_pembanding');
|
const districtDropdown = columnIndex === 1 ?
|
||||||
districtDropdown.innerHTML = '<option value="">Select District</option>';
|
document.getElementById('district_code_pembanding') :
|
||||||
|
document.getElementById(`district_code_pembanding_${columnIndex}`);
|
||||||
|
|
||||||
|
if (districtDropdown) {
|
||||||
|
districtDropdown.innerHTML = '<option value="">Pilih Kecamatan</option>';
|
||||||
data.forEach(district => {
|
data.forEach(district => {
|
||||||
districtDropdown.innerHTML += `<option value="${district.code}">${district.name}</option>`;
|
districtDropdown.innerHTML +=
|
||||||
|
`<option value="${district.code}">${district.name}</option>`;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching districts:', error);
|
console.error('Error fetching districts:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getVillage(districtId) {
|
async function getVillage(districtId, columnIndex) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`/locations/villages/district/${districtId}`);
|
const response = await fetch(`/locations/villages/district/${districtId}`);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
const villageDropdown = document.getElementById('village_code_pembanding');
|
const villageDropdown = columnIndex === 1 ?
|
||||||
villageDropdown.innerHTML = '<option value="">Select Village</option>';
|
document.getElementById('village_code_pembanding') :
|
||||||
|
document.getElementById(`village_code_pembanding_${columnIndex}`);
|
||||||
|
|
||||||
|
if (villageDropdown) {
|
||||||
|
villageDropdown.innerHTML = '<option value="">Pilih Desa/Kelurahan</option>';
|
||||||
data.forEach(village => {
|
data.forEach(village => {
|
||||||
villageDropdown.innerHTML += `<option value="${village.code}">${village.name}</option>`;
|
villageDropdown.innerHTML += `<option value="${village.code}">${village.name}</option>`;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching villages:', error);
|
console.error('Error fetching villages:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function resetDropdown(elementId, placeholder) {
|
function resetDropdown(elementId, placeholder) {
|
||||||
const dropdown = document.getElementById(elementId);
|
const dropdown = document.getElementById(elementId);
|
||||||
dropdown.innerHTML = `<option value="">${placeholder}</option>`;
|
dropdown.innerHTML = `<option value="">${placeholder}</option>`;
|
||||||
|
|||||||
@@ -5,6 +5,15 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
<style>
|
||||||
|
.pdf-preview {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
@include('lpj::assetsku.includenya')
|
@include('lpj::assetsku.includenya')
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
<div class="card min-w-full">
|
<div class="card min-w-full">
|
||||||
@@ -130,34 +139,40 @@
|
|||||||
<input type="hidden" value="{{ $permohonan->id }}" name="permohonan_id">
|
<input type="hidden" value="{{ $permohonan->id }}" name="permohonan_id">
|
||||||
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
|
<input type="hidden" name="jenis_jaminan_id" value="{{ request('jenis_jaminan') }}">
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<div class=""max-w-4xl mx-auto bg-white rounded-lg shadow-md overflow-hidden">
|
<div class=" mx-auto overflow-hidden">
|
||||||
|
|
||||||
<div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-wrap gap-4" style="margin-top: 20px">
|
<div class="flex flex-wrap gap-4" style="margin-top: 20px">
|
||||||
<div class="flex w-full items-center justify-center gap-4">
|
<div class="flex w-full items-center justify-center gap-4">
|
||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
<span class="form-label">Upload Denah</span>
|
<span class="form-label">Upload Denah (Foto/PDF)</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="w-full grid gap-5">
|
<div class="w-full grid gap-5">
|
||||||
|
<!-- Preview Container -->
|
||||||
|
<div id="preview-container">
|
||||||
|
<!-- Image preview -->
|
||||||
<img id="foto_denah-preview"
|
<img id="foto_denah-preview"
|
||||||
src="{{ isset($formDenah['foto_denah']) ? asset('storage/' . old('foto_denah', $formDenah['foto_denah'])) : '' }}"
|
src="{{ isset($formDenah['foto_denah']) ? asset('storage/' . old('foto_denah', $formDenah['foto_denah'])) : '' }}"
|
||||||
alt="Gambar foto_denah"
|
alt="Gambar foto_denah"
|
||||||
style="{{ isset($formDenah['foto_denah']) ? 'width: 30rem;' : 'display: none;' }}">
|
style="{{ isset($formDenah['foto_denah']) && strpos($formDenah['foto_denah'], '.pdf') === false ? 'width: 30rem;' : 'display: none;' }}">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- PDF preview -->
|
||||||
|
@if (isset($formDenah['foto_denah']) && strpos($formDenah['foto_denah'], '.pdf') !== false)
|
||||||
|
<div id="pdf-preview" class="pdf-preview">
|
||||||
|
<embed src="{{ asset('storage/' . $formDenah['foto_denah']) }}"
|
||||||
|
type="application/pdf" width="100%" height="500px">
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="input-group w-full flex gap-2">
|
<div class="input-group w-full flex gap-2">
|
||||||
<input type="file"
|
<input type="file"
|
||||||
value="{{ old('foto_denah', isset($formDenah['foto_denah']) ? $formDenah['foto_denah'] : '') }}"
|
value="{{ old('foto_denah', isset($formDenah['foto_denah']) ? $formDenah['foto_denah'] : '') }}"
|
||||||
name="foto_denah" class="file-input file-input-bordered w-full"
|
name="foto_denah" class="file-input file-input-bordered w-full"
|
||||||
accept="image/*" onchange="previewImage(this, 'foto_denah-preview')">
|
accept=".jpg,.jpeg,.png,.pdf" onchange="previewFile(this)">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<em id="error-foto_denah" class="alert text-danger text-sm"></em>
|
<em id="error-foto_denah" class="alert text-danger text-sm"></em>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -202,18 +217,56 @@
|
|||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
function previewImage(input, previewId) {
|
function previewFile(input) {
|
||||||
if (input.files && input.files[0]) {
|
const previewContainer = document.getElementById('preview-container');
|
||||||
var reader = new FileReader();
|
const imagePreview = document.getElementById('foto_denah-preview');
|
||||||
|
const file = input.files[0];
|
||||||
|
|
||||||
|
// Hapus preview PDF yang ada (jika ada)
|
||||||
|
const existingPdfPreview = document.getElementById('pdf-preview');
|
||||||
|
if (existingPdfPreview) {
|
||||||
|
existingPdfPreview.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file) {
|
||||||
|
// Cek tipe file
|
||||||
|
if (file.type.startsWith('image/')) {
|
||||||
|
// Jika file adalah gambar
|
||||||
|
imagePreview.style.display = 'block';
|
||||||
|
const reader = new FileReader();
|
||||||
|
|
||||||
reader.onload = function(e) {
|
reader.onload = function(e) {
|
||||||
$('#' + previewId).attr('src', e.target.result).show();
|
imagePreview.src = e.target.result;
|
||||||
|
imagePreview.style.width = '30rem';
|
||||||
|
}
|
||||||
|
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
} else if (file.type === 'application/pdf') {
|
||||||
|
// Jika file adalah PDF
|
||||||
|
imagePreview.style.display = 'none';
|
||||||
|
|
||||||
|
// Buat preview PDF
|
||||||
|
const pdfPreview = document.createElement('div');
|
||||||
|
pdfPreview.id = 'pdf-preview';
|
||||||
|
pdfPreview.className = 'pdf-preview';
|
||||||
|
|
||||||
|
const pdfEmbed = document.createElement('embed');
|
||||||
|
pdfEmbed.src = URL.createObjectURL(file);
|
||||||
|
pdfEmbed.type = 'application/pdf';
|
||||||
|
pdfEmbed.width = '100%';
|
||||||
|
pdfEmbed.height = '500px';
|
||||||
|
|
||||||
|
pdfPreview.appendChild(pdfEmbed);
|
||||||
|
previewContainer.appendChild(pdfPreview);
|
||||||
}
|
}
|
||||||
reader.readAsDataURL(input.files[0]);
|
|
||||||
} else {
|
} else {
|
||||||
$('#' + previewId).hide();
|
// Jika tidak ada file yang dipilih
|
||||||
|
imagePreview.style.display = 'none';
|
||||||
|
imagePreview.src = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function submitDenah() {
|
function submitDenah() {
|
||||||
const loadingOverlay = document.getElementById('loadingOverlay');
|
const loadingOverlay = document.getElementById('loadingOverlay');
|
||||||
loadingOverlay.classList.remove('hidden');
|
loadingOverlay.classList.remove('hidden');
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
<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">
|
||||||
<textarea class="textarea mt-2" name="rute_menuju" rows="3">{{ old('rute_menuju.0', $forminspeksi['fakta']['rute_menuju'][0] ?? '') }}</textarea>
|
<textarea class="textarea mt-2" name="rute_menuju" rows="3">{{ old('rute_menuju.0', $forminspeksi['fakta']['rute_menuju'] ?? '') }}</textarea>
|
||||||
<em id="error-rute_menuju" class="alert text-danger text-sm"></em>
|
<em id="error-rute_menuju" class="alert text-danger text-sm"></em>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,8 +98,7 @@
|
|||||||
<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 gap-2.5" style="width: 500px">
|
<label class="form-label max-w-56 gap-2.5" style="width: 500px">
|
||||||
<input class="checkbox" name="batas_batas[]" type="checkbox"
|
<input class="checkbox" name="batas_batas[]" type="checkbox"
|
||||||
value="{{ $item->name }}"
|
value="{{ $item->name }}" {{ $isChecked ? 'checked' : '' }} />
|
||||||
{{ $isChecked ? 'checked' : '' }} />
|
|
||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</label>
|
</label>
|
||||||
<input type="text" name="batas_batas_input[]" class="input w-full"
|
<input type="text" name="batas_batas_input[]" class="input w-full"
|
||||||
@@ -186,30 +185,35 @@
|
|||||||
<label class="form-label max-w-56">Informasi Terkait Dokumen</label>
|
<label class="form-label max-w-56">Informasi Terkait Dokumen</label>
|
||||||
<div id="informasi-dokument-container" class="flex flex-wrap items-baseline w-full">
|
<div id="informasi-dokument-container" class="flex flex-wrap items-baseline w-full">
|
||||||
@php
|
@php
|
||||||
// Ensure $forminspeksi['fakta']['informasi_dokument'] is an array
|
$informasi_dokument = isset($forminspeksi['fakta']['informasi_dokument'])
|
||||||
$informasi_dokument = isset($forminspeksi['fakta']['informasi_dokument']) ? (array) $forminspeksi['fakta']['informasi_dokument'] : [];
|
? (array) $forminspeksi['fakta']['informasi_dokument']
|
||||||
|
: [];
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
|
@if (!empty($informasi_dokument))
|
||||||
|
|
||||||
@foreach ($informasi_dokument as $index => $document)
|
@foreach ($informasi_dokument as $index => $document)
|
||||||
<div class="informasi_dokument flex items-center gap-2 mt-2 textarea-group w-full">
|
<div class="informasi_dokument flex items-center gap-2 mt-2 textarea-group w-full">
|
||||||
<textarea class="textarea mt-2" name="informasi_dokument[]" rows="3">{{ old("informasi_dokument.$index", $document) }}</textarea>
|
<textarea class="textarea mt-2" name="informasi_dokument[]" rows="3">{{ old("informasi_dokument.$index", $document) }}</textarea>
|
||||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||||
|
style="display: none;">
|
||||||
<i class="ki-outline ki-trash"></i>
|
<i class="ki-outline ki-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@else
|
||||||
<div class="informasi_dokument flex items-center gap-2 mt-2 textarea-group w-full">
|
<div class="informasi_dokument flex items-center gap-2 mt-2 textarea-group w-full">
|
||||||
<textarea class="textarea mt-2" name="informasi_dokument" rows="3">
|
<textarea class="textarea mt-2" name="informasi_dokument[]" rows="3">{{ old('informasi_dokument.0', isset($forminspeksi['fakta']['informasi_dokument'][0]) ? $forminspeksi['fakta']['informasi_dokument'][0] : '') }}
|
||||||
{{ old('informasi_dokument.0', isset($forminspeksi['fakta']['informasi_dokument'][0]) ? $forminspeksi['fakta']['informasi_dokument'][0] : '') }}
|
|
||||||
</textarea>
|
</textarea>
|
||||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||||
|
style="display: none;">
|
||||||
<i class="ki-outline ki-trash"></i>
|
<i class="ki-outline ki-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
<em id="error-informasi_dokument" class="alert text-danger text-sm"></em>
|
<em id="error-informasi_dokument" class="alert text-danger text-sm"></em>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
<button class="btn btn-primary btn-sm mt-5" type="button" onclick="addClonableItem('informasi-dokument-container', 'informasi_dokument')">
|
<button class="btn btn-primary btn-sm mt-5" type="button"
|
||||||
|
onclick="addClonableItem('informasi-dokument-container', 'informasi_dokument')">
|
||||||
<i class="ki-outline ki-plus"></i>
|
<i class="ki-outline ki-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
<!-- Delete button to remove photo -->
|
<!-- Delete button to remove photo -->
|
||||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||||
onclick="deletePhoto('{{ $index }}')">
|
id="btnDelete">
|
||||||
<i class="ki-filled ki-trash"></i>
|
<i class="ki-filled ki-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -256,9 +256,11 @@
|
|||||||
$objekViews = [];
|
$objekViews = [];
|
||||||
if ($kategori === 'tanah') {
|
if ($kategori === 'tanah') {
|
||||||
$objekViews = [
|
$objekViews = [
|
||||||
['label' => 'Tampak Samping Kiri', 'index' => 0],
|
['label' => 'Tampak Depan Objek', 'index' => 0],
|
||||||
['label' => 'Tampak Samping Kanan', 'index' => 1],
|
['label' => 'Tampak Samping Kiri', 'index' => 1],
|
||||||
['label' => 'Nomor Rumah/Unit', 'index' => 2],
|
['label' => 'Tampak Samping Kanan', 'index' => 2],
|
||||||
|
['label' => 'Nomor Rumah/Unit', 'index' => 3],
|
||||||
|
|
||||||
];
|
];
|
||||||
} elseif ($kategori === 'apartemen-kantor') {
|
} elseif ($kategori === 'apartemen-kantor') {
|
||||||
$objekViews = [
|
$objekViews = [
|
||||||
@@ -605,8 +607,7 @@
|
|||||||
@include('lpj::surveyor.components.modal-kamera')
|
@include('lpj::surveyor.components.modal-kamera')
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@include('lpj::surveyor.js.fotojs')
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
function submitFoto() {
|
function submitFoto() {
|
||||||
@@ -616,9 +617,6 @@
|
|||||||
|
|
||||||
const formElement = $('#formFoto')[0];
|
const formElement = $('#formFoto')[0];
|
||||||
const formData = new FormData(formElement);
|
const formData = new FormData(formElement);
|
||||||
// for (const [key, value] of formData.entries()) {
|
|
||||||
// console.log(`Key: ${key}, Value: ${value}`);
|
|
||||||
// }
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{{ route('surveyor.storeFoto') }}',
|
url: '{{ route('surveyor.storeFoto') }}',
|
||||||
@@ -639,8 +637,8 @@
|
|||||||
confirmButtonText: 'OK'
|
confirmButtonText: 'OK'
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.isConfirmed) {
|
if (response.isConfirmed) {
|
||||||
// window.location.href =
|
window.location.href =
|
||||||
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||||
}
|
}
|
||||||
console.log(response);
|
console.log(response);
|
||||||
|
|
||||||
|
|||||||
@@ -50,15 +50,31 @@
|
|||||||
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||||
<label class="form-label max-w-56">Debitur/Perwakilan</label>
|
<label class="form-label max-w-56">Debitur/Perwakilan</label>
|
||||||
|
|
||||||
|
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
||||||
|
|
||||||
|
<div id="perwakilan" class="flex flex-wrap items-baseline w-full gap-5">
|
||||||
|
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
|
||||||
|
<div class="perwakilan flex flex-wrap w-full items-baseline gap-2 ">
|
||||||
|
<input type="text" class="input form-control" name="debitur_perwakilan[]"
|
||||||
|
value="{{ old('debitur_perwakilan.' . $key, $item) }}"
|
||||||
|
placeholder="Masukkan Debitur/Perwakilan"/>
|
||||||
|
<button type="button" class="btn btn-danger btn-outline btn-xs remove-btn">Hapus</button>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
<div id="perwakilan" class="flex flex-wrap items-baseline w-full gap-5">
|
<div id="perwakilan" class="flex flex-wrap items-baseline w-full gap-5">
|
||||||
<div class="perwakilan flex flex-wrap w-full items-baseline gap-2 ">
|
<div class="perwakilan flex flex-wrap w-full items-baseline gap-2 ">
|
||||||
<input type="text" class="input form-control" name="debitur_perwakilan[]"
|
<input type="text" class="input form-control" name="debitur_perwakilan[]"
|
||||||
value="{{ old('debitur_perwakilan', isset($forminspeksi['asset']['debitur_perwakilan']) ? implode(', ', $forminspeksi['asset']['debitur_perwakilan']) : '') }}"
|
value="{{ old('debitur_perwakilan') }}" placeholder="Masukkan Debitur/Perwakilan"/>
|
||||||
placeholder="Masukkan Debitur/Perwakilan" />
|
|
||||||
<button type="button" class="btn btn-danger btn-outline btn-xs remove-btn"
|
<button type="button" class="btn btn-danger btn-outline btn-xs remove-btn"
|
||||||
style="display: none">Hapus</button>
|
style="display: none">Hapus
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<button onclick="addClonableItem('perwakilan', 'perwakilan')" type="button" class="btn-md btn btn-primary">
|
<button onclick="addClonableItem('perwakilan', 'perwakilan')" type="button" class="btn-md btn btn-primary">
|
||||||
<i class="ki-filled ki-plus"></i>
|
<i class="ki-filled ki-plus"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -67,13 +83,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
|
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
|
||||||
|
<div class="card-header">
|
||||||
<div class="card-body">
|
<h1 class="text-md font-medium text-gray-900 uppercase">Nama Cadeb/Debitur</h1>
|
||||||
<div class="py-4">
|
|
||||||
<h1 class="text-md font-medium text-gray-900">Nama Cadeb/Debitur</h1>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
|
||||||
<div class="grid gap-5">
|
<div class="grid gap-5">
|
||||||
<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">
|
||||||
@@ -90,11 +105,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="card w-full bg-white rounded-lg shadow-md ">
|
<div class="card w-full bg-white rounded-lg shadow-md ">
|
||||||
<div class="card-body">
|
<div class="card-header">
|
||||||
<div class="py-4 ">
|
<h1 class="text-md font-medium text-gray-900 uppercase">Deskripsi Aset jaminan</h1>
|
||||||
<h1 class="text-md font-medium text-gray-900">Deskripsi Aset jaminan</h1>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
<div class="grid gap-5 w-full">
|
<div class="grid gap-5 w-full">
|
||||||
<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">Jenis Aset</label>
|
<label class="form-label max-w-56">Jenis Aset</label>
|
||||||
@@ -123,7 +137,9 @@
|
|||||||
</label>
|
</label>
|
||||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||||
@php
|
@php
|
||||||
$statusKey = isset($forminspeksi['asset']['jenis_asset']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
$statusKey = isset($forminspeksi['asset']['jenis_asset']['sesuai'])
|
||||||
|
? 'sesuai'
|
||||||
|
: 'tidak sesuai';
|
||||||
$selectedValue = $forminspeksi['asset']['jenis_asset'][$statusKey] ?? null;
|
$selectedValue = $forminspeksi['asset']['jenis_asset'][$statusKey] ?? null;
|
||||||
@endphp
|
@endphp
|
||||||
<div id="jenis_asset" class="flex items-baseline gap-2"
|
<div id="jenis_asset" class="flex items-baseline gap-2"
|
||||||
@@ -153,11 +169,11 @@
|
|||||||
<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">Alamat</label>
|
<label class="form-label max-w-56">Alamat</label>
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
|
||||||
<span class="text-2sm text-gray-700">
|
<span class="text-2sm text-gray-700">
|
||||||
{{ formatAlamat($dokumen) }}
|
{{ formatAlamat($permohonan->debiture) }}
|
||||||
</span>
|
</span>
|
||||||
@endforeach
|
|
||||||
|
|
||||||
<div class="flex-wrap items-stretch">
|
<div class="flex-wrap items-stretch">
|
||||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||||
@@ -205,16 +221,15 @@
|
|||||||
<select id="province_code" name="province_code" class="input w-full">
|
<select id="province_code" name="province_code" class="input w-full">
|
||||||
<option value="">Select Province</option>
|
<option value="">Select Province</option>
|
||||||
@foreach ($provinces as $province)
|
@foreach ($provinces as $province)
|
||||||
@if (isset($debitur))
|
|
||||||
<option value="{{ $province->code }}"
|
<option value="{{ $province->code }}"
|
||||||
{{ isset($debitur->province_code) && $debitur->province_code == $province->code ? 'selected' : '' }}>
|
@if (
|
||||||
|
(isset($cekAlamat['province_code']) && $cekAlamat['province_code'] == $province->code) ||
|
||||||
|
(!isset($cekAlamat['province_code']) && isset($debitur->province_code) && $debitur->province_code == $province->code)
|
||||||
|
)
|
||||||
|
selected
|
||||||
|
@endif>
|
||||||
{{ $province->name }}
|
{{ $province->name }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
|
||||||
<option value="{{ $province->code }}">
|
|
||||||
{{ $province->name }}
|
|
||||||
</option>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@@ -227,16 +242,16 @@
|
|||||||
<option value="">Pilih Kota/Kabupaten</option>
|
<option value="">Pilih Kota/Kabupaten</option>
|
||||||
@if (isset($cities))
|
@if (isset($cities))
|
||||||
@foreach ($cities as $city)
|
@foreach ($cities as $city)
|
||||||
@if (isset($debitur))
|
|
||||||
<option value="{{ $city->code }}"
|
<option value="{{ $city->code }}"
|
||||||
{{ isset($debitur->city_code) && $debitur->city_code == $city->code ? 'selected' : '' }}>
|
@if (
|
||||||
|
(isset($cekAlamat['city_code']) && $cekAlamat['city_code'] == $city->code) ||
|
||||||
|
(!isset($cekAlamat['city_code']) && isset($debitur->city_code) && $debitur->city_code == $city->code)
|
||||||
|
)
|
||||||
|
selected
|
||||||
|
@endif>
|
||||||
{{ $city->name }}
|
{{ $city->name }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
|
||||||
<option value="{{ $city->code }}">
|
|
||||||
{{ $city->name }}
|
|
||||||
</option>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</select>
|
</select>
|
||||||
@@ -245,21 +260,23 @@
|
|||||||
|
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||||
<label for="district_code" class="form-label max-w-56">Kecamatan</label>
|
<label for="district_code" class="form-label max-w-56">Kecamatan</label>
|
||||||
|
|
||||||
|
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<select id="district_code" name="district_code" class="select w-full">
|
<select id="district_code" name="district_code" class="select w-full">
|
||||||
<option value="">Pilih Kecamatan</option>
|
<option value="">Pilih Kecamatan</option>
|
||||||
@if (isset($data['districts']))
|
@if (isset($districts))
|
||||||
@foreach ($districts as $district)
|
@foreach ($districts as $district)
|
||||||
@if (isset($debitur))
|
|
||||||
<option value="{{ $district->code }}"
|
<option value="{{ $district->code }}"
|
||||||
{{ isset($debitur->district_code) && $debitur->district_code == $district->code ? 'selected' : '' }}>
|
@if (
|
||||||
|
(isset($cekAlamat['district_code']) && $cekAlamat['district_code'] == $district->code) ||
|
||||||
|
(!isset($cekAlamat['district_code']) && isset($debitur->district_code) && $debitur->district_code == $district->code)
|
||||||
|
)
|
||||||
|
selected
|
||||||
|
@endif>
|
||||||
{{ $district->name }}
|
{{ $district->name }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
|
||||||
<option value="{{ $district->code }}">
|
|
||||||
{{ $district->name }}
|
|
||||||
</option>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
@@ -274,16 +291,16 @@
|
|||||||
<option value="">Pilih Kelurahan</option>
|
<option value="">Pilih Kelurahan</option>
|
||||||
@if (isset($villages))
|
@if (isset($villages))
|
||||||
@foreach ($villages as $village)
|
@foreach ($villages as $village)
|
||||||
@if (isset($debitur))
|
|
||||||
<option value="{{ $village->code }}"
|
<option value="{{ $village->code }}"
|
||||||
{{ isset($debitur->village_code) && $debitur->village_code == $village->code ? 'selected' : '' }}>
|
@if (
|
||||||
|
(isset($cekAlamat['village_code']) && $cekAlamat['village_code'] == $village->code) ||
|
||||||
|
(!isset($cekAlamat['village_code']) && isset($debitur->village_code) && $debitur->village_code == $village->code)
|
||||||
|
)
|
||||||
|
selected
|
||||||
|
@endif>
|
||||||
{{ $village->name }}
|
{{ $village->name }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
|
||||||
<option value="{{ $village->code }}">
|
|
||||||
{{ $village->name }}
|
|
||||||
</option>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
@@ -301,10 +318,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
|
<div class="card w-full bg-white rounded-lg shadow-md overflow-hidden">
|
||||||
<div class="card-body">
|
<div class="card-header">
|
||||||
<div class="py-4 ">
|
<h1 class="text-md font-medium text-gray-900 uppercase">Titik Koordinat Google Maps</h1>
|
||||||
<h1 class="text-md font-medium text-gray-900">Titik Koordinat Google Maps</h1>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
<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">Kordinat</label>
|
<label class="form-label max-w-56">Kordinat</label>
|
||||||
<div id="perwakilan" class="flex items-baseline w-full gap-5">
|
<div id="perwakilan" class="flex items-baseline w-full gap-5">
|
||||||
@@ -326,6 +343,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h1 class="text-md font-medium text-gray-900 uppercase">Status</h1>
|
||||||
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div data-accordion="true">
|
<div data-accordion="true">
|
||||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||||
@@ -334,7 +354,7 @@
|
|||||||
<button class="accordion-toggle py-4 group "
|
<button class="accordion-toggle py-4 group "
|
||||||
data-accordion-toggle="#accordion_detail_jaminan_{{ $loop->index }}">
|
data-accordion-toggle="#accordion_detail_jaminan_{{ $loop->index }}">
|
||||||
<span class="text-base text-gray-900 font-medium">
|
<span class="text-base text-gray-900 font-medium">
|
||||||
Status Kepemilikan
|
Dokument Kepemilikan
|
||||||
</span>
|
</span>
|
||||||
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
|
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
|
||||||
</i>
|
</i>
|
||||||
@@ -455,20 +475,20 @@
|
|||||||
: 'tidak sesuai';
|
: 'tidak sesuai';
|
||||||
$selectedData = $forminspeksi['asset']['hub_cadeb'][$statusKey] ?? null;
|
$selectedData = $forminspeksi['asset']['hub_cadeb'][$statusKey] ?? null;
|
||||||
@endphp
|
@endphp
|
||||||
<select id="hub_cadeb_tidak_sesuai"
|
|
||||||
class="input w-full
|
<select id="hub_cadeb_tidak_sesuai" class="input w-full" name="hub_cadeb_tidak_sesuai"
|
||||||
name="hub_cadeb_tidak_sesuai"
|
style="{{ old('hub_cadeb_tidak_sesuai', $selectedData) ? '' : 'display: none;' }}">
|
||||||
style="{{ old('hub_cadeb', $selectedData ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
|
|
||||||
<option value="">Select Hubungan Cadeb</option>
|
<option value="">Select Hubungan Cadeb</option>
|
||||||
@if (isset($basicData['hubCadeb']))
|
@if (isset($basicData['hubCadeb']))
|
||||||
@foreach ($basicData['hubCadeb'] as $item)
|
@foreach ($basicData['hubCadeb'] as $item)
|
||||||
<option value="{{ $item->name }}"
|
<option value="{{ $item->name }}"
|
||||||
{{ old('hub_cadeb_tidak_sesuai', $forminspeksi['asset']['hub_cadeb_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
{{ old('hub_cadeb_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<em id="error-hub_cadeb" class="alert text-danger text-sm"></em>
|
<em id="error-hub_cadeb" class="alert text-danger text-sm"></em>
|
||||||
</div>
|
</div>
|
||||||
@@ -487,7 +507,7 @@
|
|||||||
<div class="flex flex-wrap items-baseline w-full text-sm">
|
<div class="flex flex-wrap items-baseline w-full text-sm">
|
||||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||||
{{ $dokumen->penghuni->hubungan_penghuni->name ?? 'N/A' }}
|
{{ $dokumen->penghuni->hubungan_penghuni->name ?? 'N/A' }}
|
||||||
<input type="hidden" name="hub_cadeb_penguhuni_sesuai"
|
<input type="hidden" name="hub_cadeb_penghuni_sesuai"
|
||||||
value="{{ isset($dokumen->penghuni->hubungan_penghuni->name) ?? '' }}"
|
value="{{ isset($dokumen->penghuni->hubungan_penghuni->name) ?? '' }}"
|
||||||
id="">
|
id="">
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -496,17 +516,20 @@
|
|||||||
<div class="flex-wrap items-stretch">
|
<div class="flex-wrap items-stretch">
|
||||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||||
|
|
||||||
<input
|
<input
|
||||||
onclick="toggleFieldVisibility('hub_cadeb_penghuni','hub_cadeb_Penghuni_tidak_sesuai', ['tidak sesuai'])"
|
onclick="toggleFieldVisibility('hub_cadeb_penghuni','hub_penghuni_tidak_sesuai', ['tidak sesuai'])"
|
||||||
type="radio" class="radio" name="hub_cadeb_penghuni" value="sesuai"
|
type="radio" class="radio" name="hub_cadeb_penghuni" value="sesuai"
|
||||||
{{ old('hub_cadeb_penghuni', isset($forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'])) ? 'checked' : '' }}>
|
|
||||||
|
{{ old('hub_cadeb_penghuni', isset($forminspeksi['asset']['hub_cadeb_penghuni'])) ? 'checked' : '' }}>
|
||||||
|
|
||||||
<span class="ml-2">Ya</span>
|
<span class="ml-2">Ya</span>
|
||||||
</label>
|
</label>
|
||||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||||
<input
|
<input
|
||||||
onclick="toggleFieldVisibility('hub_cadeb_penghuni', 'hub_cadeb_Penghuni_tidak_sesuai', ['tidak sesuai'])"
|
onclick="toggleFieldVisibility('hub_cadeb_penghuni','hub_penghuni_tidak_sesuai', ['tidak sesuai'])"
|
||||||
type="radio" class="radio" name="hub_cadeb_penghuni" value="tidak sesuai"
|
type="radio" class="radio" name="hub_cadeb_penghuni" value="tidak sesuai"
|
||||||
{{ old('hub_cadeb_penghuni', isset($forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai'])) ? 'checked' : '' }}>
|
{{ old('hub_cadeb_penghuni', $forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai'] ?? false) ? 'checked' : '' }}>
|
||||||
<span class="ml-2">Tidak</span>
|
<span class="ml-2">Tidak</span>
|
||||||
</label>
|
</label>
|
||||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||||
@@ -516,15 +539,15 @@
|
|||||||
: 'tidak sesuai';
|
: 'tidak sesuai';
|
||||||
$selectedData = $forminspeksi['asset']['hub_cadeb_penghuni'][$statusKey] ?? null;
|
$selectedData = $forminspeksi['asset']['hub_cadeb_penghuni'][$statusKey] ?? null;
|
||||||
@endphp
|
@endphp
|
||||||
<select id="hub_cadeb_Penghuni_tidak_sesuai"
|
<select id="hub_penghuni_tidak_sesuai"
|
||||||
class="input w-full
|
class="input w-full
|
||||||
name="hub_cadeb_Penghuni_tidak_sesuai"
|
name=" hub_penghuni_tidak_sesuai"
|
||||||
style="{{ old('hub_cadeb', $selectedData) ? '' : 'display: none;' }}">
|
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData) ? '' : 'display: none;' }}">
|
||||||
<option value="">Select Hubungan Cadeb</option>
|
<option value="">Select Hubungan Cadeb</option>
|
||||||
@if (isset($basicData['hubPenghuni']))
|
@if (isset($basicData['hubPenghuni']))
|
||||||
@foreach ($basicData['hubPenghuni'] as $item)
|
@foreach ($basicData['hubPenghuni'] as $item)
|
||||||
<option value="{{ $item->name }}"
|
<option value="{{ $item->name }}"
|
||||||
{{ old('hub_cadeb_Penghuni_tidak_sesuai', $forminspeksi['asset']['hub_cadeb_Penghuni_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
{{ old('hub_penghuni_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
@@ -205,8 +205,8 @@
|
|||||||
confirmButtonText: 'OK'
|
confirmButtonText: 'OK'
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.isConfirmed) {
|
if (response.isConfirmed) {
|
||||||
// window.location.href =
|
window.location.href =
|
||||||
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@@ -266,21 +266,39 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clone the template element
|
||||||
const newElement = template.cloneNode(true);
|
const newElement = template.cloneNode(true);
|
||||||
const textarea = newElement.querySelector('textarea');
|
|
||||||
if (textarea) {
|
|
||||||
textarea.value = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Reset input fields
|
||||||
|
const inputs = newElement.querySelectorAll('input');
|
||||||
|
inputs.forEach(input => {
|
||||||
|
input.value = '';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Make the delete button visible and bind the click event
|
||||||
const deleteButton = newElement.querySelector('.remove-btn');
|
const deleteButton = newElement.querySelector('.remove-btn');
|
||||||
if (deleteButton) {
|
if (deleteButton) {
|
||||||
deleteButton.style.display = 'inline-block';
|
deleteButton.style.display = 'inline-block';
|
||||||
deleteButton.addEventListener('click', () => newElement.remove());
|
deleteButton.addEventListener('click', () => {
|
||||||
|
newElement.remove();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Append the cloned element to the container
|
||||||
container.appendChild(newElement);
|
container.appendChild(newElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure existing remove buttons are functional
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const removeButtons = document.querySelectorAll('.remove-btn');
|
||||||
|
removeButtons.forEach(button => {
|
||||||
|
button.addEventListener('click', function() {
|
||||||
|
this.closest('.perwakilan').remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function updateAnalisa(params) {
|
function updateAnalisa(params) {
|
||||||
const inputMap = {
|
const inputMap = {
|
||||||
@@ -363,6 +381,7 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div[disabled]:hover {
|
div[disabled]:hover {
|
||||||
background-color: #e8e8e8;
|
background-color: #e8e8e8;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,11 +33,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full mt-4">
|
<div class="w-full mt-4">
|
||||||
<label class="block text-sm font-medium text-gray-700">Lebar Perkerasan Jalan Depan
|
<label class="block text-sm font-medium text-gray-700">Lebar Perkerasan Jalan Depan objek</label>
|
||||||
objek</label>
|
@php
|
||||||
|
$lebarPerkerasanJalan = old('lebar_perkerasan_jalan', $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? '');
|
||||||
|
@endphp
|
||||||
<input type="text" name="lebar_perkerasan_jalan" class="input mt-2" placeholder="Meter"
|
<input type="text" name="lebar_perkerasan_jalan" class="input mt-2" placeholder="Meter"
|
||||||
value="{{ old('lebar_perkerasan_jalan', isset($forminspeksi['lingkungan']['lebar_perkerasan_jalan']) ? $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] : '') }}">
|
value="{{ $lebarPerkerasanJalan }}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<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">
|
||||||
@@ -46,18 +49,29 @@
|
|||||||
<div class="flex flex-col items-start gap-4">
|
<div class="flex flex-col items-start gap-4">
|
||||||
@if (isset($basicData['perkerasanJalan']))
|
@if (isset($basicData['perkerasanJalan']))
|
||||||
@foreach ($basicData['perkerasanJalan'] as $item)
|
@foreach ($basicData['perkerasanJalan'] as $item)
|
||||||
|
@php
|
||||||
|
$isChecked = in_array($item->name, isset($forminspeksi['lingkungan']['perkerasan_jalan']['perkerasan_jalan']) ? $forminspeksi['lingkungan']['perkerasan_jalan']['perkerasan_jalan'] : []);
|
||||||
|
@endphp
|
||||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||||
<input class="checkbox" name="perkerasan_jalan[]" type="checkbox"
|
<input class="checkbox" name="perkerasan_jalan[]" type="checkbox"
|
||||||
value="{{ $item->name }}"
|
value="{{ $item->name }}"
|
||||||
{{ in_array($item->name, isset($forminspeksi['lingkungan']['perkerasan_jalan']) ? $forminspeksi['lingkungan']['perkerasan_jalan'] : []) ? 'checked' : '' }}
|
{{ $isChecked ? 'checked' : '' }}
|
||||||
onclick="toggleCheckboxVisibility('perkerasan_jalan', 'perkerasan_jalan_lainnya', ['lainnya'])"/>
|
onclick="toggleCheckboxVisibility('perkerasan_jalan', 'perkerasan_jalan_lainnya', ['lainnya'])"/>
|
||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||||
<input id="perkerasan_jalan_lainnya" type="text" style="display: none;"
|
@php
|
||||||
|
|
||||||
|
$lainnyaValue = old('perkerasan_jalan_lainnya', isset($forminspeksi['lingkungan']['perkerasan_jalan']['lainnya']) ? $forminspeksi['lingkungan']['perkerasan_jalan']['lainnya'] : '');
|
||||||
|
@endphp
|
||||||
|
<input id="perkerasan_jalan_lainnya" type="text"
|
||||||
|
style="{{ isset($forminspeksi['lingkungan']['perkerasan_jalan']['lainnya']) && $forminspeksi['lingkungan']['perkerasan_jalan']['lainnya'] ? '' : 'display: none' }}"
|
||||||
name="perkerasan_jalan_lainnya" class="input w-full mt-2"
|
name="perkerasan_jalan_lainnya" class="input w-full mt-2"
|
||||||
|
value="{{ $lainnyaValue }}"
|
||||||
placeholder="Masukkan lainnya..." />
|
placeholder="Masukkan lainnya..." />
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@@ -65,6 +79,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Lalulintas -->
|
<!-- Lalulintas -->
|
||||||
<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">Lalu Lintas Depan Lokasi</label>
|
<label class="form-label max-w-56">Lalu Lintas Depan Lokasi</label>
|
||||||
@@ -138,16 +153,22 @@
|
|||||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||||
<input class="checkbox" name="terletak_diarea[]" type="checkbox"
|
<input class="checkbox" name="terletak_diarea[]" type="checkbox"
|
||||||
value="{{ $item->name }}"
|
value="{{ $item->name }}"
|
||||||
{{ isset($forminspeksi['lingkungan']['terletak_diarea']) && in_array($item->name, explode(',', is_array(old('terletak_diarea', $forminspeksi['lingkungan']['terletak_diarea'] ?? '')) ? implode(',', old('terletak_diarea', $forminspeksi['lingkungan']['terletak_diarea'] ?? '')) : old('terletak_diarea', $forminspeksi['lingkungan']['terletak_diarea'] ?? ''))) ? 'checked' : '' }}
|
{{ isset($forminspeksi['lingkungan']['terletak_diarea']['terletak_diarea']) && in_array($item->name, explode(',', is_array(old('terletak_diarea', $forminspeksi['lingkungan']['terletak_diarea']['terletak_diarea'] ?? '')) ? implode(',', old('terletak_diarea', $forminspeksi['lingkungan']['terletak_diarea']['terletak_diarea'] ?? '')) : old('terletak_diarea', $forminspeksi['lingkungan']['terletak_diarea'] ?? ''))) ? 'checked' : '' }}
|
||||||
onclick="toggleCheckboxVisibility('terletak_diarea', 'terletak_diarea_lainnya', ['Lainnya'])" />
|
onclick="toggleCheckboxVisibility('terletak_diarea', 'terletak_diarea_lainnya', ['Lainnya'])" />
|
||||||
|
|
||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</label>
|
</label>
|
||||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||||
<input id="terletak_diarea_lainnya" type="text" style="display: none;"
|
@php
|
||||||
|
$lainnyaValue = old('terletak_diarea_lainnya', isset($forminspeksi['lingkungan']['terletak_diarea']['lainnya']) ? $forminspeksi['lingkungan']['terletak_diarea']['lainnya'] : '');
|
||||||
|
@endphp
|
||||||
|
<input id="terletak_diarea_lainnya" type="text"
|
||||||
|
style="{{ isset($forminspeksi['lingkungan']['terletak_diarea']['lainnya']) && $forminspeksi['lingkungan']['terletak_diarea']['lainnya'] ? '' : 'display: none' }}"
|
||||||
name="terletak_diarea_lainnya" class="input w-full mt-2"
|
name="terletak_diarea_lainnya" class="input w-full mt-2"
|
||||||
|
value="{{ $lainnyaValue }}"
|
||||||
placeholder="Masukkan lainnya..." />
|
placeholder="Masukkan lainnya..." />
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@@ -181,7 +202,7 @@
|
|||||||
<option value="">pilih kondisi</option>
|
<option value="">pilih kondisi</option>
|
||||||
@foreach ($kondisi as $item)
|
@foreach ($kondisi as $item)
|
||||||
<option value="{{ $item }}"
|
<option value="{{ $item }}"
|
||||||
{{ old('kondisi_bagunan_disekitar_lokasi', $forminspeksi['lingkungan']['disekitar_lokasi'] ?? '') == $item ? 'selected' : '' }}>
|
{{ old('kondisi_bagunan_disekitar_lokasi', $forminspeksi['lingkungan']['kondisi_bagunan_disekitar_lokasi'] ?? '') == $item ? 'selected' : '' }}>
|
||||||
{{ $item }}
|
{{ $item }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -196,7 +217,7 @@
|
|||||||
<option value="">pilih sifat bagunan</option>
|
<option value="">pilih sifat bagunan</option>
|
||||||
@foreach ($sifat as $item)
|
@foreach ($sifat as $item)
|
||||||
<option value="{{ $item }}"
|
<option value="{{ $item }}"
|
||||||
{{ old('sifat_bagunan_disekitar_lokasi', $forminspeksi['lingkungan']['disekitar_lokasi'] ?? '') == $item ? 'selected' : '' }}>
|
{{ old('sifat_bagunan_disekitar_lokasi', $forminspeksi['lingkungan']['sifat_bagunan_disekitar_lokasi'] ?? '') == $item ? 'selected' : '' }}>
|
||||||
{{ $item }}
|
{{ $item }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -232,7 +253,7 @@
|
|||||||
<span class="ml-2">Ya</span>
|
<span class="ml-2">Ya</span>
|
||||||
</label>
|
</label>
|
||||||
<div id="dekat-makam" class="flex items-baseline gap-4 w-full"
|
<div id="dekat-makam" class="flex items-baseline gap-4 w-full"
|
||||||
style="{{ old('dekat_makam', $forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya' ? 'display:block;' : 'display:none;' }}">
|
style="{{ old('dekat_makam', $forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya' ? 'display:flex;' : 'display:none;' }}">
|
||||||
|
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<label for="jarak_makam" class="form-label max-w-56">Jarak</label>
|
<label for="jarak_makam" class="form-label max-w-56">Jarak</label>
|
||||||
@@ -266,7 +287,7 @@
|
|||||||
<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">Dekat TPS</label>
|
<label class="form-label max-w-56">Dekat TPS</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<div class="flex flex-col gap-2 mt-2">
|
<div class="flex flex-col gap-2 mt-2 w-full">
|
||||||
<!-- Opsi Ya -->
|
<!-- Opsi Ya -->
|
||||||
<div class="flex w-full items-center gap-4">
|
<div class="flex w-full items-center gap-4">
|
||||||
<label class="text-sm flex items-center gap-2.5 text-nowrap">
|
<label class="text-sm flex items-center gap-2.5 text-nowrap">
|
||||||
@@ -339,18 +360,18 @@
|
|||||||
$selectedFasilitas = is_array(
|
$selectedFasilitas = is_array(
|
||||||
old(
|
old(
|
||||||
'fasilitas_dekat_object',
|
'fasilitas_dekat_object',
|
||||||
$forminspeksi['lingkungan']['fasilitas_dekat_object'] ?? [],
|
$forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? [],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
? old(
|
? old(
|
||||||
'fasilitas_dekat_object',
|
'fasilitas_dekat_object',
|
||||||
$forminspeksi['lingkungan']['fasilitas_dekat_object'] ?? [],
|
$forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? [],
|
||||||
)
|
)
|
||||||
: explode(
|
: explode(
|
||||||
',',
|
',',
|
||||||
old(
|
old(
|
||||||
'fasilitas_dekat_object',
|
'fasilitas_dekat_object',
|
||||||
$forminspeksi['lingkungan']['fasilitas_dekat_object'] ?? '',
|
$forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? '',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@endphp
|
@endphp
|
||||||
@@ -359,9 +380,9 @@
|
|||||||
value="{{ $item->name }}"
|
value="{{ $item->name }}"
|
||||||
{{ in_array(
|
{{ in_array(
|
||||||
$item->name,
|
$item->name,
|
||||||
is_array(old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object'] ?? ''))
|
is_array(old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? ''))
|
||||||
? old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object'] ?? [])
|
? old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? [])
|
||||||
: explode(',', old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object'] ?? '')),
|
: explode(',', old('fasilitas_dekat_object', $forminspeksi['lingkungan']['fasilitas_dekat_object']['fasilitas_dekat_object'] ?? '')),
|
||||||
)
|
)
|
||||||
? 'checked'
|
? 'checked'
|
||||||
: '' }}
|
: '' }}
|
||||||
@@ -372,8 +393,9 @@
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||||
<input id="fasilitas_dekat_object_lainnya" type="text" style="display: none;"
|
<input id="fasilitas_dekat_object_lainnya" type="text" style="{{ in_array('Lainnya', $selectedFasilitas) ? '' : 'display: none' }}"
|
||||||
name="fasilitas_dekat_object_lainnya" class="input w-full mt-2"
|
name="fasilitas_dekat_object_lainnya" class="input w-full mt-2"
|
||||||
|
value="{{ old('fasilitas_dekat_object_lainnya', $forminspeksi['lingkungan']['fasilitas_dekat_object']['lainnya'] ?? '') }}"
|
||||||
placeholder="Masukkan lainnya..." />
|
placeholder="Masukkan lainnya..." />
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
@@ -91,15 +91,13 @@
|
|||||||
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
||||||
<select
|
<select
|
||||||
class="input w-full
|
class="input w-full
|
||||||
id="hadap_matangin_tidak_sesuai"
|
id="hadap_mata_angin_tidak_sesuai"
|
||||||
name="analisa_tanah_hadap_mata_angin_tidak_sesuai">
|
name="hadap_mata_angin_tidak_sesuai">
|
||||||
@php
|
@php
|
||||||
$statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])
|
$statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])
|
||||||
? 'sesuai'
|
? 'sesuai'
|
||||||
: 'tidak sesuai';
|
: 'tidak sesuai';
|
||||||
$selectedData =
|
$selectedData = $forminspeksi['tanah']['hadap_mata_angin'][$statusKey] ?? null;
|
||||||
$forminspeksi['tanah']['hadap_mata_angin'][$statusKey] ??
|
|
||||||
null;
|
|
||||||
@endphp
|
@endphp
|
||||||
<option value="">Select Hadap Mata Angin</option>
|
<option value="">Select Hadap Mata Angin</option>
|
||||||
@if (isset($basicData['arahMataAngin']))
|
@if (isset($basicData['arahMataAngin']))
|
||||||
@@ -139,7 +137,8 @@
|
|||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</label>
|
</label>
|
||||||
@if (strcasecmp($item->name, 'lainnya') == 0)
|
@if (strcasecmp($item->name, 'lainnya') == 0)
|
||||||
<input id="bentuk_tanah_lainnya" type="text" style="display: none;"
|
<input id="bentuk_tanah_lainnya" type="text"
|
||||||
|
style="{{ isset($forminspeksi['tanah']['bentuk_tanah']['lainnya']) && $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ? '' : 'display: none;' }}"
|
||||||
name="bentuk_tanah_lainnya" class="input w-full mt-2"
|
name="bentuk_tanah_lainnya" class="input w-full mt-2"
|
||||||
placeholder="Masukkan bentuk tanah..."
|
placeholder="Masukkan bentuk tanah..."
|
||||||
value="{{ old('bentuk_tanah_lainnya', $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ?? '') }}" />
|
value="{{ old('bentuk_tanah_lainnya', $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ?? '') }}" />
|
||||||
@@ -189,14 +188,17 @@
|
|||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</label>
|
</label>
|
||||||
@if (strcasecmp($item->name, 'Lebih Tinggi') == 0)
|
@if (strcasecmp($item->name, 'Lebih Tinggi') == 0)
|
||||||
<input id="input-lebih-tinggi" type="text" style="display: none;"
|
<input id="input-lebih-tinggi" type="text"
|
||||||
name="ketinggian_lebih_tinggi" class="input w-full mt-2"
|
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ? '' : 'display: none;' }}"
|
||||||
placeholder="m2" />
|
name="ketinggian_lebih_tinggi" class="input w-full mt-2" placeholder="m2"
|
||||||
|
value="{{ old('ketinggian_lebih_tinggi', $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ?? '') }}" />
|
||||||
@elseif (strcasecmp($item->name, 'Lebih Rendah') == 0)
|
@elseif (strcasecmp($item->name, 'Lebih Rendah') == 0)
|
||||||
<input id="input-lebih-rendah" type="text" style="display: none;"
|
<input id="input-lebih-rendah" type="text"
|
||||||
name="ketinggian_lebih_rendah" class="input w-full mt-2"
|
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ? '' : 'display: none;' }}"
|
||||||
placeholder="m2" />
|
name="ketinggian_lebih_rendah" class="input w-full mt-2" placeholder="m2"
|
||||||
|
value="{{ old('ketinggian_lebih_rendah', $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ?? '') }}" />
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
@@ -211,17 +213,18 @@
|
|||||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
|
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||||
<input type="radio" class="radio" name="kontur_jalan" value="menurun"
|
<input type="radio" class="radio" name="kontur_jalan" value="menurun"
|
||||||
{{ old('kontur_jalan', $forminspeksi['tanah']['kontur_jalan'] ?? '') == 'menurun' ? 'checked' : '' }}>
|
{{ old('kontur_jalan', isset($forminspeksi['tanah']['kontur_jalan']) ? $forminspeksi['tanah']['kontur_jalan'] : '') == 'menurun' ? 'checked' : '' }}>
|
||||||
<span class="ml-2">Menurun</span>
|
<span class="ml-2">Menurun</span>
|
||||||
</label>
|
</label>
|
||||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||||
<input type="radio" class="radio" name="kontur_jalan" value="rata"
|
<input type="radio" class="radio" name="kontur_jalan" value="rata"
|
||||||
{{ old('kontur_jalan', $forminspeksi['tanah']['kontur_jalan'] ?? '') == 'rata' ? 'checked' : '' }}>
|
{{ old('kontur_jalan', isset($forminspeksi['tanah']['kontur_jalan']) ? $forminspeksi['tanah']['kontur_jalan'] : '') == 'rata' ? 'checked' : '' }}>
|
||||||
<span class="ml-2">Rata</span>
|
<span class="ml-2">Rata</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<em id="error-kontur_jalan" class="alert text-danger text-sm"></em>
|
<em id="error-kontur_jalan" class="alert text-danger text-sm"></em>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
@@ -229,20 +232,31 @@
|
|||||||
<div class="flex-wrap items-stretch">
|
<div class="flex-wrap items-stretch">
|
||||||
<div class="flex flex-col items-start gap-4">
|
<div class="flex flex-col items-start gap-4">
|
||||||
@if (isset($basicData['posisiKavling']))
|
@if (isset($basicData['posisiKavling']))
|
||||||
|
@php
|
||||||
|
$selectedPosisiKavling = old(
|
||||||
|
'posisi_kavling',
|
||||||
|
$forminspeksi['tanah']['posisi_kavling']['posisi_kavling'] ?? [],
|
||||||
|
);
|
||||||
|
$lainnyaValue = old(
|
||||||
|
'posisi_kavling_lainnya',
|
||||||
|
$forminspeksi['tanah']['posisi_kavling']['lainnya'] ?? '',
|
||||||
|
);
|
||||||
|
@endphp
|
||||||
@foreach ($basicData['posisiKavling'] as $item)
|
@foreach ($basicData['posisiKavling'] as $item)
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||||
<input class="checkbox" name="posisi_kavling[]" type="checkbox"
|
<input class="checkbox" name="posisi_kavling[]" type="checkbox"
|
||||||
value="{{ $item->name }}"
|
value="{{ $item->name }}"
|
||||||
{{ in_array($item->name, old('posisi_kavling', $forminspeksi['tanah']['posisi_kavling']['posisi_kavling'] ?? [])) ? 'checked' : '' }}
|
{{ in_array($item->name, $selectedPosisiKavling) ? 'checked' : '' }}
|
||||||
onclick="toggleCheckboxVisibility('posisi_kavling', 'posisi_kavling_lainnya', ['Lainnya'])" />
|
onclick="toggleCheckboxVisibility('posisi_kavling', 'posisi_kavling_lainnya', ['Lainnya'])" />
|
||||||
{{ $item->name }}
|
{{ $item->name }}
|
||||||
</label>
|
</label>
|
||||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||||
<input id="posisi_kavling_lainnya" type="text" style="display: none;"
|
<input id="posisi_kavling_lainnya" type="text"
|
||||||
|
style="{{ $lainnyaValue ? '' : 'display: none' }}"
|
||||||
name="posisi_kavling_lainnya" class="input w-full mt-2"
|
name="posisi_kavling_lainnya" class="input w-full mt-2"
|
||||||
placeholder="Masukkan Posisi Kavling lainnya..."
|
placeholder="Masukkan Posisi Kavling lainnya..."
|
||||||
value="{{ old('posisi_kavling_lainnya', $forminspeksi['tanah']['posisi_kavling']['lainnya'] ?? '') }}" />
|
value="{{ $lainnyaValue }}" />
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -251,6 +265,7 @@
|
|||||||
<em id="error-posisi_kavling" class="alert text-danger text-sm"></em>
|
<em id="error-posisi_kavling" class="alert text-danger text-sm"></em>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Tusuk Sate -->
|
<!-- Tusuk Sate -->
|
||||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||||
<label class="form-label max-w-56">Tusuk Sate</label>
|
<label class="form-label max-w-56">Tusuk Sate</label>
|
||||||
|
|||||||
@@ -1,73 +1,5 @@
|
|||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
|
||||||
const ruteLainnyaDiv = document.getElementById("ruteLainnya");
|
|
||||||
const lantaiLainnyaDiv = document.getElementById("lantaiLainnya");
|
|
||||||
|
|
||||||
// Function to add delete event listeners to existing buttons
|
|
||||||
function addDeleteListeners(container) {
|
|
||||||
container.querySelectorAll(".delete-button").forEach(button => {
|
|
||||||
button.addEventListener("click", function() {
|
|
||||||
this.closest(
|
|
||||||
".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5"
|
|
||||||
).remove();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add delete listeners to existing buttons
|
|
||||||
addDeleteListeners(ruteLainnyaDiv);
|
|
||||||
addDeleteListeners(lantaiLainnyaDiv);
|
|
||||||
|
|
||||||
function createNewDiv(container, inputName) {
|
|
||||||
const newDiv = document.createElement("div");
|
|
||||||
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
|
|
||||||
newDiv.innerHTML = `
|
|
||||||
<label class="flex flex-col form-label max-w-56">
|
|
||||||
Masukkan nama ${inputName}
|
|
||||||
</label>
|
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
|
||||||
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
|
||||||
<div class="flex flex-wrap items-baseline px-2">
|
|
||||||
<input class="input" type="text" name="name_${inputName}[]">
|
|
||||||
</div>
|
|
||||||
<div class=" w-full flex flex-col gap-2">
|
|
||||||
<img id="foto_${inputName}-preview"
|
|
||||||
src="{{ isset($formFoto['gerbang']) ? asset('storage/' . $formFoto['gerbang']) : '' }}"
|
|
||||||
alt="Foto Gerbong" class="mt-2 max-w-full h-auto"
|
|
||||||
style="{{ isset($formFoto['gerbang']) ? '' : 'display: none;' }} width: 30rem;">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="input-group w-full flex gap-2">
|
|
||||||
<input id="inputLainnya" type="file" name="foto_${inputName}[]"
|
|
||||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera"
|
|
||||||
onchange="previewImage(this, 'foto_${inputName}-preview')"
|
|
||||||
>
|
|
||||||
<button type="button" id="btnCamera" class="btn btn-light"
|
|
||||||
data-modal-toggle="#cameraModal">
|
|
||||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<button type="button" class="btn btn-danger btn-sm delete-button">
|
|
||||||
<i class="ki-filled ki-trash"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
container.appendChild(newDiv);
|
|
||||||
addDeleteListeners(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
document.getElementById("btnAddMore").addEventListener("click", function() {
|
|
||||||
createNewDiv(ruteLainnyaDiv, "rute_lainnya");
|
|
||||||
});
|
|
||||||
|
|
||||||
document.getElementById("btnAddMoreObject").addEventListener("click", function() {
|
|
||||||
createNewDiv(lantaiLainnyaDiv, "lantai_lainnya");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -201,139 +133,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) {
|
|
||||||
const addButton = document.getElementById(buttonId);
|
|
||||||
const inputContainer = document.getElementById(containerId);
|
|
||||||
|
|
||||||
if (!addButton || !inputContainer) {
|
|
||||||
console.error(`Element with ID ${containerId} or ${buttonId} not found.`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateLabels() {
|
|
||||||
const labels = inputContainer.querySelectorAll('.form-label span');
|
|
||||||
labels.forEach((label, index) => {
|
|
||||||
label.textContent = `${labelText} ${index + 1}`;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleDeleteButtons() {
|
|
||||||
const deleteBtns = inputContainer.querySelectorAll(`.${buttonDeleteClass}`);
|
|
||||||
deleteBtns.forEach(btn => {
|
|
||||||
btn.style.display = inputContainer.children.length > 1 ? 'block' : 'none';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function createNewInput() {
|
|
||||||
const newDiv = inputContainer.children[0].cloneNode(true);
|
|
||||||
|
|
||||||
// Reset semua input dalam elemen baru
|
|
||||||
const inputFile = newDiv.querySelector(`.${inputDataClass}`);
|
|
||||||
if (inputFile) {
|
|
||||||
inputFile.id = `inputLingkungan-${inputContainer.children.length}`;
|
|
||||||
inputFile.value = ''; // Reset input file
|
|
||||||
|
|
||||||
// Tambahkan event listener untuk preview
|
|
||||||
inputFile.addEventListener('change', function () {
|
|
||||||
const file = this.files[0];
|
|
||||||
if (file) {
|
|
||||||
const reader = new FileReader();
|
|
||||||
reader.onload = function (e) {
|
|
||||||
const img = document.getElementById(
|
|
||||||
`foto_lingkungan_preview_${inputFile.id}`
|
|
||||||
);
|
|
||||||
img.src = e.target.result;
|
|
||||||
img.style.display = 'block';
|
|
||||||
};
|
|
||||||
reader.readAsDataURL(file);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tambahkan logika reset untuk elemen preview
|
|
||||||
const imgPreview = newDiv.querySelector('img');
|
|
||||||
if (imgPreview) {
|
|
||||||
imgPreview.src = '';
|
|
||||||
imgPreview.style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
const deleteBtn = newDiv.querySelector(`.${buttonDeleteClass}`);
|
|
||||||
if (deleteBtn) {
|
|
||||||
deleteBtn.addEventListener('click', function () {
|
|
||||||
inputContainer.removeChild(newDiv);
|
|
||||||
handleDeleteButtons();
|
|
||||||
updateLabels();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tambahkan container preview jika tidak ada
|
|
||||||
let previewContainer = newDiv.querySelector('.preview-container');
|
|
||||||
if (!previewContainer) {
|
|
||||||
previewContainer = document.createElement('div');
|
|
||||||
previewContainer.className = 'preview-container';
|
|
||||||
|
|
||||||
const img = document.createElement('img');
|
|
||||||
img.id = `foto_lingkungan_preview_${inputFile.id}`;
|
|
||||||
img.src = '';
|
|
||||||
img.className = 'mt-2 h-auto';
|
|
||||||
img.style.display = 'none';
|
|
||||||
img.style.width = '30rem';
|
|
||||||
previewContainer.appendChild(img);
|
|
||||||
|
|
||||||
const inputGroup = newDiv.querySelector('.input-group');
|
|
||||||
inputGroup.appendChild(previewContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
newDiv.style.marginTop = '10px';
|
|
||||||
inputContainer.appendChild(newDiv);
|
|
||||||
updateLabels();
|
|
||||||
handleDeleteButtons();
|
|
||||||
}
|
|
||||||
|
|
||||||
addButton.addEventListener('click', createNewInput);
|
|
||||||
|
|
||||||
// Terapkan event listener pada elemen yang sudah ada
|
|
||||||
const existingInputs = inputContainer.querySelectorAll(`.${inputDataClass}`);
|
|
||||||
existingInputs.forEach((input, index) => {
|
|
||||||
const deleteBtn = input.closest('.flex').querySelector(`.${buttonDeleteClass}`);
|
|
||||||
if (deleteBtn) {
|
|
||||||
deleteBtn.addEventListener('click', function () {
|
|
||||||
if (inputContainer.children.length > 1) {
|
|
||||||
inputContainer.removeChild(this.closest('.flex'));
|
|
||||||
handleDeleteButtons();
|
|
||||||
updateLabels();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
input.addEventListener('change', function () {
|
|
||||||
const file = this.files[0];
|
|
||||||
if (file) {
|
|
||||||
const reader = new FileReader();
|
|
||||||
reader.onload = function (e) {
|
|
||||||
const img = document.getElementById(
|
|
||||||
`foto_lingkungan_preview_${index}`
|
|
||||||
);
|
|
||||||
img.src = e.target.result;
|
|
||||||
img.style.display = 'block';
|
|
||||||
};
|
|
||||||
reader.readAsDataURL(file);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
updateLabels();
|
|
||||||
handleDeleteButtons();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setupInputHandlers('inputContainerRute', 'btnRute', 'Foto Rute Menuju Lokasi', 'file-input',
|
|
||||||
'delete-btn');
|
|
||||||
setupInputHandlers('inputContainerLantai', 'btnLantai', 'Foto Lantai', 'file-input', 'delete-btn');
|
|
||||||
setupInputHandlers('inputContainerLingkungan', 'btnLingkungan', 'Lingkungan', 'file-input',
|
|
||||||
'delete-btn');
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
204
resources/views/surveyor/js/fotojs.blade.php
Normal file
204
resources/views/surveyor/js/fotojs.blade.php
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
<script type="text/javascript">
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
const ruteLainnyaDiv = document.getElementById("ruteLainnya");
|
||||||
|
const lantaiLainnyaDiv = document.getElementById("lantaiLainnya");
|
||||||
|
|
||||||
|
// Function to add delete event listeners to existing buttons
|
||||||
|
function addDeleteListeners(container) {
|
||||||
|
container.querySelectorAll(".delete-button").forEach(button => {
|
||||||
|
button.addEventListener("click", function() {
|
||||||
|
this.closest(
|
||||||
|
".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5"
|
||||||
|
).remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add delete listeners to existing buttons
|
||||||
|
addDeleteListeners(ruteLainnyaDiv);
|
||||||
|
addDeleteListeners(lantaiLainnyaDiv);
|
||||||
|
|
||||||
|
function createNewDiv(container, inputName) {
|
||||||
|
const newDiv = document.createElement("div");
|
||||||
|
newDiv.className = "flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5";
|
||||||
|
newDiv.innerHTML = `
|
||||||
|
<label class="flex flex-col form-label max-w-56">
|
||||||
|
Masukkan nama ${inputName}
|
||||||
|
</label>
|
||||||
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
|
<div class="flex flex-col lg:flex-row gap-2 w-full">
|
||||||
|
<div class="flex flex-wrap items-baseline px-2">
|
||||||
|
<input class="input" type="text" name="name_${inputName}[]">
|
||||||
|
</div>
|
||||||
|
<div class=" w-full flex flex-col gap-2">
|
||||||
|
<img id="foto_${inputName}-preview"
|
||||||
|
src="{{ isset($formFoto['gerbang']) ? asset('storage/' . $formFoto['gerbang']) : '' }}"
|
||||||
|
alt="Foto Gerbong" class="mt-2 max-w-full h-auto"
|
||||||
|
style="{{ isset($formFoto['gerbang']) ? '' : 'display: none;' }} width: 30rem;">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="input-group w-full flex gap-2">
|
||||||
|
<input id="inputLainnya" type="file" name="foto_${inputName}[]"
|
||||||
|
class="file-input file-input-bordered w-full" accept="image/*" capture="camera"
|
||||||
|
onchange="previewImage(this, 'foto_${inputName}-preview')"
|
||||||
|
>
|
||||||
|
<button type="button" id="btnCamera" class="btn btn-light"
|
||||||
|
data-modal-toggle="#cameraModal">
|
||||||
|
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn btn-danger btn-sm delete-button">
|
||||||
|
<i class="ki-filled ki-trash"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
container.appendChild(newDiv);
|
||||||
|
addDeleteListeners(container);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("btnAddMore").addEventListener("click", function() {
|
||||||
|
createNewDiv(ruteLainnyaDiv, "rute_lainnya");
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("btnAddMoreObject").addEventListener("click", function() {
|
||||||
|
createNewDiv(lantaiLainnyaDiv, "lantai_lainnya");
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) {
|
||||||
|
const addButton = document.getElementById(buttonId);
|
||||||
|
const inputContainer = document.getElementById(containerId);
|
||||||
|
|
||||||
|
if (!addButton || !inputContainer) {
|
||||||
|
console.error(`Element with ID ${containerId} or ${buttonId} not found.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateLabels() {
|
||||||
|
const labels = inputContainer.querySelectorAll('.form-label span');
|
||||||
|
labels.forEach((label, index) => {
|
||||||
|
label.textContent = `${labelText} ${index + 1}`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDeleteButtons() {
|
||||||
|
const deleteBtns = inputContainer.querySelectorAll(`.${buttonDeleteClass}`);
|
||||||
|
deleteBtns.forEach(btn => {
|
||||||
|
btn.style.display = inputContainer.children.length > 1 ? 'block' : 'none';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function createNewInput() {
|
||||||
|
const newDiv = inputContainer.children[0].cloneNode(true);
|
||||||
|
|
||||||
|
// Reset semua input dalam elemen baru
|
||||||
|
const inputFile = newDiv.querySelector(`.${inputDataClass}`);
|
||||||
|
if (inputFile) {
|
||||||
|
inputFile.id = `inputLingkungan-${inputContainer.children.length}`;
|
||||||
|
inputFile.value = ''; // Reset input file
|
||||||
|
|
||||||
|
// Tambahkan event listener untuk preview
|
||||||
|
inputFile.addEventListener('change', function() {
|
||||||
|
const file = this.files[0];
|
||||||
|
if (file) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = function(e) {
|
||||||
|
const img = document.getElementById(
|
||||||
|
`foto_lingkungan_preview_${inputFile.id}`
|
||||||
|
);
|
||||||
|
img.src = e.target.result;
|
||||||
|
img.style.display = 'block';
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tambahkan logika reset untuk elemen preview
|
||||||
|
const imgPreview = newDiv.querySelector('img');
|
||||||
|
if (imgPreview) {
|
||||||
|
imgPreview.src = '';
|
||||||
|
imgPreview.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteBtn = newDiv.querySelector(`.${buttonDeleteClass}`);
|
||||||
|
if (deleteBtn) {
|
||||||
|
deleteBtn.addEventListener('click', function() {
|
||||||
|
inputContainer.removeChild(newDiv);
|
||||||
|
handleDeleteButtons();
|
||||||
|
updateLabels();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tambahkan container preview jika tidak ada
|
||||||
|
let previewContainer = newDiv.querySelector('.preview-container');
|
||||||
|
if (!previewContainer) {
|
||||||
|
previewContainer = document.createElement('div');
|
||||||
|
previewContainer.className = 'preview-container';
|
||||||
|
|
||||||
|
const img = document.createElement('img');
|
||||||
|
img.id = `foto_lingkungan_preview_${inputFile.id}`;
|
||||||
|
img.src = '';
|
||||||
|
img.className = 'mt-2 h-auto';
|
||||||
|
img.style.display = 'none';
|
||||||
|
img.style.width = '30rem';
|
||||||
|
previewContainer.appendChild(img);
|
||||||
|
|
||||||
|
const inputGroup = newDiv.querySelector('.input-group');
|
||||||
|
inputGroup.appendChild(previewContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
newDiv.style.marginTop = '10px';
|
||||||
|
inputContainer.appendChild(newDiv);
|
||||||
|
updateLabels();
|
||||||
|
handleDeleteButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
addButton.addEventListener('click', createNewInput);
|
||||||
|
|
||||||
|
// Terapkan event listener pada elemen yang sudah ada
|
||||||
|
const existingInputs = inputContainer.querySelectorAll(`.${inputDataClass}`);
|
||||||
|
existingInputs.forEach((input, index) => {
|
||||||
|
const deleteBtn = input.closest('.flex').querySelector(`.${buttonDeleteClass}`);
|
||||||
|
if (deleteBtn) {
|
||||||
|
deleteBtn.addEventListener('click', function() {
|
||||||
|
if (inputContainer.children.length > 1) {
|
||||||
|
inputContainer.removeChild(this.closest('.flex'));
|
||||||
|
handleDeleteButtons();
|
||||||
|
updateLabels();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
input.addEventListener('change', function() {
|
||||||
|
const file = this.files[0];
|
||||||
|
if (file) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = function(e) {
|
||||||
|
const img = document.getElementById(
|
||||||
|
`foto_lingkungan_preview_${index}`
|
||||||
|
);
|
||||||
|
img.src = e.target.result;
|
||||||
|
img.style.display = 'block';
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
updateLabels();
|
||||||
|
handleDeleteButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
setupInputHandlers('inputContainerRute', 'btnRute', 'Foto Rute Menuju Lokasi', 'file-input',
|
||||||
|
'delete-btn');
|
||||||
|
setupInputHandlers('inputContainerLantai', 'btnLantai', 'Foto Lantai', 'file-input', 'delete-btn');
|
||||||
|
setupInputHandlers('inputContainerLingkungan', 'btnLingkungan', 'Lingkungan', 'file-input',
|
||||||
|
'delete-btn');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -380,7 +380,7 @@ Breadcrumbs::for('tender.penawaran', function (BreadcrumbTrail $trail) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Breadcrumbs::for('tender.penawaran.show', function (BreadcrumbTrail $trail, $noreg) {
|
Breadcrumbs::for('tender.penawaran.show', function (BreadcrumbTrail $trail, $noreg) {
|
||||||
$trail->parent('tender.penawaran.ulang');
|
$trail->parent('tender');
|
||||||
$trail->push('Detail Penawaran', route('tender.penawaran.show', $noreg));
|
$trail->push('Detail Penawaran', route('tender.penawaran.show', $noreg));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -390,23 +390,22 @@ Breadcrumbs::for('tender.penawaran.createPenawaran', function (BreadcrumbTrail $
|
|||||||
});
|
});
|
||||||
|
|
||||||
Breadcrumbs::for('tender.penawaran.editPenawaran', function (BreadcrumbTrail $trail, $noreg) {
|
Breadcrumbs::for('tender.penawaran.editPenawaran', function (BreadcrumbTrail $trail, $noreg) {
|
||||||
$trail->parent('tender.penawaran.ulang');
|
$trail->parent('tender.penawaran');
|
||||||
$trail->push('Penawaran Ulang', route('tender.penawaran.editPenawaran', $noreg));
|
$trail->push('Penawaran Ulang', route('tender.penawaran.editPenawaran', $noreg));
|
||||||
});
|
});
|
||||||
|
|
||||||
Breadcrumbs::for('tender.penawaran.showSuratTender', function (BreadcrumbTrail $trail, $noreg) {
|
Breadcrumbs::for('tender.penawaran.showSuratTender', function (BreadcrumbTrail $trail, $noreg) {
|
||||||
$trail->parent('tender.penawaran.ulang');
|
$trail->parent('tender.penawaran');
|
||||||
$trail->push('Penawaran Ulang', route('tender.penawaran.editPenawaran', $noreg));
|
|
||||||
$trail->push('Surat Tender', route('tender.penawaran.showSuratTender', $noreg));
|
$trail->push('Surat Tender', route('tender.penawaran.showSuratTender', $noreg));
|
||||||
});
|
});
|
||||||
|
|
||||||
Breadcrumbs::for('tender.penawaran.suratTenderKJPP', function (BreadcrumbTrail $trail, $noreg, $id) {
|
Breadcrumbs::for('tender.penawaran.suratTenderKJPP', function (BreadcrumbTrail $trail, $noreg, $id) {
|
||||||
$trail->parent('tender.penawaran.showKirimEmail', ['noreg' => $noreg]);
|
$trail->parent('tender.penawaran');
|
||||||
$trail->push('Surat Tender KJPP', route('tender.penawaran.suratTenderKJPP', ['noreg' => $noreg, 'id' => $id]));
|
$trail->push('Surat Tender KJPP', route('tender.penawaran.suratTenderKJPP', ['noreg' => $noreg, 'id' => $id]));
|
||||||
});
|
});
|
||||||
|
|
||||||
Breadcrumbs::for('tender.penawaran.showKirimEmail', function (BreadcrumbTrail $trail, $noreg) {
|
Breadcrumbs::for('tender.penawaran.showKirimEmail', function (BreadcrumbTrail $trail, $noreg) {
|
||||||
$trail->parent('tender.penawaran.ulang');
|
$trail->parent('tender.penawaran');
|
||||||
$trail->push('Show Kirim Email Penawaran', route('tender.penawaran.showKirimEmail', $noreg));
|
$trail->push('Show Kirim Email Penawaran', route('tender.penawaran.showKirimEmail', $noreg));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -419,16 +418,17 @@ Breadcrumbs::for('tender.penawaran.ulang', function (BreadcrumbTrail $trail) {
|
|||||||
Breadcrumbs::for('surveyor', function (BreadcrumbTrail $trail) {
|
Breadcrumbs::for('surveyor', function (BreadcrumbTrail $trail) {
|
||||||
$trail->push('Surveyor', route('surveyor.index'));
|
$trail->push('Surveyor', route('surveyor.index'));
|
||||||
});
|
});
|
||||||
|
Breadcrumbs::for('surveyor.inspeksi', function (BreadcrumbTrail $trail) {
|
||||||
|
$trail->parent('surveyor');
|
||||||
|
$trail->push('Form Inspeksi');
|
||||||
|
});
|
||||||
|
|
||||||
Breadcrumbs::for('surveyor.show', function (BreadcrumbTrail $trail) {
|
Breadcrumbs::for('surveyor.show', function (BreadcrumbTrail $trail) {
|
||||||
$trail->parent('surveyor');
|
$trail->parent('surveyor');
|
||||||
$trail->push('Detail');
|
$trail->push('Detail');
|
||||||
});
|
});
|
||||||
|
|
||||||
Breadcrumbs::for('surveyor.form-inspeksi', function (BreadcrumbTrail $trail) {
|
|
||||||
$trail->parent('surveyor');
|
|
||||||
$trail->push('Form Inspeksi');
|
|
||||||
});
|
|
||||||
|
|
||||||
Breadcrumbs::for('surveyor.denah', function (BreadcrumbTrail $trail) {
|
Breadcrumbs::for('surveyor.denah', function (BreadcrumbTrail $trail) {
|
||||||
$trail->parent('surveyor');
|
$trail->parent('surveyor');
|
||||||
@@ -475,6 +475,12 @@ $basicDataRoutes = [
|
|||||||
'model-alat-berat' => 'Model Alat Berat',
|
'model-alat-berat' => 'Model Alat Berat',
|
||||||
'jenis-kapal' => 'Jenis kapal',
|
'jenis-kapal' => 'Jenis kapal',
|
||||||
'jenis-kendaraan' => 'Jenis kendaraan',
|
'jenis-kendaraan' => 'Jenis kendaraan',
|
||||||
|
'jenis-unit' => 'Jenis unit',
|
||||||
|
'terletak-area' => 'Terletak di Area',
|
||||||
|
'merupakan-daerah' => 'Merupakan Daerah',
|
||||||
|
'posisi-unit' => 'Posisi unit',
|
||||||
|
'bentuk-unit' => 'Bentuk unit',
|
||||||
|
'fasilitas-objek' => 'Fasilitas Umum Dekat Objek',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -556,6 +562,12 @@ Breadcrumbs::for('penilai.show', function (BreadcrumbTrail $trail) {
|
|||||||
$trail->push('Detail Penilai');
|
$trail->push('Detail Penilai');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Breadcrumbs::for('penilai.lampiran', function (BreadcrumbTrail $trail) {
|
||||||
|
$trail->parent('penilai');
|
||||||
|
$trail->push('Lampiran Foto dan Dokument');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Breadcrumbs::for('sla', function (BreadcrumbTrail $trail) {
|
Breadcrumbs::for('sla', function (BreadcrumbTrail $trail) {
|
||||||
$trail->parent('basicdata');
|
$trail->parent('basicdata');
|
||||||
$trail->push('SLA', route('basicdata.sla.index'));
|
$trail->push('SLA', route('basicdata.sla.index'));
|
||||||
|
|||||||
Reference in New Issue
Block a user