From 66d0226d554b2fe74ce664d2b050e806aefcac5d Mon Sep 17 00:00:00 2001 From: majid Date: Fri, 27 Dec 2024 09:00:27 +0700 Subject: [PATCH 1/2] update header printout standart --- app/Http/Controllers/PenilaiController.php | 45 ++++++++++--------- .../components/print-out-standard.blade.php | 39 ++++++++-------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php index 9e28fb9..fdd350e 100644 --- a/app/Http/Controllers/PenilaiController.php +++ b/app/Http/Controllers/PenilaiController.php @@ -247,7 +247,7 @@ class PenilaiController extends Controller } - if(!Auth::user()->hasRole('administrator')) { + if (!Auth::user()->hasRole('administrator')) { $query->whereHas('penilaian.userPenilai', function ($q) { $q ->where('role', 'penilai') @@ -616,20 +616,20 @@ class PenilaiController extends Controller $inputAddress = $forminspeksi['asset']['alamat']['sesuai'] ?? $forminspeksi['asset']['alamat']['tidak sesuai']; -$alamat = [ - 'address' => $inputAddress['address'] ?? null, - 'village_code' => $this->getWilayahName($inputAddress['village_code'] ?? null, 'village'), - 'district_code' => $this->getWilayahName($inputAddress['district_code'] ?? null, 'district'), - 'city_code' => $this->getWilayahName($inputAddress['city_code'] ?? null, 'city'), - 'province_code' => $this->getWilayahName($inputAddress['province_code'] ?? null, 'province') -]; - + $alamat = [ + 'address' => $inputAddress['address'] ?? null, + 'village_code' => $this->getWilayahName($inputAddress['village_code'] ?? null, 'village'), + 'district_code' => $this->getWilayahName($inputAddress['district_code'] ?? null, 'district'), + 'city_code' => $this->getWilayahName($inputAddress['city_code'] ?? null, 'city'), + 'province_code' => $this->getWilayahName($inputAddress['province_code'] ?? null, 'province') + ]; + $laporan = $lpj->type == 'sederhana' ? true : false; $viewLaporan = null; - if($laporan){ - $viewLaporan = 'penilai.components.print-out-sederhana'; - }else{ + if ($laporan) { + $viewLaporan = 'penilai.components.print-out-sederhana'; + } else { $viewLaporan = 'penilai.components.print-out-standard'; } @@ -648,7 +648,7 @@ $alamat = [ 'alamat', 'dataPembanding' )); - }else{ + } else { $pdf = PDF::loadView('lpj::' . $viewLaporan, compact( 'permohonan', 'forminspeksi', @@ -673,31 +673,32 @@ $alamat = [ } - function getWilayahName($code, $type) { + public function getWilayahName($code, $type) + { try { $wilayah = null; - + if (!$code) { return null; } - - switch($type) { + + switch ($type) { case 'province': $wilayah = Province::where('code', $code)->first(); return $wilayah ? $wilayah->name : null; - + case 'city': $wilayah = City::where('code', $code)->first(); return $wilayah ? $wilayah->name : null; - + case 'district': $wilayah = District::where('code', $code)->first(); return $wilayah ? $wilayah->name : null; - + case 'village': $wilayah = Village::where('code', $code)->first(); return $wilayah ? $wilayah->name : null; - + default: return null; } @@ -705,6 +706,6 @@ $alamat = [ return null; } } - + } diff --git a/resources/views/penilai/components/print-out-standard.blade.php b/resources/views/penilai/components/print-out-standard.blade.php index 176d23a..9fad766 100644 --- a/resources/views/penilai/components/print-out-standard.blade.php +++ b/resources/views/penilai/components/print-out-standard.blade.php @@ -205,20 +205,7 @@ - +
@php $senior_officer = null; @@ -252,10 +239,10 @@ @php function generateCustomTanggal() { - - $tahunAwal = rand(20, 30); - $bulanTetap = rand(1, 12); - $tanggalTetap = rand(1, 28); + + $tahunAwal = rand(20, 30); + $bulanTetap = rand(1, 12); + $tanggalTetap = rand(1, 28); $bulanFormatted = str_pad($bulanTetap, 2, '0', STR_PAD_LEFT); $tanggalFormatted = str_pad($tanggalTetap, 2, '0', STR_PAD_LEFT); @@ -282,6 +269,18 @@
+ + + + + +
+ @include('lpj::component.logo-bag') + +

Tanggal : {{date('Y-m-d')}}

+

Waktu : {{date('H:i:s')}}

+

User : {{ Auth::user()->name }}

+

LAPORAN PENILAIAN ATAS TANAH DAN/ATAU BANGUNAN

NO: {{ $permohonan->debiture->branch->code ?? '' }}/{{ $tanggalHasil1['fullNumber'] }}/LPJ/{{ $permohonan->nomor_registrasi }}/VII/{{ $tanggalHasil1['tahun'] }} @@ -855,8 +854,8 @@

- - + @foreach ($permohonan->debiture->documents as $dokumen) + @if ($dokumen->jenisJaminan) @php - $cekLuas = isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai']) - ? 'tidak sesuai' - : 'sesuai'; - - $luas = $forminspeksi['tanah']['luas_tanah'][$cekLuas] ?? null; + $formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true); @endphp - - + @if (isset($formKategori) && $formKategori) + @php + $kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori]; + $kategoriUnik = array_unique($kategoriArray); + @endphp + + @foreach ($kategoriUnik as $kategori) + @if ($kategori === 'tanah') +
Luas Tanah{{ $luas }}
+ + @php + $cekLuas = isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai']) + ? 'tidak sesuai' + : 'sesuai'; + + $luas = $forminspeksi['tanah']['luas_tanah'][$cekLuas] ?? null; + @endphp + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - -
Luas Tanah{{ $luas }}
Bentuk Tanah + @if (isset($basicData['bentukTanah'])) + + + @foreach ($basicData['bentukTanah'] as $index => $item) + @if ($index % 3 == 0 && $index > 0) + + + @endif + + @endforeach + +
+ +
+ @endif +
Kontur Tanah + @if (isset($basicData['konturTanah'])) + + + @foreach ($basicData['konturTanah'] as $index => $item) + @if ($index % 3 == 0 && $index > 0) + + + @endif + + @endforeach + +
+ +
+ @endif +
Bentuk TanahKetinggian Tanah - @if (isset($basicData['bentukTanah'])) + @if (isset($basicData['ketinggianTanah'])) - @foreach ($basicData['bentukTanah'] as $index => $item) + @foreach ($basicData['ketinggianTanah'] as $index => $item) @if ($index % 3 == 0 && $index > 0) @@ -626,64 +658,11 @@ - @endforeach - -
- @endif -
Kontur Tanah - @if (isset($basicData['konturTanah'])) - - - @foreach ($basicData['konturTanah'] as $index => $item) - @if ($index % 3 == 0 && $index > 0) - - - @endif - - @endforeach - -
- -
- @endif -
Ketinggian Tanah - @if (isset($basicData['ketinggianTanah'])) - - - @foreach ($basicData['ketinggianTanah'] as $index => $item) - @if ($index % 3 == 0 && $index > 0) - - - @endif - - @endforeach + @endforeach
- -
@endif @@ -917,6 +896,117 @@
+ @elseif ($kategori === 'apartemen-kantor') + + + @php + $cekLuas = isset( + $forminspeksi['luas_unit']['tidak sesuai'], + ) + ? 'tidak sesuai' + : 'sesuai'; + + $luas = $forminspeksi['luas_unit'][$cekLuas] ?? null; + @endphp + + + + + + + + + + + + +
Luas Unit:{{ $luas ?? '' }}
Bentuk Unit + @if (isset($basicData['bentukUnit'])) + + + @foreach ($basicData['bentukUnit'] as $index => $item) + @if ($index % 3 == 0 && $index > 0) + + + @endif + + @endforeach + +
+ +
+ @endif + +
Kondisi Unit + @if (isset($basicData['kondisiUnit'])) + + + @foreach ($basicData['kondisiUnit'] as $index => $item) + @if ($index % 3 == 0 && $index > 0) + + + @endif + + @endforeach + +
+ +
+ @endif +
Posisi Unit + @if (isset($basicData['posisiUnit'])) + + + @foreach ($basicData['posisiUnit'] as $index => $item) + @if ($index % 3 == 0 && $index > 0) + + + @endif + + @endforeach + +
+ +
+ @endif +
View Unit + @if (isset($basicData['view'])) + + + @foreach ($basicData['view'] as $index => $item) + @if ($index % 3 == 0 && $index > 0) + + + @endif + + @endforeach + +
+ +
+ @endif +
+ @endif + @endforeach + @endif + @endif + @endforeach