fix(surveyor): perbaikan tanda tangan, print out sederhana dan print hasil surveyor

This commit is contained in:
majid
2025-02-10 23:15:42 +07:00
parent 50367edca4
commit 4ef7c01e29
8 changed files with 1467 additions and 1349 deletions

View File

@@ -1032,10 +1032,10 @@ class PenilaiController extends Controller
$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')
'village_code' => getWilayahName($inputAddress['village_code'] ?? null, 'village'),
'district_code' => getWilayahName($inputAddress['district_code'] ?? null, 'district'),
'city_code' => getWilayahName($inputAddress['city_code'] ?? null, 'city'),
'province_code' => getWilayahName($inputAddress['province_code'] ?? null, 'province')
];
$viewLaporan = $this->getViewLaporan($tipeLaporan);
@@ -1112,39 +1112,6 @@ class PenilaiController extends Controller
return $viewMap[$tipe] ?? 'penilai.components.print-resume';
}
public function getWilayahName($code, $type)
{
try {
$wilayah = null;
if (!$code) {
return null;
}
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;
}
} catch (\Exception $e) {
return null;
}
}
// mengambil data dari fungsi permohonan di surveyor, dan table
@@ -1322,8 +1289,7 @@ class PenilaiController extends Controller
'resume' => [
'fakta.fakta_positif',
'fakta.fakta_negatif',
'fisik',
'keterangan'
'fisik'
],
];