perbaikan basic data di form inspeksi tidak muncul
This commit is contained in:
@@ -312,8 +312,6 @@ class SurveyorController extends Controller
|
||||
$inspeksi->foto_form = json_encode($formatFotojson);
|
||||
$inspeksi->save();
|
||||
|
||||
|
||||
|
||||
return response()->json(['success' => true, 'message' => 'Data berhasil disimpan', 'data' => $formatFotojson], 200);
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['success' => false, 'message' => 'Failed to upload: ' . $e->getMessage()], 500);
|
||||
@@ -373,9 +371,6 @@ class SurveyorController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Custom validation request for foto
|
||||
*/
|
||||
@@ -495,8 +490,6 @@ class SurveyorController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function storeJadwal(Request $request)
|
||||
{
|
||||
try {
|
||||
@@ -537,10 +530,7 @@ class SurveyorController extends Controller
|
||||
public function storeAproved($id)
|
||||
{
|
||||
try {
|
||||
|
||||
|
||||
$penilaian = Penilaian::findOrFail($id);
|
||||
|
||||
$penilaian->update([
|
||||
'authorized_status' => 1,
|
||||
]);
|
||||
@@ -607,8 +597,6 @@ class SurveyorController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function formatSinglePembanding($request, $index)
|
||||
{
|
||||
$fields = [
|
||||
@@ -789,8 +777,6 @@ class SurveyorController extends Controller
|
||||
$branches = Branch::all();
|
||||
$provinces = Province::all();
|
||||
|
||||
|
||||
|
||||
$inpeksi = Inspeksi::where('permohonan_id', $id)->where('jenis_jaminan_id', $jaminanId)->first();
|
||||
|
||||
$formFoto = null;
|
||||
@@ -798,12 +784,6 @@ class SurveyorController extends Controller
|
||||
$formFoto = json_decode($inpeksi->foto_form, true);
|
||||
}
|
||||
$fotoJaminan = null;
|
||||
|
||||
// return response()->json([
|
||||
// 'inspeksi' => $formFoto,
|
||||
|
||||
// ]);
|
||||
|
||||
return view('lpj::surveyor.components.foto', compact('permohonan', 'surveyor', 'branches', 'provinces', 'fotoJaminan', 'formFoto'));
|
||||
}
|
||||
|
||||
@@ -851,7 +831,6 @@ class SurveyorController extends Controller
|
||||
throw new \Exception('Error decoding comparison data: ' . json_last_error_msg());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$fotoForm = json_decode($inspeksi->foto_form, true);
|
||||
|
||||
@@ -919,7 +898,6 @@ class SurveyorController extends Controller
|
||||
|
||||
public function createData($type)
|
||||
{
|
||||
|
||||
$spekKategoriBagunan = SpekKategoritBangunan::all();
|
||||
$header = $this->getHeader($type);
|
||||
return view('lpj::surveyor.data.form', compact('header', 'spekKategoriBagunan'));
|
||||
@@ -928,7 +906,6 @@ class SurveyorController extends Controller
|
||||
|
||||
public function storeData(SurveyorRequest $request, $type)
|
||||
{
|
||||
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
|
||||
@@ -1029,8 +1006,6 @@ class SurveyorController extends Controller
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$model = $modelClass::findOrFail($id);
|
||||
$model->update($validate);
|
||||
|
||||
@@ -1299,10 +1274,7 @@ class SurveyorController extends Controller
|
||||
if (!$modelClass) {
|
||||
return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400);
|
||||
}
|
||||
|
||||
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
$model->delete();
|
||||
return response()->json(['success' => true, 'message' => 'deleted successfully']);
|
||||
} catch (ModelNotFoundException $e) {
|
||||
@@ -1382,7 +1354,6 @@ class SurveyorController extends Controller
|
||||
{
|
||||
return [
|
||||
'branches' => Branch::all(),
|
||||
|
||||
'bentukTanah' => BentukTanah::all(),
|
||||
'konturTanah' => KonturTanah::all(),
|
||||
'posisiKavling' => PosisiKavling::all(),
|
||||
@@ -1413,6 +1384,8 @@ class SurveyorController extends Controller
|
||||
'jenisJaminan' => JenisJaminan::all(),
|
||||
'hubCadeb' => HubunganPemilikJaminan::all(),
|
||||
'hubPenghuni' => HubunganPenghuniJaminan::all(),
|
||||
'perkerasanJalan' => PerkerasanJalan::all(),
|
||||
'terletakDiArea' => TerletakArea::all(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1543,23 +1516,35 @@ class SurveyorController extends Controller
|
||||
$data = $request->all();
|
||||
$result = [];
|
||||
|
||||
// foreach ($data['nama_bangunan'] as $index => $bangunan) {
|
||||
// $bangunanData = [
|
||||
// 'bangunan' => $bangunan,
|
||||
// 'kategori' => []
|
||||
// ];
|
||||
|
||||
// foreach ($data['spek_kategori_bangunan'] as $kategoriIndex => $kategori) {
|
||||
// if (isset($data['spek_bangunan'][$kategori])) {
|
||||
// $bangunanData['kategori'][] = [
|
||||
// 'kategori' => $kategori,
|
||||
// 'spesifikasi' => $data['spek_bangunan'][$kategori]
|
||||
// ];
|
||||
// }
|
||||
// }
|
||||
|
||||
// $result[] = $bangunanData;
|
||||
// }
|
||||
foreach ($request->input('nama_bangunan') as $index => $buildingName) {
|
||||
if (empty($buildingName)) continue; // Skip if building name is empty
|
||||
|
||||
$buildingData = [];
|
||||
$buildingData['bagunan'] = $buildingName;
|
||||
|
||||
$specCategories = $request->input('spek_kategori_bangunan');
|
||||
$buildingData['spek_kategori_bangunan'] = [];
|
||||
|
||||
if (!empty($specCategories)) {
|
||||
foreach ($specCategories as $category) {
|
||||
if (empty($category)) continue; // Skip empty categories
|
||||
|
||||
$specs = $request->input("spek_bangunan.{$index}.{$category}", []);
|
||||
|
||||
// Only add category if it has specifications
|
||||
if (!empty($specs)) {
|
||||
$buildingData['spek_kategori_bangunan'][$category] = $specs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Only add building data if it has specifications
|
||||
if (!empty($buildingData['spek_kategori_bangunan'])) {
|
||||
$result[] = $buildingData;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return [
|
||||
'bangunan' => [
|
||||
@@ -1621,8 +1606,8 @@ class SurveyorController extends Controller
|
||||
'fakta_negatif' => $data['fakta_negatif'] ?? null,
|
||||
'rute_menuju' => $data['rute_menuju'] ?? null,
|
||||
'batas_batas' => $this->mapArrayWithInputs(
|
||||
$data['batas_batas'] ?? null,
|
||||
$data['batas_batas_input'] ?? null
|
||||
$data['batas_batas'] ?? [],
|
||||
$data['batas_batas_input'] ?? []
|
||||
),
|
||||
'kondisi_lingkungan' => $data['kondisi_lingkungan'] ?? null,
|
||||
'kondisi_lain_bangunan' => $data['kondisi_lain_bangunan'] ?? null,
|
||||
|
||||
@@ -104,9 +104,13 @@ class FormSurveyorRequest extends FormRequest
|
||||
'kondisi_bangunan' => 'nullable',
|
||||
'sifat_bangunan' => 'required|array',
|
||||
'sifat_bangunan_input' => 'nullable|array',
|
||||
'nama_bagunan' => 'required|nullable',
|
||||
'spek_kategori_bangunan.*' => 'required',
|
||||
'spek_bangunan.*' => 'required',
|
||||
|
||||
|
||||
'nama_bangunan.*' => 'required|string|max:255',
|
||||
'spek_kategori_bangunan.*' => 'nullable|string',
|
||||
'spek_bangunan.*.*' => 'array',
|
||||
'spek_bangunan.*.*.*' => 'string',
|
||||
|
||||
'sarana_pelengkap' => 'required',
|
||||
'sarana_pelengkap_input' => 'nullable|array',
|
||||
];
|
||||
@@ -549,7 +553,7 @@ class FormSurveyorRequest extends FormRequest
|
||||
'fakta_positif' => 'nullable|array',
|
||||
'fakta_negatif' => 'nullable|array',
|
||||
'rute_menuju' => 'nullable',
|
||||
'batas_batas' => 'nullable|array',
|
||||
'batas_batas' => 'required|array',
|
||||
'batas_batas_input' => 'nullable|array',
|
||||
'kondisi_lingkungan' => 'nullable|array',
|
||||
'kondisi_lain_bangunan' => 'nullable|array',
|
||||
|
||||
@@ -144,50 +144,102 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- Spek Bangunan -->
|
||||
|
||||
<div class="gap-2.5">
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Spek Bangunan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full" id="spek-bangunan-container">
|
||||
<div class="spek-bangunan w-full gap-4 mt-5">
|
||||
<input type="hidden" name="nama_bagunan[]" value="Bangunan">
|
||||
<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">
|
||||
@if (@isset($basicData['spekKategoriBangunan']))
|
||||
@foreach ($basicData['spekKategoriBangunan'] as $item)
|
||||
<div>
|
||||
<input type="hidden" name="spek_kategori_bangunan[]"
|
||||
value="{{ $item->name }}">
|
||||
<label
|
||||
class="form-label flex items-center gap-3 text-nowrap">{{ $item->name }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4" style="margin-top: 10px">
|
||||
@foreach ($basicData['spekBangunan'] as $spek)
|
||||
@if ($spek->spek_kategori_bangunan_id == $item->id)
|
||||
<label class="form-label flex items-center gap-2.5">
|
||||
<input class="checkbox"
|
||||
name="spek_bangunan[{{ $item->name }}][]"
|
||||
type="checkbox" value="{{ $spek->name }}" />
|
||||
{{ $spek->name }}
|
||||
</label>
|
||||
@endif
|
||||
@endforeach
|
||||
@if (isset($forminspeksi['bangunan']) && is_array($forminspeksi['bangunan']))
|
||||
@foreach ($forminspeksi['bangunan']['spesifikasi_bangunan'] as $index => $bangunan)
|
||||
<div class="spek-bangunan w-full gap-4 mt-5">
|
||||
<input type="hidden" name="nama_bangunan[]"
|
||||
value="{{ isset($bangunan['bagunan']) ? $bangunan['bagunan'] : 'Bangunan ' . ($index + 1) }}"
|
||||
required>
|
||||
<label
|
||||
class="building-label form-label">{{ isset($bangunan['bagunan']) ? $bangunan['bagunan'] : 'Bangunan ' . ($index + 1) }}</label>
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2 w-full">
|
||||
@if (@isset($basicData['spekKategoriBangunan']))
|
||||
@foreach ($basicData['spekKategoriBangunan'] as $item)
|
||||
<div>
|
||||
<input type="hidden" name="spek_kategori_bangunan[]"
|
||||
value="{{ $item->name }}">
|
||||
<label
|
||||
class="form-label flex items-center gap-3 text-nowrap">{{ $item->name }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4"
|
||||
style="margin-top: 10px">
|
||||
@foreach ($basicData['spekBangunan'] as $spek)
|
||||
@if ($spek->spek_kategori_bangunan_id == $item->id)
|
||||
<label
|
||||
class="form-label flex items-center gap-2.5">
|
||||
<input class="checkbox"
|
||||
name="spek_bangunan[{{ $index }}][{{ $item->name }}][]"
|
||||
type="checkbox"
|
||||
value="{{ $spek->name }}"
|
||||
{{ isset($bangunan['spek_kategori_bangunan'][$item->name]) &&
|
||||
in_array($spek->name, $bangunan['spek_kategori_bangunan'][$item->name])
|
||||
? 'checked'
|
||||
: '' }} />
|
||||
{{ $spek->name }}
|
||||
</label>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<em id="error-spek_bangunan_{{ $item->name }}"
|
||||
class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<button type="button"
|
||||
class="mt-2 btn btn-danger btn-outline btn-xs delete-button"
|
||||
style="display: none;">Hapus</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<!-- Default empty building form when no data exists -->
|
||||
<div class="spek-bangunan w-full gap-4 mt-5">
|
||||
<input type="text" name="nama_bangunan[]" value="Bangunan 1" required>
|
||||
<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">
|
||||
@if (@isset($basicData['spekKategoriBangunan']))
|
||||
@foreach ($basicData['spekKategoriBangunan'] as $item)
|
||||
<div>
|
||||
<input type="hidden" name="spek_kategori_bangunan[]"
|
||||
value="{{ $item->name }}">
|
||||
<label
|
||||
class="form-label flex items-center gap-3 text-nowrap">{{ $item->name }}</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4"
|
||||
style="margin-top: 10px">
|
||||
@foreach ($basicData['spekBangunan'] as $spek)
|
||||
@if ($spek->spek_kategori_bangunan_id == $item->id)
|
||||
<label class="form-label flex items-center gap-2.5">
|
||||
<input class="checkbox"
|
||||
name="spek_bangunan[0][{{ $item->name }}][]"
|
||||
type="checkbox"
|
||||
value="{{ $spek->name }}" />
|
||||
{{ $spek->name }}
|
||||
</label>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<em id="error-spek_bangunan_{{ $item->name }}"
|
||||
class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
<em id="error-spek_bangunan_{{ $item->name }}"
|
||||
class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<button type="button" class="mt-2 btn btn-danger btn-outline btn-xs delete-button"
|
||||
style="display: none;">Hapus</button>
|
||||
</div>
|
||||
<button type="button" class="mt-2 btn btn-danger btn-outline btn-xs delete-button"
|
||||
style="display: none;">Hapus</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
<button class="btn btn-xs btn-primary" type="button" id="addBagunan">
|
||||
tambah bangunan
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
@@ -245,11 +297,8 @@
|
||||
function updateDeleteButtonsVisibility() {
|
||||
const allDeleteButtons = spekBangunanContainer.querySelectorAll('.delete-button');
|
||||
allDeleteButtons.forEach(button => {
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
button.style.display = 'inline-block';
|
||||
} else {
|
||||
button.style.display = 'none';
|
||||
}
|
||||
button.style.display = spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1 ?
|
||||
'inline-block' : 'none';
|
||||
});
|
||||
}
|
||||
|
||||
@@ -257,64 +306,80 @@
|
||||
const allSpekBangunan = spekBangunanContainer.querySelectorAll('.spek-bangunan');
|
||||
allSpekBangunan.forEach((div, index) => {
|
||||
const label = div.querySelector('.building-label');
|
||||
const nameInput = div.querySelector('input[name^="nama_bangunan"]');
|
||||
if (label) {
|
||||
label.textContent = `Bangunan ${index + 1}`;
|
||||
const buildingName = `Bangunan ${index + 1}`;
|
||||
label.textContent = buildingName;
|
||||
if (nameInput) {
|
||||
nameInput.value = buildingName;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateInputNames(container, index) {
|
||||
container.querySelectorAll('input').forEach(input => {
|
||||
if (input.name) {
|
||||
if (input.name.includes('[')) {
|
||||
if (input.name.startsWith('spek_bangunan')) {
|
||||
// Handle spek_bangunan inputs
|
||||
const matches = input.name.match(/spek_bangunan\[\d+\]\[(.*?)\]/);
|
||||
if (matches) {
|
||||
input.name = `spek_bangunan[${index}][${matches[1]}][]`;
|
||||
}
|
||||
} else {
|
||||
// Handle other array inputs
|
||||
input.name = input.name.replace(/\[\d*\]/, `[${index}]`);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('addBagunan').addEventListener('click', function() {
|
||||
const newDiv = spekBangunanContainer.querySelector('.spek-bangunan').cloneNode(true);
|
||||
const newIndex = spekBangunanContainer.querySelectorAll('.spek-bangunan').length;
|
||||
|
||||
// Update input fields
|
||||
newDiv.querySelectorAll('select, input').forEach((input, index) => {
|
||||
if (input.type === 'checkbox' || input.type === 'radio') {
|
||||
// Reset and update inputs
|
||||
newDiv.querySelectorAll('input').forEach(input => {
|
||||
if (input.type === 'checkbox') {
|
||||
input.checked = false;
|
||||
} else {
|
||||
input.value = '';
|
||||
}
|
||||
|
||||
// Update name attribute
|
||||
if (input.name) {
|
||||
const baseName = input.name.split('[')[0]; // Get the base name
|
||||
const count = spekBangunanContainer.querySelectorAll('.spek-bangunan').length + 1;
|
||||
input.name = `${baseName}[${count}]`;
|
||||
}
|
||||
});
|
||||
|
||||
// Append the cloned div
|
||||
spekBangunanContainer.appendChild(newDiv);
|
||||
// Update input names
|
||||
updateInputNames(newDiv, newIndex);
|
||||
|
||||
// Add event listener to the delete button in the cloned div
|
||||
newDiv.querySelector('.delete-button').addEventListener('click', function() {
|
||||
spekBangunanContainer.removeChild(newDiv);
|
||||
// Add delete button handler
|
||||
const deleteButton = newDiv.querySelector('.delete-button');
|
||||
deleteButton.addEventListener('click', function() {
|
||||
newDiv.remove();
|
||||
updateDeleteButtonsVisibility();
|
||||
updateBuildingLabels();
|
||||
});
|
||||
|
||||
// Update UI
|
||||
// Append and update UI
|
||||
spekBangunanContainer.appendChild(newDiv);
|
||||
updateDeleteButtonsVisibility();
|
||||
updateBuildingLabels();
|
||||
});
|
||||
|
||||
|
||||
// Initial setup: Ensure "Bangunan 1" is labeled
|
||||
// Initialize on page load
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
updateDeleteButtonsVisibility();
|
||||
updateBuildingLabels(); // Ensure the first label is set
|
||||
});
|
||||
updateBuildingLabels();
|
||||
|
||||
// Add delete functionality to the initial form
|
||||
spekBangunanContainer.querySelectorAll('.delete-button').forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
const spekBangunan = this.closest('.spek-bangunan');
|
||||
|
||||
// Make sure not to delete the last remaining form
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
spekBangunan.remove();
|
||||
updateDeleteButtonsVisibility();
|
||||
updateBuildingLabels(); // Update the labels after removing
|
||||
}
|
||||
// Add delete handlers to existing buttons
|
||||
spekBangunanContainer.querySelectorAll('.delete-button').forEach(button => {
|
||||
button.addEventListener('click', function() {
|
||||
if (spekBangunanContainer.querySelectorAll('.spek-bangunan').length > 1) {
|
||||
this.closest('.spek-bangunan').remove();
|
||||
updateDeleteButtonsVisibility();
|
||||
updateBuildingLabels();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -74,11 +74,8 @@
|
||||
<div class="flex flex-col gap-2">
|
||||
<img id="uploadedImage2" class="max-w-[200px] hidden"
|
||||
alt="Pembanding Image">
|
||||
<input type="file"
|
||||
name="foto_objek_pembanding[]"
|
||||
class="file-input"
|
||||
accept="image/*"
|
||||
onchange="previewImage(this, 'uploadedImage2')">
|
||||
<input type="file" name="foto_objek_pembanding[]" class="file-input"
|
||||
accept="image/*" onchange="previewImage(this, 'uploadedImage2')">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -243,15 +240,14 @@
|
||||
</select>
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<select id="province_code" name="province_code_pembanding[]"
|
||||
<select id="province_code_pembanding" name="province_code_pembanding[]"
|
||||
class="input w-full">
|
||||
<option value="">Select Province</option>
|
||||
@foreach ($provinces as $province)
|
||||
|
||||
<option value="{{ $province->code }}">
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
|
||||
<option value="{{ $province->code }}"
|
||||
{{ $selectedProvince == $province->code ? 'selected' : '' }}>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
@@ -283,17 +279,11 @@
|
||||
</select>
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<select id="city_code" name="city_code_pembanding[]"
|
||||
<select id="city_code_pembanding" name="city_code_pembanding[]"
|
||||
class="input w-full">
|
||||
|
||||
<option value="">Pilih Kota/Kabupaten</option>
|
||||
@if (isset($cities))
|
||||
@foreach ($cities as $city)
|
||||
<option value="{{ $city->code }}">
|
||||
{{ $city->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -325,17 +315,11 @@
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
|
||||
<select id="district_code" name="district_code_pembanding[]"
|
||||
<select id="district_code_pembanding" name="district_code_pembanding[]"
|
||||
class="input w-full">
|
||||
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
@if (isset($districts))
|
||||
@foreach ($districts as $district)
|
||||
<option value="{{ $district->code }}">
|
||||
{{ $district->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -365,17 +349,11 @@
|
||||
</select>
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<select id="village_code" name="village_code_pembanding[]"
|
||||
<select id="village_code_pembanding" name="village_code_pembanding[]"
|
||||
class="input w-full">
|
||||
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
@if (isset($villages))
|
||||
@foreach ($villages as $village)
|
||||
<option value="{{ $village->code }}">
|
||||
{{ $village->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -569,7 +547,7 @@
|
||||
|
||||
// Update IDs and names for the new cell
|
||||
const inputs = newCell.querySelectorAll('input, select, textarea');
|
||||
inputs.forEach(input => {
|
||||
inputs.forEach((input, index) => {
|
||||
if (input.type === 'file') {
|
||||
const newImageId = `uploadedImage${columnCount + 1}`;
|
||||
const preview = newCell.querySelector('img');
|
||||
@@ -582,11 +560,20 @@
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (input.id) {
|
||||
input.id = updateDynamicId(input.id, columnCount);
|
||||
}
|
||||
|
||||
// Clear values
|
||||
if (input.type !== 'file') {
|
||||
input.value = '';
|
||||
}
|
||||
|
||||
loadIdSelectAddres(input.id);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
row.appendChild(newCell);
|
||||
});
|
||||
@@ -595,6 +582,10 @@
|
||||
reinitializeEventListeners();
|
||||
}
|
||||
|
||||
function updateDynamicId(currentId, columnCount) {
|
||||
return `${currentId.split('_')[0]}_${'code_pembanding'}_${columnCount}`;
|
||||
}
|
||||
|
||||
function removeColumn() {
|
||||
if (columnCount > 1) {
|
||||
const table = document.getElementById('dataTable');
|
||||
@@ -740,6 +731,124 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadIdSelectAddres(inputs) {
|
||||
const data = [
|
||||
'province_code_pembanding',
|
||||
'city_code_pembanding',
|
||||
'district_code_pembanding',
|
||||
'village_code_pembanding'
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Memuat data provinsi saat halaman dimuat
|
||||
loadProvinces();
|
||||
|
||||
// Event listener untuk perubahan pada dropdown Province
|
||||
document.getElementById('province_code_pembanding').addEventListener('change', function() {
|
||||
const provinceId = this.value;
|
||||
if (provinceId) {
|
||||
getCity(provinceId); // Kirimkan provinceId ke fungsi getCity
|
||||
} 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
|
||||
document.getElementById('city_code_pembanding').addEventListener('change', function() {
|
||||
const cityId = this.value;
|
||||
if (cityId) {
|
||||
getDistrict(cityId);
|
||||
} else {
|
||||
resetDropdown('district_code_pembanding', 'Select District');
|
||||
resetDropdown('village_code_pembanding', 'Select Village');
|
||||
}
|
||||
});
|
||||
|
||||
// Event listener untuk perubahan pada dropdown District
|
||||
document.getElementById('district_code_pembanding').addEventListener('change', function() {
|
||||
const districtId = this.value;
|
||||
if (districtId) {
|
||||
getVillage(districtId);
|
||||
} else {
|
||||
resetDropdown('village_code_pembanding', 'Select Village');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
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) {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`/locations/cities/province/${provinceId}`); // Assuming this is still your API
|
||||
const data = await response.json();
|
||||
|
||||
const cityDropdown = document.getElementById('city_code_pembanding');
|
||||
cityDropdown.innerHTML = '<option value="">Select City</option>';
|
||||
|
||||
data.forEach(city => {
|
||||
cityDropdown.innerHTML += `<option value="${city.code}">${city.name}</option>`;
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error fetching cities:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async function getDistrict(cityId) {
|
||||
try {
|
||||
const response = await fetch(`/locations/districts/city/${cityId}`);
|
||||
const data = await response.json();
|
||||
|
||||
const districtDropdown = document.getElementById('district_code_pembanding');
|
||||
districtDropdown.innerHTML = '<option value="">Select District</option>';
|
||||
|
||||
data.forEach(district => {
|
||||
districtDropdown.innerHTML += `<option value="${district.code}">${district.name}</option>`;
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error fetching districts:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async function getVillage(districtId) {
|
||||
try {
|
||||
const response = await fetch(`/locations/villages/district/${districtId}`);
|
||||
const data = await response.json();
|
||||
|
||||
const villageDropdown = document.getElementById('village_code_pembanding');
|
||||
villageDropdown.innerHTML = '<option value="">Select Village</option>';
|
||||
|
||||
data.forEach(village => {
|
||||
villageDropdown.innerHTML += `<option value="${village.code}">${village.name}</option>`;
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error fetching villages:', error);
|
||||
}
|
||||
}
|
||||
|
||||
function resetDropdown(elementId, placeholder) {
|
||||
const dropdown = document.getElementById(elementId);
|
||||
dropdown.innerHTML = `<option value="">${placeholder}</option>`;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -79,8 +79,8 @@
|
||||
<label class="form-label max-w-56">Batas batas</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="grid grid-cols-1 gap-4 items-center w-full">
|
||||
@if (isset($arahMataAngin))
|
||||
@foreach ($arahMataAngin as $item)
|
||||
@if (isset($basicData['arahMataAngin']))
|
||||
@foreach ($basicData['arahMataAngin'] as $item)
|
||||
@php
|
||||
$isChecked = false;
|
||||
$inputValue = '';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<div class=" card w-full bg-white rounded-lg shadow-md ">
|
||||
|
||||
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
<h3 class="card-title uppercase">
|
||||
Form Inspeksi
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -11,9 +9,6 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card-body">
|
||||
<div class="py-4">
|
||||
<h1 class="text-md font-medium text-gray-900">Order Penilaian</h1>
|
||||
@@ -127,13 +122,17 @@
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['jenis_asset']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||
$selectedValue = $forminspeksi['asset']['jenis_asset'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<div id="jenis_asset" class="flex items-baseline gap-2"
|
||||
style="{{ isset($forminspeksi['asset']['jenis_asset']['tidak sesuai']) ? '' : 'display: none;' }}">
|
||||
style="{{ isset($selectedValue) === 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
<select id="jenis_asset_tidak_sesuai" class="input w-full"
|
||||
name="jenis_asset_tidak_sesuai">
|
||||
<option value="">Select Jenis asset</option>
|
||||
@if (isset($jenisJaminan))
|
||||
@foreach ($jenisJaminan as $item)
|
||||
@if (isset($basicData['jenisJaminan']))
|
||||
@foreach ($basicData['jenisJaminan'] as $item)
|
||||
<option value="{{ $item->id }}"
|
||||
{{ old('jenis_asset_tidak_sesuai', $forminspeksi['asset']['jenis_asset_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
@@ -163,22 +162,14 @@
|
||||
<div class="flex-wrap items-stretch">
|
||||
<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">
|
||||
<input
|
||||
onclick="updateAlamatFields('sesuai')"
|
||||
type="radio"
|
||||
class="radio"
|
||||
name="alamat_sesuai"
|
||||
value="sesuai"
|
||||
<input onclick="updateAlamatFields('sesuai')" type="radio" class="radio"
|
||||
name="alamat_sesuai" value="sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input
|
||||
onclick="updateAlamatFields('tidak sesuai')"
|
||||
type="radio"
|
||||
class="radio"
|
||||
name="alamat_sesuai"
|
||||
value="tidak sesuai"
|
||||
<input onclick="updateAlamatFields('tidak sesuai')" type="radio" class="radio"
|
||||
name="alamat_sesuai" value="tidak sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
@@ -186,7 +177,14 @@
|
||||
<em id="error-alamat" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
<div id="alamat_form" class="grid gap-2 mt-5" style="{{ isset($forminspeksi['asset']['alamat']['tidak sesuai']) ? '' : 'display: none;' }}">
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['alamat']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||
$address = $forminspeksi['asset']['alamat'][$statusKey] ?? null;
|
||||
|
||||
@endphp
|
||||
|
||||
<div id="alamat_form" class="grid gap-2 mt-5"
|
||||
style="{{ isset($address) ? '' : 'display: none;' }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="address" class="form-label max-w-56">Jl.</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@@ -204,12 +202,12 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province_code" class="form-label max-w-56">Provinsi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<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>
|
||||
@foreach ($provinces as $province)
|
||||
@if (isset($debitur))
|
||||
<option value="{{ $province->code }}"
|
||||
{{ isset($debitur->province_code) && $debitur->province_code == $province->code ? 'selected' : '' }}>
|
||||
{{ isset($debitur->province_code) && $debitur->province_code == $province->code ? 'selected' : '' }}>
|
||||
{{ $province->name }}
|
||||
</option>
|
||||
@else
|
||||
@@ -451,13 +449,19 @@
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['hub_cadeb']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['asset']['hub_cadeb'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<select id="hub_cadeb_tidak_sesuai"
|
||||
class="input w-full
|
||||
name="hub_cadeb_tidak_sesuai"
|
||||
style="{{ old('hub_cadeb', $forminspeksi['asset']['hub_cadeb'] ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
style="{{ old('hub_cadeb', $selectedData ?? '') == 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
<option value="">Select Hubungan Cadeb</option>
|
||||
@if (isset($hubCadeb))
|
||||
@foreach ($hubCadeb as $item)
|
||||
@if (isset($basicData['hubCadeb']))
|
||||
@foreach ($basicData['hubCadeb'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_cadeb_tidak_sesuai', $forminspeksi['asset']['hub_cadeb_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
@@ -506,13 +510,19 @@
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['asset']['hub_cadeb_penghuni'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<select id="hub_cadeb_Penghuni_tidak_sesuai"
|
||||
class="input w-full
|
||||
name="hub_cadeb_Penghuni_tidak_sesuai"
|
||||
style="{{ old('hub_cadeb', isset($forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
||||
style="{{ old('hub_cadeb', $selectedData) ? '' : 'display: none;' }}">
|
||||
<option value="">Select Hubungan Cadeb</option>
|
||||
@if (isset($hubPenghuni))
|
||||
@foreach ($hubPenghuni as $item)
|
||||
@if (isset($basicData['hubPenghuni']))
|
||||
@foreach ($basicData['hubPenghuni'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_cadeb_Penghuni_tidak_sesuai', $forminspeksi['asset']['hub_cadeb_Penghuni_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!-- Informasi Tata Ruang -->
|
||||
<div class="card w-full bg-white">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title uppercase">
|
||||
Informasi Dinas Tata Ruang
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="py-4">
|
||||
<h1 class="text-md font-medium text-gray-900">Informasi Dinas Tata Ruang</h1>
|
||||
</div>
|
||||
<!-- Informasi Tata Ruang Form -->
|
||||
<div class="grid gap-5">
|
||||
|
||||
|
||||
@php
|
||||
$inputDinasTata = [
|
||||
[
|
||||
|
||||
@@ -182,8 +182,10 @@
|
||||
loadingOverlay.classList.remove('hidden');
|
||||
loadingOverlay.classList.add('flex');
|
||||
|
||||
const formElement = $('#formInspeksi')[0];
|
||||
const formData = new FormData(formElement);
|
||||
const form = document.querySelector('form');
|
||||
const formData = new FormData(form);
|
||||
console.log('Form data entries:', Array.from(formData.entries()));
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '{{ route('surveyor.store') }}',
|
||||
@@ -203,8 +205,8 @@
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.href =
|
||||
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
// window.location.href =
|
||||
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['perkerasanJalan']))
|
||||
@foreach ($basisData['perkerasanJalan'] as $item)
|
||||
@foreach ($basicData['perkerasanJalan'] as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="perkerasan_jalan[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="grid gap-5">
|
||||
<!-- Luas tanah -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -53,66 +52,73 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Hadap Mata Angin -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Hadap Mata Angin</label>
|
||||
<div class="mt-2">
|
||||
@if (isset($permohonan->debiture->documents))
|
||||
@if (isset($permohonan->debiture->documents))
|
||||
@foreach ($permohonan->debiture->documents as $item)
|
||||
@php
|
||||
$luas = $item->detail;
|
||||
$details = json_decode($luas[0]->details, true);
|
||||
$hadap_mata_angin = isset($details['hadap_mata_angin']) ? $details['hadap_mata_angin'] : 'N/A';
|
||||
$hadap_mata_angin = isset($details['hadap_mata_angin'])
|
||||
? $details['hadap_mata_angin']
|
||||
: 'N/A';
|
||||
@endphp
|
||||
<input type="hidden" name="hadap_mata_angin_sesuai" class="input" value="{{ $hadap_mata_angin }}">
|
||||
<input type="hidden" name="hadap_mata_angin_sesuai" class="input"
|
||||
value="{{ $hadap_mata_angin }}">
|
||||
<p class="text-2sm text-gray-700">{{ $hadap_mata_angin }} m<sup>2</sup></p>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="flex-wrap items-stretch">
|
||||
<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">
|
||||
<input type="radio" class="radio" name="hadap_mata_angin" value="sesuai"
|
||||
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
|
||||
{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
<div class="flex-wrap items-stretch">
|
||||
<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">
|
||||
<input type="radio" class="radio" name="hadap_mata_angin" value="sesuai"
|
||||
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
|
||||
{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="hadap_mata_angin" value="tidak sesuai"
|
||||
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
|
||||
{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="hadap_mata_angin" value="tidak sesuai"
|
||||
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
|
||||
{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
|
||||
<div id="hadap_mata_angin_tidak_sesuai" class="flex items-baseline gap-2"
|
||||
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
||||
<select class="input w-full
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
<div id="hadap_mata_angin_tidak_sesuai" class="flex items-baseline gap-2"
|
||||
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
||||
<select
|
||||
class="input w-full
|
||||
id="hadap_matangin_tidak_sesuai"
|
||||
name="analisa_tanah_hadap_mata_angin_tidak_sesuai">
|
||||
<option value="">Select Hadap Mata Angin</option>
|
||||
@if (isset($basicData['arahMataAngin']))
|
||||
@foreach ($basicData['arahMataAngin'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadap_mata_angin_tidak_sesuai', $forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
{{-- <button type="button" class="btn btn-md btn-primary" onclick="updateAnalisa('hadap_mata_angin')">Save</button> --}}
|
||||
name="analisa_tanah_hadap_mata_angin_tidak_sesuai">
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedData =
|
||||
$forminspeksi['tanah']['hadap_mata_angin'][$statusKey] ??
|
||||
null;
|
||||
@endphp
|
||||
<option value="">Select Hadap Mata Angin</option>
|
||||
@if (isset($basicData['arahMataAngin']))
|
||||
@foreach ($basicData['arahMataAngin'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadap_mata_angin_tidak_sesuai', $selectedData ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
{{-- <button type="button" class="btn btn-md btn-primary" onclick="updateAnalisa('hadap_mata_angin')">Save</button> --}}
|
||||
</div>
|
||||
</div>
|
||||
<em id="error-hadap_mata_angin" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
<em id="error-hadap_mata_angin" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Bentuk Tanah -->
|
||||
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Bentuk Tanah</label>
|
||||
<div class="flex-wrap items-stretch">
|
||||
@@ -164,8 +170,6 @@
|
||||
<em id="error-kontur_tanah" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Beda Ketinggian Dengan Jalan -->
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Beda Ketinggian Dengan Jalan</label>
|
||||
@@ -200,10 +204,6 @@
|
||||
<em id="error-ketinggian_jalan" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Kontur Jalan Depan Objek -->
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Kontur Jalan Depan Objek</label>
|
||||
@@ -224,7 +224,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Posisi Kavling</label>
|
||||
<div class="flex-wrap items-stretch">
|
||||
@@ -242,7 +241,8 @@
|
||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||
<input id="posisi_kavling_lainnya" type="text" style="display: none;"
|
||||
name="posisi_kavling_lainnya" class="input w-full mt-2"
|
||||
placeholder="Masukkan Posisi Kavling lainnya..." value="{{ old('posisi_kavling_lainnya', $forminspeksi['tanah']['posisi_kavling']['lainnya'] ?? '') }}" />
|
||||
placeholder="Masukkan Posisi Kavling lainnya..."
|
||||
value="{{ old('posisi_kavling_lainnya', $forminspeksi['tanah']['posisi_kavling']['lainnya'] ?? '') }}" />
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@@ -251,8 +251,6 @@
|
||||
<em id="error-posisi_kavling" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Tusuk Sate -->
|
||||
<div class="flex items-stretch flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tusuk Sate</label>
|
||||
@@ -323,6 +321,7 @@
|
||||
<em id="error-kondisi_fisik_tanah" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user