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

@@ -11,6 +11,10 @@ use Modules\Lpj\Models\JenisDokumen;
use Modules\Lpj\Models\TeamsUsers;
use Modules\Lpj\Models\Laporan;
use Modules\Usermanagement\Models\User;
use Modules\Location\Models\Province;
use Modules\Location\Models\City;
use Modules\Location\Models\District;
use Modules\Location\Models\Village;
function formatTanggalIndonesia($date, $time = false)
{
@@ -373,3 +377,36 @@ function getCustomField($param){
return null;
}
}
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;
}
}