fix(surveyor): perbaikan tanda tangan, print out sederhana dan print hasil surveyor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user