MERGE_UAT_ENROLLMENT_FOLW

This commit is contained in:
Venba 2024-07-19 15:20:37 +00:00
commit 698004f290
9 changed files with 182 additions and 61 deletions

View File

@ -28,17 +28,17 @@ class Email extends BaseConfig
/**
* SMTP Server Hostname
*/
public string $SMTPHost = 'mail.venbait.in';
public string $SMTPHost = 'smtp.gmail.com';
/**
* SMTP Username
*/
public string $SMTPUser = 'bbone@venbait.in';
public string $SMTPUser = 'venbatechnologies@gmail.com';
/**
* SMTP Password
*/
public string $SMTPPass = 'xk!L(N_-R#};';
public string $SMTPPass = 'dsfllmxdzxxkcxgz';
/**
* SMTP Port

View File

@ -272,6 +272,7 @@ $routes->get("processjob", "JobWorker::processJob");
$routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber");
$routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData");
$routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin");
$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin");
//HR login api's
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
$routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData");

View File

@ -3600,6 +3600,7 @@ class EmpDataServiceController extends BaseController
public function sendMailForDownloadingECard(array $ids)
{
$this->myLogger->logme('error', 'sendMailForDownloadingECard - function called');
if (count($ids) > 0) {
@ -3655,14 +3656,15 @@ class EmpDataServiceController extends BaseController
$params['get_emp_email_and_other_details'] = $get_emp_email_and_other_details;
// $this->myLogger->logme('error', 'sendMailForDownloadingECard - Send Bulk Mail function end ',);
if (isset($get_emp_email_and_other_details['email_corporate']) && !empty($get_emp_email_and_other_details['email_corporate']) && $get_emp_email_and_other_details['relationship'] === 'Self') {
if (isset($get_emp_email_and_other_details['email_corporate']) && !empty($get_emp_email_and_other_details['email_corporate']) && $get_emp_email_and_other_details['relationship'] == 'Self') {
$wholeData[] = sendMailNotification::sendMailNotification('member_ecard_mail', $params);
// print_r($wholeData);die;
$count++;
}
$counts++;
if ($count == 20 || $counts == count($ids) - 1) {
if(count($wholeData) > 0){

View File

@ -661,7 +661,6 @@ class EmployeeRestController extends AdminController
$empServiceController = new EmployeeServiceController();
$result = $empServiceController->excelFileFormatValidation(['file_id' => $file_id]);
if(isset($result['error_summary']) && count($result['error_summary']))
{
$result = $empServiceController->getExcelErrorData($file_id);
@ -1755,7 +1754,7 @@ public function iAgreeForAddOn()
{
$postData = json_decode($this->request->getBody(), true);
$client_policy_id = $postData['client_policy_id'];
sort($client_policy_id);
// Alternatively, you can use echo to see the type
$emp_code = $postData['emp_code'];
$client_id = $postData['client_id'];
@ -1765,21 +1764,29 @@ public function iAgreeForAddOn()
->where('is_active', 1 )
->set(array('emp_status'=>'enrolled'))
->update();
$empData = $this->employeeModel->where('emp_code', $emp_code )->where('client_id', $client_id ) ->where('is_active', 1 )->findAll();
if (!is_null($client_policy_id) && is_array($client_policy_id))
{
$array_list = [];
foreach ($client_policy_id as $key => $value)
{
$this->employeePolicyModel->where('client_policy_id', $value )
foreach ($empData as $empDataKey => $empDataValue)
{
$this->employeePolicyModel->where('client_policy_id', $value )
->where('is_active', 1 )
->where('employee_id', $empDataValue['id'] )
->set(array('status'=>'enrolled'))
->update();
}
$find = $this->employeeModel->getEmpFamilybyEmpCode(client_policy_id: $value,emp_code: $emp_code,client_id: $client_id,emp_status:['draft','enrolled'],policy_status:['draft','enrolled']);
if(count($find) > 0){
$array_list[] = $find;
}
}
$notification = $this->notificationModel->where('client_id' ,$client_id)->where('template_name', 'member_review_and_summary_mail')->first();
@ -1789,22 +1796,25 @@ public function iAgreeForAddOn()
$params ['emp_code'] = $emp_code;
$params ['client_id'] = $client_id;
$params ['notification'] = $notification;
// print_r($params);die;
$wholeData =sendMailNotification::sendMailNotification('member_review_and_summary_mail', $params);
MailHelper::send_email($wholeData[0]);
$mail_send_return = MailHelper::send_email($wholeData[0]);
$this->myLogger->logme("info", $mail_send_return);
if (isset($wholeData[0])) {
$account_manager_wholeData =sendMailNotification::sendMailNotification('account_maneger_summary_mail', $params);
foreach ($account_manager_wholeData as $key => $value) {
MailHelper::send_email($value);
$mail_send_return1 = MailHelper::send_email($value);
$this->myLogger->logme("info", $mail_send_return1);
}
$client_hr_wholeData =sendMailNotification::sendMailNotification('client_hr_summary_mail', $params);
foreach ($client_hr_wholeData as $key => $value) {
MailHelper::send_email($value);
$mail_send_return2 = MailHelper::send_email($value);
$this->myLogger->logme("info", $mail_send_return2);
}
}
}

View File

@ -310,6 +310,25 @@ class RestAuthenticationController extends AdminController
}
}
public function checkMpin()
{
try {
$mobile_number = $this->request->getJSON()->mobile_number;
$employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first();
if ($employeeData && $employeeData["mpin"] != null) {
return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist" , 'Mpin' =>$employeeData["mpin"]],200);
} else {
return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found", 'Mpin' =>null],200);
}
} catch (\Exception $e) {
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500);
}
}
}

View File

@ -12,6 +12,7 @@ class sendMailNotification
{
public static function sendMailNotification($action, $params)
{
print_r($params);die;
if ($action == 'member_welcome_mail') {
$dataToInsert = $params['dataToInsert'];
$notification = $params['notification'];
@ -37,7 +38,6 @@ class sendMailNotification
return $wholeData;
} else if($action == 'member_reminder_mail'){
// print_r($params);die;
$EmployeeModel = new EmployeeModel();
$emp_data = $params['emp_data'];
$notification_data = $params['notification_data'];
@ -100,11 +100,16 @@ class sendMailNotification
$mail_content = $notification['mail_content'];
$mail = $get_emp_email_and_other_details['email_corporate'];
$subject = $notification['subject'];
$link = generate_download_link($rand_string);
$app_link = $_ENV['App_Url'];
$name = $get_emp_email_and_other_details['name'];
$mail_content = $notification['mail_content'];
$nhance_logo = $_ENV['NHANCE_LOGO'];
// dd("3333333333333");
$post_enrollment_app_link = $_ENV['POST_ENROLLMENT_APP_LINK'];
$client_logo = base_url() . "public/uploads/logo/" . $client_data['client_logo'];
@ -119,7 +124,6 @@ class sendMailNotification
// $mail_content = str_replace("[[tpa_id]]", $tpa_id, $mail_content);
$mail_content = str_replace("[[ecard_download_link]]", "<a href='$link/1'>Download Insurance Card</a>", $mail_content);
$mail_content = str_replace("[[client_name]]", $client_data['client_name'], $mail_content);
$wholeData = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content,'bcc'=> $client_data['common_mails']];
return $wholeData;
@ -153,10 +157,12 @@ class sendMailNotification
// Step 1: Replace the placeholder with an HTML table structure
$mail = '';
// print_r($array_list);die;
$table_content = '';
$addtional_premium = 0;
$gst = 0;
$Addon_list = [];
$name = '';
$emp_code = '';
foreach ($array_list as $item) {
if(count($item) != 0){
$table_content .= '<div style="text-align: left;"><div style="text-align:left;"><h4>Policy Name : ';
@ -165,12 +171,12 @@ class sendMailNotification
$is_addon ='';
foreach ($item as $inner_item) {
$policy_name = $inner_item['policy_name'];
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . '</td><td style="width:20%">'.$inner_item['mobile'].'</td><td style="width:20%">₹'.number_format($inner_item['basic_cover_si'], 2, '.', ',').'</td><td style="width:20%">'.\DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y').'</tr>';
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . '</td><td style="width:20%">'.$inner_item['relationship'].'</td><td>'. \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') .'</td><td style="width:20%">₹'.format_indian_number($inner_item['basic_cover_si']).'</td><td style="width:20%">₹'.format_indian_number($inner_item['premium']).'</td><td>₹'. format_indian_number($inner_item['gst']) .'</td></tr><tr>';
if($inner_item['relationship'] == 'Self' || $inner_item['relationship'] == 'self'){
$mail = $inner_item['email_corporate'];
$name = $inner_item['name'];
$emp_code = $inner_item['emp_code'];
}
// print_r($inner_item);die;
$is_addon = $inner_item['is_addon'];
if($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3){
@ -179,10 +185,9 @@ class sendMailNotification
}
}
// echo $policy_name;die;
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Mobile Number</th><th>Sum Insure</th><th style="width:15%">Date Of Birth</th></tr></thead><tbody>';
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Relation</th><th style="width:15%">Date Of Birth</th><th>Sum Insure</th><th>Premium</th><tj>GST</th></tr></thead><tbody>';
$table_content .= $temp_data;
$table_content .= '</tbody></table></div>';
$Addon_list = [];
if ($is_addon == 2 || $is_addon == 3) {
$addon_list_array = [
'policy_name'=>$policy_name,
@ -190,7 +195,7 @@ class sendMailNotification
'gst'=>$gst
];
$Addon_list[]= $addon_list_array;
}
@ -200,17 +205,20 @@ class sendMailNotification
}
}
if(count($Addon_list) != 0 && count($Addon_list) > 0){
$table_content .='<br><div style="text-align: left;"><div style="text-align:left;"><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$sum_total_words = numberToWords($sum_tolal);
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.format_indian_number($sum_tolal).'</td></tr>';
$table_content .= '</tbody></table></div></div>';
$table_content .= '<div style="width:60%;text-align:right">'. $sum_total_words .'</div>';
$table_content .='<br><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.$sum_tolal.'</td></tr>';
$table_content .= '</tbody></table>';
$mail_content = str_replace("[[member_name]]", $name, $mail_content);
$mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content);
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
// $mail = "aadhavanvalli@gmail.com";
// if (isset($mail) && !empty($mail)) {
@ -220,7 +228,6 @@ class sendMailNotification
return $wholeData;
}
// print_r($wholeData);die;
} else if($action == 'account_maneger_summary_mail'){
$client_id = $params['client_id'];
@ -242,7 +249,6 @@ class sendMailNotification
$user_list[]=$user_data;
}
}
// print_r($client_rm_data);die;
@ -262,12 +268,11 @@ class sendMailNotification
// Step 1: Replace the placeholder with an HTML table structure
$mail = '';
// print_r($array_list);die;
$table_content = '';
$addtional_premium = 0;
$gst = 0;
$array_list = $params['array_list'];
$Addon_list = [];
foreach ($array_list as $item) {
if(count($item) != 0){
$table_content .= '<div style="text-align: left;"><div style="text-align:left;"><h4>Policy Name : ';
@ -276,19 +281,24 @@ class sendMailNotification
$is_addon ='';
foreach ($item as $inner_item) {
$policy_name = $inner_item['policy_name'];
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . '</td><td style="width:20%">'.$inner_item['mobile'].'</td><td style="width:20%">₹'.number_format($inner_item['basic_cover_si'], 2, '.', ',').'</td><td style="width:20%">'.\DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y').'</tr>';
// print_r($inner_item);die;
if($inner_item['relationship'] == 'Self'){
$emp_code = ' ('. $inner_item['emp_code'] . ')';
}else{
$emp_code ='';
}
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . $emp_code . '</td><td style="width:20%">'.$inner_item['relationship'].'</td><td>'. \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') .'</td><td style="width:20%">₹'.format_indian_number($inner_item['basic_cover_si']).'</td><td style="width:20%">₹'.format_indian_number($inner_item['premium']).'</td><td>₹'. format_indian_number($inner_item['gst']) .'</td></tr><tr>';
$is_addon = $inner_item['is_addon'];
if($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3){
$addtional_premium = $inner_item['rata_premimum'] + $addtional_premium;
$gst = $inner_item['gst'] + $gst;
}
}
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Mobile Number</th><th>Sum Insure</th><th style="width:15%">Date Of Birth</th></tr></thead><tbody>';
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Relation</th><th style="width:15%">Date Of Birth</th><th>Sum Insure</th><th>Premium</th><tj>GST</th></tr></thead><tbody>';
$table_content .= $temp_data;
$table_content .= '</tbody></table></div>';
$Addon_list = [];
if ($is_addon == 2 || $is_addon == 3) {
$addon_list_array = [
'policy_name'=>$policy_name,
@ -307,20 +317,23 @@ class sendMailNotification
}
if(count($Addon_list) != 0 && count($Addon_list) > 0){
$table_content .='<br><div style="text-align: left;"><div style="text-align:left;"><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$sum_total_words = numberToWords($sum_tolal);
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.format_indian_number($sum_tolal).'</td></tr>';
$table_content .= '</tbody></table></div></div>';
$table_content .= '<div style="width:60%;text-align:right">'. $sum_total_words .'</div>';
$table_content .='<br><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.$sum_tolal.'</td></tr>';
$table_content .= '</tbody></table>';
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
$account_manager_mail_list = [];
// print_r($user_list);die;
if(isset($user_list)){
foreach ($user_list as $key => $value) {
$full_name = $value['first_name'] .' ' .$value['last_name'];
@ -372,19 +385,23 @@ class sendMailNotification
// Step 1: Replace the placeholder with an HTML table structure
$mail = '';
// print_r($array_list);die;
$table_content = '';
$addtional_premium = 0;
$gst = 0;
$array_list = $params['array_list'];
$Addon_list = [];
foreach ($array_list as $item) {
$table_content .= '<div style="text-align: left;"><div style="text-align:left;"><h4>Policy Name : ';
$temp_data ='';
foreach ($item as $inner_item) {
$policy_name = $inner_item['policy_name'];
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . '</td><td style="width:20%">'.$inner_item['mobile'].'</td><td style="width:20%">₹'.number_format($inner_item['basic_cover_si'], 2, '.', ',').'</td><td style="width:20%">'.\DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y').'</tr>';
// print_r($inner_item);die;
if($inner_item['relationship'] == 'Self'){
$emp_code = ' ('. $inner_item['emp_code'] . ')';
}else{
$emp_code ='';
}
$temp_data .= '<tr ><td style="width:20%">' . $inner_item['name'] . $emp_code . '</td><td style="width:20%">'.$inner_item['relationship'].'</td><td>'. \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') .'</td><td style="width:20%">₹'.format_indian_number($inner_item['basic_cover_si']).'</td><td style="width:20%">₹'.format_indian_number($inner_item['premium']).'</td><td>₹'. format_indian_number($inner_item['gst']) .'</td></tr><tr>';
$is_addon = $inner_item['is_addon'];
if($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3){
@ -392,10 +409,10 @@ class sendMailNotification
$gst = $inner_item['gst'] + $gst;
}
}
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Mobile Number</th><th>Sum Insure</th><th style="width:15%">Date Of Birth</th></tr></thead><tbody>';
$table_content .= $policy_name.'</h4></div><table style="width:60%"><thead style="background-color: #02a8b5;"><tr><th style="width:20%">Name</th><th>Relation</th><th style="width:15%">Date Of Birth</th><th>Sum Insure</th><th>Premium</th><tj>GST</th></tr></thead><tbody>';
$table_content .= $temp_data;
$table_content .= '</tbody></table></div>';
$Addon_list = [];
if ($is_addon == 2 || $is_addon == 3) {
$addon_list_array = [
'policy_name'=>$policy_name,
@ -412,16 +429,18 @@ class sendMailNotification
$gst = 0;
}
$table_content .='<br><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
if(count($Addon_list) != 0 && count($Addon_list) > 0){
$table_content .='<br><div style="text-align: left;"><div style="text-align:left;"><table style="width:60%"><thead style="background-color: #e26828;"><tr><th>Policy Name</th><th> Additional Premium</th><th>GST</th><th>Total</th></tr></thead><tbody>';
$sum_tolal = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr><td>'.$value['policy_name'].'</td><td>₹'.$value['addtional_premium'].'</td><td>'.$value['gst'].'</td><td>'.$value['gst'] + $value['addtional_premium'] .'</td></tr>';
}
$sum_total_words = numberToWords($sum_tolal);
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.format_indian_number($sum_tolal).'</td></tr>';
$table_content .= '</tbody></table></div></div>';
$table_content .= '<div style="width:60%;text-align:right">'. $sum_total_words .'</div>';
}
$table_content .= '<tr><td></td><td></td><td><h4>Total</h4></td><td>'.$sum_tolal.'</td></tr>';
$table_content .= '</tbody></table>';
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
@ -438,5 +457,5 @@ class sendMailNotification
}
}
}
}
}

View File

@ -139,3 +139,9 @@ if (!function_exists('get_session_context')) {
return $session->get('context');
}
}

View File

@ -248,3 +248,64 @@ if (!function_exists('get_role_id')) {
}
function numberToWords($number)
{
$words = array(
'0' => 'Zero',
'1' => 'One',
'2' => 'Two',
'3' => 'Three',
'4' => 'Four',
'5' => 'Five',
'6' => 'Six',
'7' => 'Seven',
'8' => 'Eight',
'9' => 'Nine',
'10' => 'Ten',
'11' => 'Eleven',
'12' => 'Twelve',
'13' => 'Thirteen',
'14' => 'Fourteen',
'15' => 'Fifteen',
'16' => 'Sixteen',
'17' => 'Seventeen',
'18' => 'Eighteen',
'19' => 'Nineteen',
'20' => 'Twenty',
'30' => 'Thirty',
'40' => 'Forty',
'50' => 'Fifty',
'60' => 'Sixty',
'70' => 'Seventy',
'80' => 'Eighty',
'90' => 'Ninety'
);
if ($number < 21) {
return $words[$number];
}
if ($number < 100) {
$tens = (int)($number / 10) * 10;
$units = $number % 10;
return $words[$tens] . ($units ? ' ' . $words[$units] : '');
}
if ($number < 1000) {
$hundreds = (int)($number / 100);
$remainder = $number % 100;
return $words[$hundreds] . ' Hundred' . ($remainder ? ' and ' . numberToWords($remainder) : '');
}
$levels = array('', ' Thousand', ' Million', ' Billion', ' Trillion', ' Quadrillion', ' Quintillion');
for ($i = 0, $unit = 1; $i < count($levels); $i++, $unit *= 1000) {
if ($number < $unit * 1000) {
$current = (int)($number / $unit);
$remainder = $number % $unit;
return numberToWords($current) . $levels[$i] . ($remainder ? ' ' . numberToWords($remainder) : '');
}
}
return $number; // Fallback for numbers beyond the supported range
}

View File

@ -101,6 +101,9 @@ class EmployeePolicyModel extends Model
'emp.emp_status',
'emp.is_active as emp_is_active',
'emp.mobile as mobile',
'emp.doj',
'emp.basic_pay',
'emp.band as grade',
'policy_type.policy_type',
'cp.policy_no',
])