update preview foto dan alamat surveyor
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@include('lpj::assetsku.includenya')
|
||||
@include('lpj::assetsku.includenya')
|
||||
<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">
|
||||
@@ -14,8 +14,7 @@
|
||||
Data Jaminan
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('surveyor.show', ['id' => request('foto')]) }}"
|
||||
class="btn btn-xs btn-info">
|
||||
<a href="{{ route('surveyor.show', ['id' => request('foto')]) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
</div>
|
||||
@@ -334,32 +333,35 @@
|
||||
|
||||
@if (count($objekViews) > 0)
|
||||
@foreach ($objekViews as $view)
|
||||
<div class="flex flex-wrap gap-4 {{ !$loop->first ? 'mt-2' : '' }}">
|
||||
<div class="flex w-full gap-4">
|
||||
<label class="form-label max-w-56"><span
|
||||
class="form-label">{{ $view['label'] }}</span></label>
|
||||
<input type="hidden" class="form-control"
|
||||
name="name_objek[]" value="{{ $view['label'] }}" />
|
||||
<div class="w-full grid gap-5">
|
||||
<img id="foto_object_jaminan_preview_{{ $view['index'] }}"
|
||||
src="{{ isset($formFoto['object_jaminan'][$view['index']]['foto_object']) ? asset('storage/' . $formFoto['object_jaminan'][$view['index']]['foto_object']) : '' }}"
|
||||
alt="{{ $view['label'] }}" class="mb-2 w-48 h-auto"
|
||||
style="{{ isset($formFoto['object_jaminan'][$view['index']]['foto_object']) ? '' : 'display: none;' }} width: 30rem;">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept="image/*" capture="camera">
|
||||
<button type="button" id="btnCamera"
|
||||
class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<textarea name="deskripsi_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($formFoto['object_jaminan'][$view['index']]) ? str_replace($view['label'] . ': ', '', $formFoto['object_jaminan'][$view['index']]['deskripsi_objek']) : '' }}</textarea>
|
||||
<div class="flex flex-wrap gap-4 {{ !$loop->first ? 'mt-2' : '' }}">
|
||||
<div class="flex w-full gap-4">
|
||||
<label class="form-label max-w-56"><span
|
||||
class="form-label">{{ $view['label'] }}</span></label>
|
||||
<input type="hidden" class="form-control"
|
||||
name="name_objek[]" value="{{ $view['label'] }}" />
|
||||
<div class="w-full grid gap-5">
|
||||
<img id="foto_object_jaminan_preview_{{ $view['index'] }}"
|
||||
src="{{ isset($formFoto['object_jaminan'][$view['index']]['foto_objek']) ? asset('storage/' . $formFoto['object_jaminan'][$view['index']]['foto_objek']) : '' }}"
|
||||
alt="{{ $view['label'] }}" class="mb-2 h-auto"
|
||||
|
||||
style="{{ isset($formFoto['object_jaminan'][$view['index']]['foto_objek']) ? 'width: 30rem;' : 'display: none;' }}"
|
||||
onerror="this.style.display='none';" />
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="file" name="foto_objek[]"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept="image/*" capture="camera"
|
||||
onchange="previewImage(this, 'foto_object_jaminan_preview_{{ $view['index'] }}')">
|
||||
<button type="button" id="btnCamera"
|
||||
class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<textarea name="deskripsi_objek[]" class="textarea" rows="3" placeholder="Deskripsi">{{ isset($formFoto['object_jaminan'][$view['index']]) ? str_replace($view['label'] . ': ', '', $formFoto['object_jaminan'][$view['index']]['deskripsi_objek']) : '' }}</textarea>
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@@ -391,7 +393,7 @@
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Foto Lantai 1</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
<div class="input-group w-full grid gap-5">
|
||||
<img src="{{ asset('storage/' . old('foto_lantai_unit', $item['foto_lantai_unit'])) }}"
|
||||
alt="Gambar Pendamping" style="width: 30rem;">
|
||||
<input type="hidden" name="name_lantai_unit[]" value="lantai">
|
||||
@@ -436,30 +438,33 @@
|
||||
|
||||
<div id="inputContainerBasement" class="w-full" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Basement</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex flex-col gap-2">
|
||||
<input type="hidden" name="name_basement" value="basement">
|
||||
<img id="foto_basement_preview"
|
||||
src="{{ isset($formFoto['foto_basement']) ? asset('storage/' . old('foto_basement', $formFoto['foto_basement'])) : '#' }}"
|
||||
alt="Gambar foto_basement" style="width: 30rem;"
|
||||
onerror="this.style.display='none';"
|
||||
onchange="previewImage(this, 'foto_basement_preview')">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputBasement" type="file" name="foto_basement"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Basement</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex flex-col gap-2">
|
||||
<input type="hidden" name="name_basement" value="basement">
|
||||
<img id="foto_basement_preview"
|
||||
src="{{ isset($formFoto['foto_basement']) ? asset('storage/' . old('foto_basement', $formFoto['foto_basement'])) : '#' }}"
|
||||
alt="Gambar foto_basement" style="width: 30rem;"
|
||||
onerror="this.style.display='none';"
|
||||
onchange="previewImage(this, 'foto_basement_preview')">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputBasement" type="file" name="foto_basement"
|
||||
class="file-input file-input-bordered w-full" accept="image/*"
|
||||
capture="camera">
|
||||
<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>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<span id="alertBasement" class="alert text-danger text-sm"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="lantaiLainnya" style="margin-top: 10px"></div>
|
||||
|
||||
@@ -475,63 +480,69 @@
|
||||
|
||||
<div class="card bg-white rounded-lg shadow-md">
|
||||
<div class="card-body">
|
||||
<div class="text-white py-4 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Lingkungan</h1>
|
||||
<button id="btnLingkungan" type="button" class="btn btn-primary btn-sm">
|
||||
<i class="ki-filled ki-plus text-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (isset($formFoto['lingkungan']) && is_array($formFoto['lingkungan']) && count($formFoto['lingkungan']) > 0)
|
||||
@foreach ($formFoto['lingkungan'] as $key => $item)
|
||||
<div id="inputContainerLingkungan_{{ $key }}" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
<img id="foto_lingkungan_preview_{{ $key }}"
|
||||
src="{{ asset('storage/' . old('foto_lingkungan.' . $key, $item['foto_lingkungan'])) }}"
|
||||
alt="Gambar Lingkungan" style="width: 30rem;">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputLingkungan_{{ $key }}" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div id="inputContainerLingkungan_0" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan_0" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
<div class="text-white py-4 flex items-center justify-between">
|
||||
<h1 class="text-md font-medium text-gray-900">Lingkungan</h1>
|
||||
<button id="btnLingkungan" type="button" class="btn btn-primary btn-sm">
|
||||
<i class="ki-filled ki-plus text-lg"></i>
|
||||
</button>
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (isset($formFoto['lingkungan']) && is_array($formFoto['lingkungan']) && count($formFoto['lingkungan']) > 0)
|
||||
@foreach ($formFoto['lingkungan'] as $key => $item)
|
||||
<div id="inputContainerLingkungan" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<div class="w-full grid gap-5">
|
||||
<img id="foto_lingkungan_preview_{{ $key }}"
|
||||
src="{{ asset('storage/' . old('foto_lingkungan.' . $key, $item['foto_lingkungan'])) }}"
|
||||
alt="Gambar Lingkungan" style="width: 30rem;">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="inputLingkungan_{{ $key }}" type="file"
|
||||
name="foto_lingkungan[]" class="file-input file-input-bordered w-full"
|
||||
accept="image/*" capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn"
|
||||
style="display: none;" id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div id="inputContainerLingkungan" style="margin-top: 10px">
|
||||
<div class="flex w-full items-center justify-center gap-4 mb-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Lingkungan</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input type="hidden" name="name_lingkungan[]" value="lingkungan">
|
||||
<input id="inputLingkungan_0" type="file" name="foto_lingkungan[]"
|
||||
class="file-input file-input-bordered w-full" accept="image/*" capture="camera">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" class="btn btn-danger btn-sm delete-btn" style="display: none;"
|
||||
id="btnDelete">
|
||||
<i class="ki-filled ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<span class="alert text-danger text-sm"></span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card bg-white rounded-lg shadow-md">
|
||||
<div class="card-body">
|
||||
<div class=" text-white py-4 flex items-center justify-between">
|
||||
@@ -594,7 +605,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Modal Kamera -->
|
||||
@include('lpj::surveyor.components.modal-kamera')
|
||||
@include('lpj::surveyor.components.modal-kamera')
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -693,7 +704,3 @@
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user