From 66d0226d554b2fe74ce664d2b050e806aefcac5d Mon Sep 17 00:00:00 2001 From: majid Date: Fri, 27 Dec 2024 09:00:27 +0700 Subject: [PATCH] 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 @@