diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php
index d6104e9..8f46792 100644
--- a/app/Http/Controllers/SurveyorController.php
+++ b/app/Http/Controllers/SurveyorController.php
@@ -959,6 +959,11 @@ class SurveyorController extends Controller
$id = $request->input('id');
$penilaian = Penilaian::findOrFail($id);
+ if ($validate['waktu_penilaian'] <= $penilaian->tanggal_kunjungan) {
+ return redirect()
+ ->route('surveyor.index')
+ ->with('error', 'Waktu penilaian harus lebih besar dari tanggal assign.');
+ }
$penilaian->update([
'waktu_penilaian' => $validate['waktu_penilaian'],
'deskripsi_penilaian' => $validate['deskripsi_penilaian'],
@@ -986,6 +991,12 @@ class SurveyorController extends Controller
'authorized_status' => 1,
]);
+ $permohonan = Permohonan::findOrFail($request->permohonan_id);
+
+ $permohonan->update([
+ 'status' => 'survey'
+ ]);
+
$data['status'] = 'success';
$data['message'] = 'Jadwal '.$request->noReg.' berhasil di aprove';
} catch (\Exception $e) {
@@ -1002,8 +1013,29 @@ class SurveyorController extends Controller
}
- public function storeFreeze()
+ public function storeFreeze($id, Request $request)
{
+ try {
+
+ $permohonan = Permohonan::findOrFail($id);
+
+ $permohonan->update([
+ 'status' => 'request-freeze',
+ 'keterangan' => $request->message
+ ]);
+
+ return response()->json([
+ 'success' => true,
+ 'message' => 'Berhasil Kirim permintaan Request Freeaze ke So'
+ ], 200);
+
+ } catch (\Exception $e) {
+ return response()->json([
+ 'success' => false,
+ 'message' => 'Terjadi kesalahan',
+ 'error' => $e->getMessage()
+ ], 500);
+ }
}
diff --git a/resources/views/penilai/components/foto-jaminan.blade.php b/resources/views/penilai/components/foto-jaminan.blade.php
index 7ed7549..1f29d95 100644
--- a/resources/views/penilai/components/foto-jaminan.blade.php
+++ b/resources/views/penilai/components/foto-jaminan.blade.php
@@ -1,113 +1,134 @@
@php
- $photoSections = [
- 'rute_menuju_lokasi' => [
- 'key' => 'rute_menuju_lokasi',
- 'name_prefix' => '',
- 'nested' => true
- ],
- 'foto_rute_lainnya' => [
- 'key' => 'name_rute_lainnya',
- 'name_prefix' => '',
- 'nested' => false
- ],
- 'object_jaminan' => [
- 'key' => 'name_objek',
- 'name_prefix' => '',
- 'nested' => false
- ],
- 'foto_lantai_unit' => [
- 'key' => 'name',
- 'name_prefix' => 'Foto Lantai',
- 'nested' => true
- ],
- 'foto_lingkungan' => [
- 'key' => 'foto_lingkungan',
- 'name_prefix' => '',
- 'nested' => true
- ],
- 'single_photos' => [
- 'foto_basement' => 'Basement',
- 'foto_gerbang' => 'Gerbang',
- 'pendamping' => 'Pendamping'
- ]
- ];
+ $photoSections = [
+ 'rute_menuju_lokasi' => [
+ 'key' => 'rute_menuju_lokasi',
+ 'name_prefix' => '',
+ 'nested' => true,
+ ],
+ 'foto_rute_lainnya' => [
+ 'key' => 'name_rute_lainnya',
+ 'name_prefix' => '',
+ 'nested' => false,
+ ],
+ 'foto_lingkungan' => [
+ 'key' => 'foto_lingkungan',
+ 'name_prefix' => '',
+ 'nested' => true,
+ ],
+ 'single_photos' => [
+ 'foto_basement' => 'Basement',
+ 'foto_gerbang' => 'Gerbang',
+ 'pendamping' => 'Pendamping',
+ ],
+ 'object_jaminan' => [
+ 'key' => 'name_objek',
+ 'name_prefix' => '',
+ 'nested' => false,
+ ],
+ 'foto_lantai_unit' => [
+ 'key' => 'name',
+ 'name_prefix' => 'Foto Lantai',
+ 'nested' => true,
+ ],
+ ];
- $hasPhotos = false;
+ $hasPhotos = false;
@endphp
+
+
@foreach ($photoSections as $sectionKey => $sectionConfig)
@if ($sectionKey === 'single_photos')
- @foreach ($sectionConfig as $photoKey => $photoName)
- @if (isset($formFoto[$photoKey]) && !empty($formFoto[$photoKey]))
- @php
- $imagePath = storage_path('app/public/' . $formFoto[$photoKey]);
- $hasPhotos = true;
- @endphp
-
-
- {{ $photoName }}
-
-
- @if ($statusLpj || file_exists($imagePath))
-

