diff --git a/app/Helpers/Lpj.php b/app/Helpers/Lpj.php index b80617b..727973b 100644 --- a/app/Helpers/Lpj.php +++ b/app/Helpers/Lpj.php @@ -428,3 +428,22 @@ function getWilayahName($code, $type) return null; } } + + +function formatLabel($key) { + + $customLabels = [ + 'shgb_no_kel_desa' => 'SHGB', + 'nib' => 'NIB', + 'img_pbg_no' =>'IMB/PBG NO', + 'no_surat_ukur_gs' => 'No Surat Ukur/GS', + ]; + + // Jika ada dalam mapping, gunakan label custom + if (array_key_exists($key, $customLabels)) { + return $customLabels[$key]; + } + + // Default: Ubah underscore menjadi spasi dan kapitalisasi + return ucwords(str_replace('_', ' ', $key)); +} diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php index e9722f9..819a1d6 100644 --- a/app/Http/Controllers/PenilaiController.php +++ b/app/Http/Controllers/PenilaiController.php @@ -754,9 +754,13 @@ class PenilaiController extends Controller if (!$allComplete) { + $message = $rap + ? 'Harap Mengisi laporan terlebih dahulu' + : 'Harap Mengisi laporan terlebih dahulu atau kertas kerja'; + return response()->json([ 'success' => false, - 'message' => 'Harap Mengisi laporan terlebih dahulu atau kertas kerja', + 'message' => $message, ], 400); } diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 4f254df..6d5bc2d 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -962,7 +962,8 @@ class SurveyorController extends Controller $validate = $request->validate([ 'id' => 'required', 'waktu_penilaian' => 'required', - 'deskripsi_penilaian' => 'required' + 'deskripsi_penilaian' => 'required', + 'keterangan' => 'required', ]); $penilaian = Penilaian::findOrFail($id); @@ -3713,7 +3714,7 @@ class SurveyorController extends Controller return response()->json([ 'status' => 'success', - 'message' => 'Reschedule jadwal dengan nomor registrasi ' . $validatedData['nomor_registrasi'] . ' berhasil ditolak dengan alasan: ' . $validatedData['rejected_note'], + 'message' => 'Reschedule jadwal dengan nomor registrasi ' . $validatedData['nomor_registrasi'] . ' berhasil dengan alasan: ' . $validatedData['rejected_note'], ]); } catch (\Exception $e) { // Rollback jika ada error diff --git a/resources/views/penilai/components/foto-jaminan.blade.php b/resources/views/penilai/components/foto-jaminan.blade.php index 49a26a0..a92fc18 100644 --- a/resources/views/penilai/components/foto-jaminan.blade.php +++ b/resources/views/penilai/components/foto-jaminan.blade.php @@ -46,36 +46,24 @@ /* Media Print */ @media print { - .photo-item { - width: 48%; - margin-right: 2%; - float: left; - padding: 5px; - box-sizing: border-box; - page-break-inside: avoid; - } - - .photo-item img { - width: 300px; - height: 300px; - object-fit: contain; - background-color: #f0f0f0; - border-radius: 5px; - page-break-inside: avoid; - } - - h2 { - font-size: 14px; - } - - .photo-container { - page-break-inside: avoid; - } - - .photo-row { - page-break-inside: avoid; - } - } + table { + width: 100%; + border-collapse: collapse; + } + td { + vertical-align: top; + text-align: center; + page-break-inside: avoid; + } + .photo-image { + width: auto; + height: 400px; + max-height: 400px; + } + .page-break { + page-break-after: always; + } + } @isset($basicData['foto']) @@ -93,6 +81,8 @@ @if ($groupedPhotos->isEmpty())
Tidak ada foto yang tersedia.
@else + + @foreach ($mainPhotos as $category => $photos) @php $groupedBySubcategory = $photos->groupBy('sub'); @@ -100,142 +90,77 @@ @foreach ($groupedBySubcategory as $subcategory => $subPhotos) @if (count($subPhotos) > 0) -|
- {{ $category }} - - - @isset($subcategory) - @if (trim($subcategory) !== '') - {{ $subcategory }} - - @endif - @endisset - - {{ $item['name'] ?? '' }} - - @if ($statusLpj || file_exists($imagePath)) -{{ $item['description'] }} - @endisset - |
- @else
- @foreach ($subPhotos as $index => $item)
+ @foreach ($subPhotos->chunk(2) as $chunkedPhotos)
+ ||||
| + |
|
{{ $category }} - - @isset($subcategory) @if (trim($subcategory) !== '') {{ $subcategory }} - @endif @endisset - {{ $item['name'] ?? '' }} @if ($statusLpj || file_exists($imagePath)) -{{ $item['description'] }} @endisset |
- @if (($index + 1) % 2 == 0)
-
|
- Lainnya - - - @isset($subcategory) - @if (trim($subcategory) !== '') - {{ $subcategory }} - - @endif - @endisset - - {{ $item['name'] ?? '' }} - - @if ($statusLpj || file_exists($imagePath)) -{{ $item['description'] }} - @endisset - |
- @else
- @foreach ($subPhotos as $index => $item)
- @php
- $imagePath = storage_path('app/public/' . $item['path']);
- @endphp
-
- Lainnya - - - @isset($subcategory) - @if (trim($subcategory) !== '') - {{ $subcategory }} - - @endif - @endisset - - {{ $item['name'] ?? '' }} - - @if ($statusLpj || file_exists($imagePath)) -{{ $item['description'] }} - @endisset - |
- @if (($index + 1) % 2 == 0)
- |
| + + @if (!$otherPhotos->isEmpty()) + @foreach ($otherPhotos->groupBy('sub') as $subcategory => $subPhotos) + @if (count($subPhotos) > 0) + @foreach ($subPhotos->chunk(2) as $chunkedPhotos) + | ||
|
+ Lainnya - + @isset($subcategory) + @if (trim($subcategory) !== '') + {{ $subcategory }} - + @endif + @endisset + {{ $item['name'] ?? '' }} + + @if ($statusLpj || file_exists($imagePath)) +{{ $item['description'] }} + @endisset + |
+ @endforeach
+