CHANGE_SENDMAIL_NOTIFICATION_TABLE_TEXT_CENTER_ALIGN : RV

This commit is contained in:
VENKATESHWARAN 2024-10-10 12:34:57 +05:30
parent 376d3828fc
commit 3ebc859692

View File

@ -189,16 +189,22 @@ class sendMailNotification
foreach ($array_list as $item) {
if (count($item) != 0) {
$table_content .= '<div style="text-align: left; font-size: 12px; ">';
$table_content .= '<div style="text-align:left;"><h4 style="font-size: 12px; ">Policy Name : ';
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
$temp_data = '';
$policy_name = '';
$is_addon = '';
foreach ($item as $inner_item) {
$policy_name = $inner_item['policy_name'];
$temp_data .= '<tr style="font-size: 12px; ">';
$temp_data .= '<td>' . $inner_item['name'] . '</td>';
if ($inner_item['relationship'] == 'Self') {
$emp_code = ' (' . $inner_item['emp_code'] . ')';
} else {
$emp_code = '';
}
$temp_data .= '<tr>';
$temp_data .= '<td>' . $inner_item['name'] . $emp_code . '</td>';
$temp_data .= '<td>' . $inner_item['relationship'] . '</td>';
$temp_data .= '<td>' . \DateTime::createFromFormat('Y-m-d', $inner_item['dob'])->format('d-m-Y') . '</td>';
$temp_data .= '<td>₹' . format_indian_number($inner_item['basic_cover_si']) . '</td>';
@ -211,14 +217,6 @@ class sendMailNotification
$temp_data .= '</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'];
}
$is_addon = $inner_item['is_addon'];
if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) {
@ -229,7 +227,9 @@ class sendMailNotification
$table_content .= $policy_name . '</h4></div>';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff;">';
// Add text-align: center to the table head
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Name</th>';
$table_content .= '<th>Relation</th>';
@ -244,7 +244,9 @@ class sendMailNotification
$table_content .= '</tr>';
$table_content .= '</thead>';
$table_content .= '<tbody>' . $temp_data . '</tbody>';
// Add text-align: center to the table body
$table_content .= '<tbody style="text-align: center;">' . $temp_data . '</tbody>';
$table_content .= '</table></div>';
if ($is_addon == 2 || $is_addon == 3) {
@ -262,31 +264,47 @@ class sendMailNotification
}
}
if (count($Addon_list) != 0 && count($Addon_list) > 0) {
$table_content .= '<br><div style="text-align: left; font-size: 12px; ">';
$table_content .= '<div style="text-align:left;">';
if (count($Addon_list) > 0) {
$table_content .= '<br><div style="text-align: left; font-size: 12px;"><div style="text-align:left;">';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff;">';
$table_content .= '<tr style="font-size: 12px;" ><th>Policy Name</th><th>Additional Premium</th><th>GST</th><th>Total</th></tr>';
$table_content .= '</thead><tbody>';
$sum_tolal = 0;
// Center align for table header and body
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Policy Name</th>';
$table_content .= '<th>Additional Premium</th>';
$table_content .= '<th>GST</th>';
$table_content .= '<th>Total</th>';
$table_content .= '</tr>';
$table_content .= '</thead>';
$table_content .= '<tbody style="text-align: center;">';
$sum_total = 0;
foreach ($Addon_list as $key => $value) {
$sum_tolal = $value['gst'] + $value['addtional_premium'] + $sum_tolal;
$table_content .= '<tr style="font-size: 12px; "><td>' . $value['policy_name'] . '</td>';
$total_addon = $value['gst'] + $value['addtional_premium'];
$sum_total += $total_addon;
$table_content .= '<tr>';
$table_content .= '<td>' . $value['policy_name'] . '</td>';
$table_content .= '<td>₹' . format_indian_number($value['addtional_premium']) . '</td>';
$table_content .= '<td>₹' . format_indian_number($value['gst']) . '</td>';
$table_content .= '<td>₹' . format_indian_number(($value['gst'] + $value['addtional_premium'])) . '</td></tr>';
$table_content .= '<td>₹' . format_indian_number($total_addon) . '</td>';
$table_content .= '</tr>';
}
$sum_total_words = numberToWords($sum_tolal);
$table_content .= '<tr style="font-size: 12px;"><td></td><td></td><td><b>Total</b></td><td>₹' . format_indian_number($sum_tolal) . '</td></tr>';
$table_content .= '</tbody></table></div></div>';
$sum_total_words = numberToWords($sum_total);
$table_content .= '<tr>';
$table_content .= '<td></td><td></td><td><b>Total</b></td>';
$table_content .= '<td>₹' . format_indian_number($sum_total) . '</td>';
$table_content .= '</tr>';
$table_content .= '</tbody>';
$table_content .= '</table></div></div>';
// $table_content .= '<div style="width:100%; text-align:right; font-size: 12px;">' . $sum_total_words . '</div>';
}
// print_r($table_content); die;
$mail_content = str_replace("[[member_name]]", $name . ' (' . $emp_code . ')' , $mail_content);
@ -349,7 +367,6 @@ class sendMailNotification
$Addon_list = [];
foreach ($array_list as $item) {
if (count($item) != 0) {
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
$temp_data = '';
@ -389,7 +406,9 @@ class sendMailNotification
$table_content .= $policy_name . '</h4></div>';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff;">';
// Add text-align: center to the table head
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Name</th>';
$table_content .= '<th>Relation</th>';
@ -404,7 +423,9 @@ class sendMailNotification
$table_content .= '</tr>';
$table_content .= '</thead>';
$table_content .= '<tbody>' . $temp_data . '</tbody>';
// Add text-align: center to the table body
$table_content .= '<tbody style="text-align: center;">' . $temp_data . '</tbody>';
$table_content .= '</table></div>';
if ($is_addon == 2 || $is_addon == 3) {
@ -425,7 +446,9 @@ class sendMailNotification
if (count($Addon_list) > 0) {
$table_content .= '<br><div style="text-align: left; font-size: 12px;"><div style="text-align:left;">';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff;">';
// Center align for table header and body
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Policy Name</th>';
$table_content .= '<th>Additional Premium</th>';
@ -433,7 +456,8 @@ class sendMailNotification
$table_content .= '<th>Total</th>';
$table_content .= '</tr>';
$table_content .= '</thead>';
$table_content .= '<tbody>';
$table_content .= '<tbody style="text-align: center;">';
$sum_total = 0;
foreach ($Addon_list as $key => $value) {
@ -458,6 +482,7 @@ class sendMailNotification
// $table_content .= '<div style="width:100%; text-align:right; font-size: 12px;">' . $sum_total_words . '</div>';
}
$mail_content = str_replace("[[member_summary]]", $table_content , $mail_content);
$account_manager_mail_list = [];
@ -519,7 +544,6 @@ class sendMailNotification
$Addon_list = [];
foreach ($array_list as $item) {
if (count($item) != 0) {
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Name : ';
$temp_data = '';
@ -559,7 +583,9 @@ class sendMailNotification
$table_content .= $policy_name . '</h4></div>';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff;">';
// Add text-align: center to the table head
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Name</th>';
$table_content .= '<th>Relation</th>';
@ -574,7 +600,9 @@ class sendMailNotification
$table_content .= '</tr>';
$table_content .= '</thead>';
$table_content .= '<tbody>' . $temp_data . '</tbody>';
// Add text-align: center to the table body
$table_content .= '<tbody style="text-align: center;">' . $temp_data . '</tbody>';
$table_content .= '</table></div>';
if ($is_addon == 2 || $is_addon == 3) {
@ -595,7 +623,9 @@ class sendMailNotification
if (count($Addon_list) > 0) {
$table_content .= '<br><div style="text-align: left; font-size: 12px;"><div style="text-align:left;">';
$table_content .= '<table border="1" cellpadding="5" cellspacing="0" style="width:100%; border-collapse: collapse; font-size: 12px;">';
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff;">';
// Center align for table header and body
$table_content .= '<thead style="background-color: #02a8b5; color: #ffffff; text-align: center;">';
$table_content .= '<tr>';
$table_content .= '<th>Policy Name</th>';
$table_content .= '<th>Additional Premium</th>';
@ -603,7 +633,8 @@ class sendMailNotification
$table_content .= '<th>Total</th>';
$table_content .= '</tr>';
$table_content .= '</thead>';
$table_content .= '<tbody>';
$table_content .= '<tbody style="text-align: center;">';
$sum_total = 0;
foreach ($Addon_list as $key => $value) {