- @endif
-
- @endif
- @endforeach
+
+ @foreach ($sectionConfig as $photoKey => $photoName)
+ @if (isset($formFoto[$photoKey]) && !empty($formFoto[$photoKey]))
+ @php
+ $imagePath = storage_path('app/public/' . $formFoto[$photoKey]);
+ $hasPhotos = true;
+ @endphp
+
+
+ {{ $photoName }}
+
+ @if ($statusLpj || file_exists($imagePath))
+

+ @endif
+
+ @endif
+ @endforeach
+
@else
@php
- $sectionData = $formFoto[$sectionKey] ?? null;
+ $sectionData = $formFoto[$sectionKey] ?? null;
@endphp
@if (!empty($sectionData))
@if ($sectionConfig['nested'])
@if (isset($sectionData[$sectionConfig['key']][0]))
- @foreach ($sectionData[$sectionConfig['key']][0] as $index => $item)
- @php
- $imagePath = storage_path('app/public/' . $item['path']);
- $hasPhotos = true;
- @endphp
-
-
- {{ $sectionConfig['name_prefix'] ?
- ($sectionConfig['name_prefix'] . ' ' . ($index + 1)) :
- ($item['name'] ?? 'Foto ' . ($index + 1))
- }}
-
-
- @if ($statusLpj || file_exists($imagePath))
-
![{{ $item['path'] }}]({{ $imagePath }})
- @endif
-
- @endforeach
+
+ @foreach ($sectionData[$sectionConfig['key']][0] as $index => $item)
+ @php
+ $imagePath = storage_path('app/public/' . $item['path']);
+ $hasPhotos = true;
+ @endphp
+
+
+ {{ $sectionConfig['name_prefix']
+ ? $sectionConfig['name_prefix'] . ' ' . ($index + 1)
+ : $item['name'] ?? 'Foto ' . ($index + 1) }}
+
+ @if ($statusLpj || file_exists($imagePath))
+
![{{ $item['path'] }}]({{ $imagePath }})
+ @endif
+
+ @endforeach
+
@endif
@else
- @foreach ($sectionData as $index => $item)
- @php
- $name = $item[$sectionConfig['key']] ?? '';
- $photoPath = $sectionKey === 'object_jaminan' ?
- ($item['foto_objek'] ?? '') :
- ($item['foto_rute_lainnya'] ?? '');
+
+ @foreach ($sectionData as $index => $item)
+ @php
+ $name = $item[$sectionConfig['key']] ?? '';
+ $photoPath =
+ $sectionKey === 'object_jaminan'
+ ? $item['foto_objek'] ?? ''
+ : $item['foto_rute_lainnya'] ?? '';
- $imagePath = storage_path('app/public/' . $photoPath);
- @endphp
+ $imagePath = storage_path('app/public/' . $photoPath);
+ @endphp
- @if (!empty($name) || !empty($photoPath))
- @php $hasPhotos = true; @endphp
-
- @if (!empty($name))
-
- {{ $name }}
-
- @endif
-
- @if ($statusLpj || (file_exists($imagePath) && !empty($photoPath)))
-

- @endif
-
- @endif
- @endforeach
+ @if (!empty($name) || !empty($photoPath))
+ @php $hasPhotos = true; @endphp
+
+ @if (!empty($name))
+
+ {{ $name }}
+
+ @endif
+ @if ($statusLpj || (file_exists($imagePath) && !empty($photoPath)))
+

+ @endif
+
+ @endif
+ @endforeach
+
@endif
@endif
@endif
diff --git a/resources/views/penilai/components/foto-lampiran.blade.php b/resources/views/penilai/components/foto-lampiran.blade.php
index f2396fe..039f613 100644
--- a/resources/views/penilai/components/foto-lampiran.blade.php
+++ b/resources/views/penilai/components/foto-lampiran.blade.php
@@ -52,6 +52,60 @@
@endif
+@if (isset($formFoto['foto_gerbang']))
+
@endif
-@if (isset($formFoto['foto_lingkungan']['foto_lingkungan']))
-
-
-
- @if (isset($formFoto['foto_lingkungan']['foto_lingkungan']))
- @foreach ($formFoto['foto_lingkungan']['foto_lingkungan'][0] as $index => $item)
-
-
-
- {{ $item['name'] ?? 'Lingkungan - ' . ($index + 1) }}
-
-
-
 }})
-
-
-
- @endforeach
- @endif
-
-
-@endif
+
@if (isset($formFoto['foto_basement']))
@@ -191,34 +221,8 @@
@endif
-@if (isset($formFoto['foto_gerbang']))
-
-
-
-
-
-
- Gerbang
-
-
-
-
-
 }})
-
-
-
-
-
-
-
-@endif
-
@if (isset($formFoto['pendamping']))
diff --git a/resources/views/penilai/components/lpj-sederhana-standard.blade.php b/resources/views/penilai/components/lpj-sederhana-standard.blade.php
index 451239b..5ba260d 100644
--- a/resources/views/penilai/components/lpj-sederhana-standard.blade.php
+++ b/resources/views/penilai/components/lpj-sederhana-standard.blade.php
@@ -5,12 +5,40 @@
@endsection
@section('content')
+
@include('lpj::assetsku.includenya')