fix(penilai): perbaikkan save penilai dan foto lampiran, kembali ke back

This commit is contained in:
majid
2025-03-07 16:08:01 +07:00
committed by putrakuningan
parent 0c33c1e070
commit a29e72f5cc
6 changed files with 85 additions and 25 deletions

View File

@@ -109,10 +109,20 @@
@php
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat', 'foto_sentuh_tanahku'];
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
$fotoTypes = ['upload_gs','foto_sentuh_tanahku','foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
$customLabels = [
'upload_gs' => 'Gambar Situasi',
'foto_sentuh_tanahku' => 'Sentuh Tanahku',
'foto_gistaru' => 'Gistaru',
'foto_bhumi' => 'Bhumi',
'foto_argis_region' => 'Region',
'foto_tempat' => 'Tempat',
];
if (($key = array_search('upload_gs', $fotoTypes)) !== false) {
unset($fotoTypes[$key]);
array_unshift($fotoTypes, 'foto_tempat');
array_unshift($fotoTypes, 'upload_gs');
}
$adaFoto = false;
if (isset($forminspeksi)) {
@@ -130,11 +140,10 @@
<div class="card">
<div class="card-header bg-agi-50" id="basic_settings">
<h3 class="card-title">
Peta
Peta, dan tata ruang, blad
</h3>
</div>
<div class="card-body">
<div>
@if (isset($forminspeksi))
@forelse ($fotoTypes as $type)
@@ -147,7 +156,7 @@
<img src="{{ asset('storage/' . $imagePath) }}" alt="{{ $type }}"
class="w-full h-auto object-cover">
@endif
<p class="mt-2 text-sm">{{ Str::title(str_replace('_', ' ', $type)) }}</p>
<p class="mt-2 text-sm">{{ $customLabels[$type] ?? '' }}</p>
</div>
@empty
<p>Tidak ada tipe foto yang tersedia</p>