update header printout standart

This commit is contained in:
majid
2024-12-27 09:00:27 +07:00
parent decca9be29
commit 66d0226d55
2 changed files with 42 additions and 42 deletions

View File

@@ -247,7 +247,7 @@ class PenilaiController extends Controller
} }
if(!Auth::user()->hasRole('administrator')) { if (!Auth::user()->hasRole('administrator')) {
$query->whereHas('penilaian.userPenilai', function ($q) { $query->whereHas('penilaian.userPenilai', function ($q) {
$q $q
->where('role', 'penilai') ->where('role', 'penilai')
@@ -616,20 +616,20 @@ class PenilaiController extends Controller
$inputAddress = $forminspeksi['asset']['alamat']['sesuai'] ?? $forminspeksi['asset']['alamat']['tidak sesuai']; $inputAddress = $forminspeksi['asset']['alamat']['sesuai'] ?? $forminspeksi['asset']['alamat']['tidak sesuai'];
$alamat = [ $alamat = [
'address' => $inputAddress['address'] ?? null, 'address' => $inputAddress['address'] ?? null,
'village_code' => $this->getWilayahName($inputAddress['village_code'] ?? null, 'village'), 'village_code' => $this->getWilayahName($inputAddress['village_code'] ?? null, 'village'),
'district_code' => $this->getWilayahName($inputAddress['district_code'] ?? null, 'district'), 'district_code' => $this->getWilayahName($inputAddress['district_code'] ?? null, 'district'),
'city_code' => $this->getWilayahName($inputAddress['city_code'] ?? null, 'city'), 'city_code' => $this->getWilayahName($inputAddress['city_code'] ?? null, 'city'),
'province_code' => $this->getWilayahName($inputAddress['province_code'] ?? null, 'province') 'province_code' => $this->getWilayahName($inputAddress['province_code'] ?? null, 'province')
]; ];
$laporan = $lpj->type == 'sederhana' ? true : false; $laporan = $lpj->type == 'sederhana' ? true : false;
$viewLaporan = null; $viewLaporan = null;
if($laporan){ if ($laporan) {
$viewLaporan = 'penilai.components.print-out-sederhana'; $viewLaporan = 'penilai.components.print-out-sederhana';
}else{ } else {
$viewLaporan = 'penilai.components.print-out-standard'; $viewLaporan = 'penilai.components.print-out-standard';
} }
@@ -648,7 +648,7 @@ $alamat = [
'alamat', 'alamat',
'dataPembanding' 'dataPembanding'
)); ));
}else{ } else {
$pdf = PDF::loadView('lpj::' . $viewLaporan, compact( $pdf = PDF::loadView('lpj::' . $viewLaporan, compact(
'permohonan', 'permohonan',
'forminspeksi', 'forminspeksi',
@@ -673,31 +673,32 @@ $alamat = [
} }
function getWilayahName($code, $type) { public function getWilayahName($code, $type)
{
try { try {
$wilayah = null; $wilayah = null;
if (!$code) { if (!$code) {
return null; return null;
} }
switch($type) { switch ($type) {
case 'province': case 'province':
$wilayah = Province::where('code', $code)->first(); $wilayah = Province::where('code', $code)->first();
return $wilayah ? $wilayah->name : null; return $wilayah ? $wilayah->name : null;
case 'city': case 'city':
$wilayah = City::where('code', $code)->first(); $wilayah = City::where('code', $code)->first();
return $wilayah ? $wilayah->name : null; return $wilayah ? $wilayah->name : null;
case 'district': case 'district':
$wilayah = District::where('code', $code)->first(); $wilayah = District::where('code', $code)->first();
return $wilayah ? $wilayah->name : null; return $wilayah ? $wilayah->name : null;
case 'village': case 'village':
$wilayah = Village::where('code', $code)->first(); $wilayah = Village::where('code', $code)->first();
return $wilayah ? $wilayah->name : null; return $wilayah ? $wilayah->name : null;
default: default:
return null; return null;
} }
@@ -705,6 +706,6 @@ $alamat = [
return null; return null;
} }
} }
} }

View File

@@ -205,20 +205,7 @@
<body> <body>
<header id="header">
<table style="width: 100%; border: none;">
<tr>
<td style="width: 20%; text-align: left;" class="header-left">
@include('lpj::component.logo-bag')
</td>
<td style="width: 80%; text-align: center; border: 1px solid black; ">
<h3 style="width:100% padding-top: 40px; text-align: center;">LAPORAN PENILAIAN ATAS
TANAH
DAN/ATAU BANGUNAN</h3>
</td>
</tr>
</table>
</header>
<main class="content"> <main class="content">
@php @php
$senior_officer = null; $senior_officer = null;
@@ -252,10 +239,10 @@
@php @php
function generateCustomTanggal() function generateCustomTanggal()
{ {
$tahunAwal = rand(20, 30); $tahunAwal = rand(20, 30);
$bulanTetap = rand(1, 12); $bulanTetap = rand(1, 12);
$tanggalTetap = rand(1, 28); $tanggalTetap = rand(1, 28);
$bulanFormatted = str_pad($bulanTetap, 2, '0', STR_PAD_LEFT); $bulanFormatted = str_pad($bulanTetap, 2, '0', STR_PAD_LEFT);
$tanggalFormatted = str_pad($tanggalTetap, 2, '0', STR_PAD_LEFT); $tanggalFormatted = str_pad($tanggalTetap, 2, '0', STR_PAD_LEFT);
@@ -282,6 +269,18 @@
<div class="header"> <div class="header">
<table style="width: 100%; border: none;">
<tr>
<td style="width: 50%; text-align: left;" class="header-left">
@include('lpj::component.logo-bag')
</td>
<td style="width: 50%; text-align: right;">
<h3>Tanggal : {{date('Y-m-d')}}</h3>
<h3>Waktu : {{date('H:i:s')}}</h3>
<h3>User : {{ Auth::user()->name }}</h3>
</td>
</tr>
</table>
<h4>LAPORAN PENILAIAN ATAS TANAH DAN/ATAU BANGUNAN</h4> <h4>LAPORAN PENILAIAN ATAS TANAH DAN/ATAU BANGUNAN</h4>
<p>NO: <p>NO:
{{ $permohonan->debiture->branch->code ?? '' }}/{{ $tanggalHasil1['fullNumber'] }}/LPJ/{{ $permohonan->nomor_registrasi }}/VII/{{ $tanggalHasil1['tahun'] }} {{ $permohonan->debiture->branch->code ?? '' }}/{{ $tanggalHasil1['fullNumber'] }}/LPJ/{{ $permohonan->nomor_registrasi }}/VII/{{ $tanggalHasil1['tahun'] }}
@@ -855,8 +854,8 @@
<label class="checkbox-label"> <label class="checkbox-label">
<input type="checkbox" <input type="checkbox"
style=" style="
margin-right: 3px; margin-right: 3px;
" "
name="spesifikasi_bangunan[{{ $index }}][{{ $spesifikasi->name }}][]" name="spesifikasi_bangunan[{{ $index }}][{{ $spesifikasi->name }}][]"
value="{{ $kategori->name }}" value="{{ $kategori->name }}"