update final log

This commit is contained in:
2023-12-12 14:35:12 +07:00
parent 91b7a10f86
commit e76c480ce9
59 changed files with 5524 additions and 583 deletions

View File

@@ -8,24 +8,39 @@ use Illuminate\Http\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use PHPMailer\PHPMailer\PHPMailer;
use Illuminate\Support\Facades\DB;
use App\Models\Member;
use App\Models\Service;
class Helper
{
public static function genderNormalization($anyGenderCode)
{
if ($anyGenderCode == 'M') {
return 'male';
return 'Male';
} else if ($anyGenderCode == 'F') {
return 'female';
return 'Female';
} else if ($anyGenderCode == 'O') {
return 'others';
return 'Others';
} else if ($anyGenderCode == 'U') {
return 'unknown';
return 'Unknown';
} else {
return null;
}
}
public static function maritalNormalization($code)
{
if ($code == 'M') {
return 'Married';
} else if ($code == 'D') {
return 'Divorced';
} else if ($code == 'S') {
return 'Single';
} else {
return '-';
}
}
public static function genderPerson($anyGenderCode)
{
if ($anyGenderCode == 'M') {
@@ -41,6 +56,44 @@ class Helper
}
}
public static function memberType($code){
if ($code == 'P') {
return 'Principal';
} else if ($code == 'D') {
return 'Dependent';
} else {
'-';
}
}
public static function relationWithPrincipal($code){
if ($code == 'H') {
return 'Husbund';
}
else if ($code == 'W') {
return 'Wife';
}
else if ($code == 'S') {
return 'Son';
}
else if ($code == 'D') {
return 'Daughter';
}
else {
'-';
}
}
public static function principalName($code){
$principalName = Member::where('member_id', $code)->get()->first();
return $principalName->name;
}
public static function serviceName($code){
$serviceName = Service::where('code', $code)->get()->first();
return $serviceName->name;
}
public static function paginateResources($resource)
{
return [