MERGE_CODE_MERGE : RV

This commit is contained in:
VENKATESHWARAN 2025-09-09 15:52:15 +05:30
commit e0651486ed
13 changed files with 2046 additions and 1487 deletions

View File

@ -87,6 +87,8 @@ class NotificationController extends AdminController
'client_hr_summary_mail_btn'
];
$data = [];
$emptyTemplate = [];
$updatedTemplate = [];
foreach ($checkboxNames as $checkboxName)
{
@ -111,9 +113,31 @@ class NotificationController extends AdminController
$id = $find['id'];
$changeData['enabled']= $value;
$update = $notificationModel->update($id, $changeData);
$updatedTemplate [] = $key;
}
if(!$find && $value == 1){
$emptyTemplate [] = $key;
}
}
return json_encode("true");
if(count($emptyTemplate) > 0){
return $this->response->setJSON([
'status' => false,
'code' => 400,
'message' => 'Notification settings updation Failed.',
'updated_templates' => $updatedTemplate,
'empty_templates' => $emptyTemplate
]);
}
return $this->response->setJSON([
'status' => true,
'code' => 200,
'message' => 'Notification settings updated successfully.',
'updated_templates' => $updatedTemplate,
'empty_templates' => $emptyTemplate
]);
}
// This for Load the Template Data for in View Page

View File

@ -15,6 +15,7 @@ use App\Models\UserModel;
use App\Models\ClientPolicyModel;
use App\Models\ClientModel;
use App\Models\TicketMailTemplateModel;
use App\Models\ClientRMModel;
class ThzController extends BaseController
@ -31,6 +32,8 @@ class ThzController extends BaseController
protected $clientModel;
protected $ticketMailTemplateModel;
protected $cientRmModel;
protected $myLogger;
public function __construct()
@ -43,6 +46,7 @@ class ThzController extends BaseController
$this->userModel = new UserModel();
$this->clientPolicyModel = new ClientPolicyModel();
$this->clientModel = new ClientModel();
$this->cientRmModel = new ClientRMModel();
$this->ticketMailTemplateModel = new TicketMailTemplateModel();
$this->myLogger = \Config\Services::mylogger();
}
@ -52,178 +56,181 @@ class ThzController extends BaseController
//
}
public function ticketSave(){
try
{
$data = $this->request->getPost();
$references = "";
if (!empty($data['thz_id'])) {
$text = "update";
// here insert history Status.
$old = $this->thzMasterModel->where('thz_id', $data['thz_id'])->get()->getRowArray();
$result = $this->updateTicket($data);
if ($old && isset($data['status'])) {
if ($old['status'] != $data['status']) {
$history = [
'thz_id' => $data['thz_id'],
'field_name' => 'status',
'display_name' => 'Status',
'old_value' => $old['status'],
'new_value' => $data['status'],
'is_active' => 1
];
if (!empty(get_session_userid())) {
$history['created_by'] = get_session_userid();
}
$hist_id = $this->thzHistoryModel->insert($history);
$references = $old['status']." - ".$data['status']." - ".$hist_id;
}else{
$references = $old['status']." - ".$data['status'];
}
}else{
$references = "No Details";
}
$updateID = $data['thz_id'];
} else {
$text = "create";
$insertID = $this->insertTicket($data);
$result = true;
public function ticketSave()
{
try {
$data = $this->request->getPost();
$references = "";
if (!empty($data['thz_id'])) {
}
$text = "update";
// here insert history Status.
$old = $this->thzMasterModel->where('thz_id', $data['thz_id'])->get()->getRowArray();
$result = $this->updateTicket($data);
$id = isset($insertID) && !empty($insertID) ? $insertID : $updateID ;
if ($old && isset($data['status'])) {
$emailNotificationResult = $this->ticketSaveNotification($data , $insertOrUpdate = $text , $id);
if ($old['status'] != $data['status']) {
$history = [
'thz_id' => $data['thz_id'],
'field_name' => 'status',
'display_name' => 'Status',
'old_value' => $old['status'],
'new_value' => $data['status'],
'is_active' => 1
];
return $this->response->setJSON([
if (!empty(get_session_userid())) {
$history['created_by'] = get_session_userid();
}
$hist_id = $this->thzHistoryModel->insert($history);
$references = $old['status'] . " - " . $data['status'] . " - " . $hist_id;
} else {
$references = $old['status'] . " - " . $data['status'];
}
} else {
$references = "No Details";
}
$updateID = $data['thz_id'];
} else {
$text = "create";
$insertID = $this->insertTicket($data);
$result = true;
$references = "";
}
$id = isset($insertID) && !empty($insertID) ? $insertID : $updateID;
$emailNotificationResult = $this->ticketSaveNotification($data, $insertOrUpdate = $text, $id);
return $this->response->setJSON([
'status' => $result ? 'success' : 'error',
'message' => $result ? "Ticket {$text}d successfully " : "Unable to {$text} ticket. Please try again." ,
'message' => $result ? "Ticket {$text}d successfully " : "Unable to {$text} ticket. Please try again.",
'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed..!!',
'ref' => $references
])->setStatusCode($result ? 200 : 400);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
])->setStatusCode($result ? 200 : 400);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([
'status' => 'error',
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
}
public function ticketList()
{
try{
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
$data = $this->request->getGet();
if ($returnType === 'web' && in_array(get_role_id(), [2,3,4])) {
$data['assign_to'] = $data['assign_to'] ?? get_session_userid();
}
try {
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
$tickets = $this->fetchTicketsBasedOnrole($data);
if ($returnType === 'api') {
if (empty($tickets)) {
// return $this->response->setJSON([ 'status' => 'error','message' => 'No tickets found'])->setStatusCode(404);
throw new \RuntimeException('No tickets found', 400);
$data = $this->request->getGet();
if ($returnType === 'web' && in_array(get_role_id(), [2, 3, 4])) {
$data['assign_to'] = $data['assign_to'] ?? get_session_userid();
}
}else{
$data['page_name'] = "Tickets";
$data['ticket_data'] = $tickets;
$data['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
// 2,3,4 remain person varannum.
$data['client_list'] = $this->clientModel->getCreatedByUserName();
$data['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
return $this->loadLayout('thz_list', $data);
}
return $this->response->setJSON([
'status' => 'success',
'data' => $tickets,
])->setStatusCode(200);
}
catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$tickets = $this->fetchTicketsBasedOnrole($data);
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
if ($returnType === 'api') {
if (empty($tickets)) {
// return $this->response->setJSON([ 'status' => 'error','message' => 'No tickets found'])->setStatusCode(404);
throw new \RuntimeException('No tickets found', 400);
}
} else {
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
$data['page_name'] = "Tickets";
$data['ticket_data'] = $tickets;
$data['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3', '4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
// 2,3,4 remain person varannum.
$data['client_list'] = $this->clientModel->getCreatedByUserName();
$data['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
return $this->loadLayout('thz_list', $data);
}
return $this->response->setJSON([
'status' => 'success',
'data' => $tickets,
])->setStatusCode(200);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([
'status' => 'error',
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
}
public function ticketConversationSave(){
public function ticketConversationSave()
{
try {
try {
$data = $this->request->getPost();
$data['notes_type'] = $data['notes_type'] ?? 'External' ;
$data['notes_type'] = $data['notes_type'] ?? 'External';
$result = $this->thzMasterNotesModel->insert($data);
if(empty($result)){
if (empty($result)) {
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404);
throw new \RuntimeException('No tickets found', 404);
throw new \RuntimeException('No tickets found', 404);
}
if($data['notes_type'] == "External"){
if ($data['notes_type'] == "External") {
$emailNotificationResult = $this->ticketConversationSaveNotification($data);
}else{
$emailNotificationResult = false ;
} else {
$emailNotificationResult = false;
}
return $this->response->setJSON([
return $this->response->setJSON([
'status' => $result ? 'success' : 'error',
'message' => $result ? "Ticket Notes created successfully" : "Unable to create ticket notes. Please try again." ,
'message' => $result ? "Ticket Notes created successfully" : "Unable to create ticket notes. Please try again.",
'notification' => $emailNotificationResult ? 'Email Notification Success..!!' : 'Email Notification Failed Or No Need..!!'
])->setStatusCode($result ? 200 : 400);
}
catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
])->setStatusCode($result ? 200 : 400);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([
'status' => 'error',
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
}
@ -254,190 +261,193 @@ class ThzController extends BaseController
}
return $this->response->setJSON(['status' => 'success', 'data' => $result])->setStatusCode(200);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
}
catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
return $this->response->setJSON([
'status' => 'error',
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
}
public function ticketConversationList()
{
$data = $this->request->getGet();
$data = $this->request->getGet();
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
$returnType = strtolower($this->request->getGet('return_type') ?? 'api');
$thz_id = $data['thz_id'] ?? null;
$ticketType = $data['notes_type'] ?? 'External' ;
$thz_id = $data['thz_id'] ?? null;
if($thz_id){
$result['master'] = $this->thzMasterModel
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
->where('thz_master.thz_id', $thz_id)
->findAll();
$ticketType = $data['notes_type'] ?? 'External';
if(!empty($result['master'])){
$notes = $this->thzMasterNotesModel->ticketConversationList($thz_id, $returnType );
$result['notes'] = !empty($notes) ? $notes : [];
}else{
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(400);
throw new \RuntimeException('No tickets found', 400);
}
}else{
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404);
throw new \RuntimeException('No tickets found', 404);
if ($thz_id) {
$result['master'] = $this->thzMasterModel
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
->where('thz_master.thz_id', $thz_id)
->findAll();
if (!empty($result['master'])) {
$notes = $this->thzMasterNotesModel->ticketConversationList($thz_id, $returnType);
$result['notes'] = !empty($notes) ? $notes : [];
} else {
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(400);
throw new \RuntimeException('No tickets found', 400);
}
} else {
// return $this->response->setJSON((['status' => 'error', 'message' => 'No tickets found']))->setStatusCode(404);
throw new \RuntimeException('No tickets found', 404);
}
if ($returnType === 'api') {
try {
return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
if ($returnType === 'api') {
try {
return $this->response->setJSON((['status' => 'success', 'data' => $result]))->setStatusCode(200);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
}else{
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
$assign_to = $result['master'][0]['assign_to'];
$mobile = $result['master'][0]['mobile'];
return $this->response->setJSON([
'status' => 'error',
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
} else {
$toGetPolicyId = (!empty($result['master'][0]['policy_id']) && strtolower($result['master'][0]['policy_id']) !== 'null')
? $result['master'][0]['policy_id']
: '';
$assign_to = $result['master'][0]['assign_to'];
$mobile = $result['master'][0]['mobile'];
$result['related_tickets'] = $this->thzMasterModel
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
->where('thz_master.assign_to', $assign_to)
->where('thz_master.mobile',$mobile)
->where('thz_master.thz_id !=',$thz_id)
->where('thz_master.status !=','Closed')
->where('thz_master.status !=','Resolved')
->findAll();
$result['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3','4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
// 2,3,4 remain person varannum.
$result['policy_terms'] = $toGetPolicyId ? $this->getPolicyTerms($toGetPolicyId) : '';
$toGetPolicyId = (!empty($result['master'][0]['policy_id']) && strtolower($result['master'][0]['policy_id']) !== 'null')
? $result['master'][0]['policy_id']
: '';
$result['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
return $this->loadLayout('thz_notes', $result);
}
$result['related_tickets'] = $this->thzMasterModel
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
->where('thz_master.assign_to', $assign_to)
->where('thz_master.mobile', $mobile)
->where('thz_master.thz_id !=', $thz_id)
->where('thz_master.status !=', 'Closed')
->where('thz_master.status !=', 'Resolved')
->findAll();
$result['assignee'] = $this->userModel->where('is_active', 1)->whereIn('role', ['2', '3', '4'])->findAll(); // enga 5-"head" and 1-"admin" assign pannvaga so dropdown la varakudhathu
// 2,3,4 remain person varannum.
$result['policy_terms'] = $toGetPolicyId ? $this->getPolicyTerms($toGetPolicyId) : '';
$result['ticket_type'] = $this->thzTypeModel->where('is_active', 1)->findAll();
return $this->loadLayout('thz_notes', $result);
}
}
public function ticketType()
{
$method = $this->request->getMethod(); // get, post
try{
if ($method === 'get') {
try {
if ($method === 'get') {
$types = $this->thzTypeModel->select('id,name,is_active')->where('is_active', 1)->findAll();
if (empty($types)) {
return $this->response->setJSON(['status' => 'error','message' => 'No ticket types found'])->setStatusCode(404);
return $this->response->setJSON(['status' => 'error', 'message' => 'No ticket types found'])->setStatusCode(404);
}
return $this->response->setJSON(['status' => 'success','data' => $types])->setStatusCode(200);
}
return $this->response->setJSON(['status' => 'success', 'data' => $types])->setStatusCode(200);
}
if ($method === 'post') {
$data = $this->request->getPost();
if (!empty($data['id'])) {
$text = "update";
$text = "update";
$result = $this->thzTypeModel->update($data['id'], $data);
$updateID = $data['id'];
} else {
$text = "create";
$text = "create";
$insertID = $this->thzTypeModel->insert($data);
$result = true;
}
$id = isset($insertID) && !empty($insertID) ? $insertID : ($updateID ?? null);
return $this->response->setJSON([
return $this->response->setJSON([
'status' => $id ? 'success' : 'error',
'message' => $id ? "Ticket Type {$text}d successfully" : "Unable to {$text} ticket type. Please try again.",
'id' => $id
])->setStatusCode($id ? 200 : 400);
}
return $this->response->setJSON([ 'status' => 'error', 'message' => 'Invalid request method' ])->setStatusCode(405);
}
catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
return $this->response->setJSON(['status' => 'error', 'message' => 'Invalid request method'])->setStatusCode(405);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([
'status' => 'error',
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
}
public function ticketHistoryList()
{
try
{
$data = $this->request->getGet();
$thz_id = $data['thz_id'];
// $details = $this->thzHistoryModal->whereIn('thz_id', $thz_id)->where('is_active', 1)->get()->getResultArray();
$details = $this->thzHistoryModel->select('thz_history.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as created_name')
->join('user_profiles', 'user_profiles.id = thz_history.created_by', 'left')
->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1)
->orderBy('thz_history.created_at', 'desc')
->get()->getResultArray();
try {
$data = $this->request->getGet();
$thz_id = $data['thz_id'];
// $details = $this->thzHistoryModal->whereIn('thz_id', $thz_id)->where('is_active', 1)->get()->getResultArray();
$details = $this->thzHistoryModel->select('thz_history.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as created_name')
->join('user_profiles', 'user_profiles.id = thz_history.created_by', 'left')
->where('thz_history.thz_id', $thz_id)->where('thz_history.is_active', 1)
->orderBy('thz_history.created_at', 'desc')
->get()->getResultArray();
if (empty($details)) {
// return $this->response->setJSON([ 'status' => 'error','message' => 'No History found'])->setStatusCode(404);
throw new \RuntimeException('No History found', 404);
}
return $this->response->setJSON(['status' => 'success','data' => $details])->setStatusCode(200);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
return $this->response->setJSON(['status' => 'success', 'data' => $details])->setStatusCode(200);
} catch (\Throwable $e) {
$code = ($e->getCode() && $e->getCode() >= 100 && $e->getCode() < 600) ? $e->getCode() : 500;
$context = ['title' => get_class($e),'type' => get_class($e),'code' => $code,'message' => $e->getMessage(),'file' => $e->getFile(),'line' => $e->getLine()];
$isDbError = $e instanceof \CodeIgniter\Database\Exceptions\DatabaseException
|| $e instanceof \mysqli_sql_exception
|| $e instanceof \PDOException;
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([ 'status' => 'error', 'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
$context = ['title' => get_class($e), 'type' => get_class($e), 'code' => $code, 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()];
$this->myLogger->logme('error', "Exception: {message} in {file} on line {line}", $context, 0);
return $this->response->setJSON([
'status' => 'error',
'message' => $isDbError ? 'Data Access Error' : $e->getMessage(),
'ref' => $isDbError ? 'database - ' : 'application - ' . $code . ' - ' . $e->getLine()
])->setStatusCode($code);
}
}
@ -454,70 +464,73 @@ class ThzController extends BaseController
if (!empty($assign_to)) {
// Tickets assigned to a staff
return $this->thzMasterModel
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
->where('thz_master.assign_to', $assign_to)
->orderBy('thz_master.created_at','desc')
->findAll();
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
->where('thz_master.assign_to', $assign_to)
->orderBy('thz_master.created_at', 'desc')
->findAll();
}
// if (!empty($id) && !empty($mobile)) {
if (!empty($mobile)) {
// Specific ticket by ID and mobile
return $this->thzMasterModel
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
// ->where('thz_id', $id)
->where('thz_master.mobile', $mobile)
->orderBy('thz_master.created_at','desc')
->findAll();
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
// ->where('thz_id', $id)
->where('thz_master.mobile', $mobile)
->orderBy('thz_master.created_at', 'desc')
->findAll();
}
// All tickets (e.g., for managers)
return $this->thzMasterModel
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
->orderBy('thz_master.created_at','desc')
->findAll();
->select('thz_master.*, CONCAT(user_profiles.first_name, " ", user_profiles.last_name) as assignee_name')
->join('user_profiles', 'user_profiles.id = thz_master.assign_to', 'left')
->orderBy('thz_master.created_at', 'desc')
->findAll();
}
private function ticketSaveNotification( $data , $insertOrUpdate , $id){
private function ticketSaveNotification($data, $insertOrUpdate, $id)
{
$user_email = $data['email'] ?? null;
$assignee_id = $data['assign_to'] ?? null;
$assignee_email = $this->findAssigneeEmail($assignee_id);
$client_id = $data['client_id'] ?? null;
$emailToNotified = [
'user_email' => $user_email,
'assignee_email' => $assignee_email
'assignee_email' => $assignee_email
];
$ticketId = $id;
$result = $this->ticketSaveEmailNotificationBasedOnRole($emailToNotified , $insertOrUpdate , $ticketId , $data);
return $result;
$result = $this->ticketSaveEmailNotificationBasedOnRole($emailToNotified, $insertOrUpdate, $ticketId, $data, $client_id);
return $result;
}
private function ticketConversationSaveNotification($data){
private function ticketConversationSaveNotification($data)
{
$thz_id = $data['thz_id'] ; // thz is alias of ticket
$thz_id = $data['thz_id']; // thz is alias of ticket
$data['subject'] = $this->findSubject($data['thz_id']);
$assignee_id = $this->findAssigneeId($data['thz_id']) ;
$assignee_id = $this->findAssigneeId($data['thz_id']);
$user_email = $this->findUserEmail($data['thz_id']);
$user_email = $this->findUserEmail($data['thz_id']) ;
$assignee_email = $this->findAssigneeEmail($assignee_id) ?? '';
$sender_mail = $data['notes_by'] == "User" ? $user_email : $assignee_email ;
$receiver_mail = $data['notes_by'] == "User" ? $assignee_email : $user_email ;
$sender_mail = $data['notes_by'] == "User" ? $user_email : $assignee_email;
$receiver_mail = $data['notes_by'] == "User" ? $assignee_email : $user_email;
$templateName = "ticket_conversation_save_notification";
@ -527,40 +540,43 @@ class ThzController extends BaseController
$message = $data['notes'] ?? '';
$this->sendEmail( $templateName, $data , $to_email , $ticketId , $message);
$this->sendEmail($templateName, $data, $to_email, $ticketId, $message);
return true;
}
private function findAssigneeEmail($assignee_id){
private function findAssigneeEmail($assignee_id)
{
$row = $this->userModel->where('id', $assignee_id)->get()->getRow();
$assigneeEmail = $row ? $row->email : null;
return $assigneeEmail ? $assigneeEmail : "";
return $assigneeEmail ? $assigneeEmail : "";
}
private function findAssigneeId($ticketId){
private function findAssigneeId($ticketId)
{
$row = $this->thzMasterModel->where('thz_id', $ticketId)->get()->getRow();
$assigneeId = $row ? $row->assign_to : null;
return $assigneeId ? $assigneeId : 0 ;
return $assigneeId ? $assigneeId : 0;
}
private function findUserEmail($ticket_id){
private function findUserEmail($ticket_id)
{
$row = $this->thzMasterModel->where('thz_id', $ticket_id)->get()->getRow();
$email = $row ? $row->email : null;
return $email ? $email : " " ;
return $email ? $email : " ";
}
private function findSubject($ticketId){
private function findSubject($ticketId)
{
$row = $this->thzMasterModel->where('thz_id', $ticketId)->get()->getRow();
$subject = $row ? $row->subject : null;
return $subject ? $subject : " " ;
return $subject ? $subject : " ";
}
private function ticketSaveEmailNotificationBasedOnRole($emailToNotified , $insertOrUpdate , $ticketId , $data){
private function ticketSaveEmailNotificationBasedOnRole($emailToNotified, $insertOrUpdate, $ticketId, $data, $client_id)
{
$user_email = $emailToNotified['user_email'] ?? null;
$assignee_email = $emailToNotified['assignee_email'] ?? null;
@ -572,21 +588,20 @@ class ThzController extends BaseController
case 'update':
$this->sendEmail( 'ticket_save_update_assignee', $data ,$assignee_email , $ticketId ) ;
$this->sendEmail('ticket_save_update_assignee', $data, $assignee_email, $ticketId);
break;
case 'create':
$this->sendEmail( 'ticket_save_create_assignee', $data ,$assignee_email , $ticketId ) ;
$this->sendEmail('ticket_save_create_assignee', $data, $assignee_email, $ticketId);
break;
default:
# code...
break;
}
}
if (!empty($user_email)) {
@ -595,47 +610,55 @@ class ThzController extends BaseController
case 'update':
if(empty($assignee_email)){
$data['assigneeAndStatus'] = "Not Yet Assigned";
$this->sendEmail( 'ticket_save_update_user', $data ,$user_email , $ticketId ) ;
}else{
$data['assigneeAndStatus'] = "Assigned With {$assignee_email}";
$this->sendEmail( 'ticket_save_update_user', $data ,$user_email , $ticketId ) ;
}
$data['assigneeAndStatus'] = empty($assignee_email)
? "Not Yet Assigned"
: "Assigned With {$assignee_email}";
$this->sendEmail('ticket_save_update_user', $data, $user_email, $ticketId);
break;
break;
case 'create':
if(empty($assignee_email)){
$this->sendEmail( 'ticket_save_create_user_unassigned', $data ,$user_email , $ticketId ) ;
}else{
$data['assignee_email'] = $assignee_email ;
$this->sendEmail( 'ticket_save_create_user_assigned', $data , $user_email , $ticketId ) ;
$account_manager_email = $this->cientRmModel->findAccountManagerEmail($client_id);
$cc = getenv(' G_ticketing_system_cc');
$template = empty($assignee_email)
? 'ticket_save_create_user_unassigned'
: 'ticket_save_create_user_assigned';
if (!empty($assignee_email)) {
$data['assignee_email'] = $assignee_email;
}
$this->sendEmail($template, $data, $user_email, $ticketId);
// send to account manager and if it is more than one email also no problem we send to all account managers
if (!empty($account_manager_email)) {
$this->sendEmail($template, $data, $account_manager_email, $ticketId, $cc);
}
break;
default:
# code...
break;
}
}
return true;
}
private function updateTicket($data){
private function updateTicket($data)
{
$data['updated_by'] = get_session_userid();
$ticket_id = $data['thz_id'];
$result = $this->thzMasterModel->where('thz_id', $ticket_id)->set($data)->update();
return $result;
}
private function insertTicket($data)
@ -647,12 +670,13 @@ class ThzController extends BaseController
}
private function sendEmail( $templateName, $data , $to_email , $ticketId , $message = ""){
$mailTemplate = $this->ticketMailTemplateModel->where('template_name',$templateName )->findAll()[0] ?? [];
private function sendEmail($templateName, $data, $to_email, $ticketId , $cc = "", $message = "", $bcc = "")
{
if(empty($mailTemplate)){
return ;
$mailTemplate = $this->ticketMailTemplateModel->where('template_name', $templateName)->findAll()[0] ?? [];
if (empty($mailTemplate)) {
return;
}
$mailTemplate['subject'] = str_replace('%subject%', $data['subject'] ?? '', $mailTemplate['subject']);
@ -665,39 +689,35 @@ class ThzController extends BaseController
$mailTemplate['mail_content'] = str_replace('%assignee_email%', $data['assignee_email'] ?? '', $mailTemplate['mail_content']);
$mailTemplate['mail_content'] = str_replace('%assigneeAndStatus%',$data['assigneeAndStatus'] ?? '' ,$mailTemplate['mail_content']);
$mailTemplate['mail_content'] = str_replace('%assigneeAndStatus%', $data['assigneeAndStatus'] ?? '', $mailTemplate['mail_content']);
$from_mail = "";
$to_mail = $to_email;
$cc_string = "";
$subject = $mailTemplate['subject'] ;
$message = $mailTemplate['mail_content'] ;
$cc_string = $cc;
$subject = $mailTemplate['subject'];
$message = $mailTemplate['mail_content'];
$attachments = "";
$reply_to = "";
$bcc_string = "";
$res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $to_mail , 'cc' => $cc_string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string]);
$bcc_string = $bcc;
$res = MailHelper::send_email(['from_mail' => $from_mail, 'mail' => $to_mail, 'cc' => $cc_string, 'subject' => $subject, 'message' => $message, 'attachments' => $attachments, 'reply_to' => $reply_to, 'bcc' => $bcc_string]);
}
public function getPolicyTerms($client_policy_id)
{
$policy_data = $this->clientPolicyModel->where('is_active', 1)->where('id', $client_policy_id)->first();
$policy_terms = [];
if(isset($policy_data['policy_terms']) && !empty($policy_data['policy_terms'])){
$raw_terms = json_decode($policy_data['policy_terms'] ?? [] , true) ?? [];
$ticketController = new TicketController();
$policy_terms = $ticketController->convertTermsToDisplay($raw_terms);
$policy_terms = [];
if (isset($policy_data['policy_terms']) && !empty($policy_data['policy_terms'])) {
$raw_terms = json_decode($policy_data['policy_terms'] ?? [], true) ?? [];
$ticketController = new TicketController();
$policy_terms = $ticketController->convertTermsToDisplay($raw_terms);
}
$data['policy_terms'] = $policy_terms;
return view('view_policy_terms', $data);
}
}

View File

@ -21,22 +21,38 @@ class ClientRMModel extends Model
public function checkExistenceOfClientRelation($id, $user_id, $level)
{
$query = $this->where('client_id', $id)
->where('user_id', $user_id)
->where('level', $level)
->countAllResults();
->where('user_id', $user_id)
->where('level', $level)
->countAllResults();
return ($query > 0) ? true : false;
}
public function getAllClientRM(){
public function getAllClientRM()
{
return $this->db->table('client_rm')
->select('client_rm.client_id, client_rm.level,')
->select('user_profiles.first_name as account_manager')
->join('user_profiles', 'user_profiles.id = client_rm.user_id')
->where('level', 3)
->get()
->getResult();
->select('client_rm.client_id, client_rm.level,')
->select('user_profiles.first_name as account_manager')
->join('user_profiles', 'user_profiles.id = client_rm.user_id')
->where('level', 3)
->get()
->getResult();
}
public function findAccountManagerEmail($client_id)
{
$builder = $this->db->table('client_rm');
$builder->select('user_profiles.email');
$builder->join('user_profiles', 'user_profiles.id = client_rm.user_id');
$builder->where('client_rm.client_id', $client_id);
$builder->where('client_rm.level', 3); // Assuming level 3 is for account managers
$result = $builder->get()->getResultArray();
if (count($result) > 0) {
// Extract just the email values into a simple string array
return array_column($result, 'email');
} else {
return null; // or []
}
}
}

View File

@ -64,33 +64,30 @@ input:checked + .slider:before {
<div class="row">
<div class="col-12">
<div class="card-body">
<div class="form-row">
<div class="form-group">
<label for="">Upload Your Logo</label> <br>
<img
src="<?= isset($client['client_logo']) && !empty($client['client_logo']) ? base_url() . "public/uploads/logo/" . $client['client_logo'] : base_url()."public/assets/images/avatar_2x.png" ?>"
width="75" height="75"
id="uploadPreview"
class="avatar img-circle img-thumbnail"
style="border-radius:25px; border:1px solid #00999E;padding:10px;color:#00999E;"
alt="avatar"/>
<span style="margin-bottom:5px;">
<input type="file" name="client_logo" id="client_logo" accept="image/*" onchange="PreviewImage();"><br>
<i class="text">( Image dimensions 100 x 100 pixels and size of 200KB. )</i>
</span>
<br>
</div>
</div>
<form role="form" class="parsley-examples" method="post" id="general_form" enctype="multipart/form-data">
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>" />
<input type="hidden" name="PrimaryKey" id="general_PrimaryKey" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
<input type="hidden" name="client_id" id="client_id" />
<div class="form-group">
<div class="form-row">
<div class="form-group">
<label for="">Upload Your Logo</label> <br>
<img
src="<?= isset($client['client_logo']) && !empty($client['client_logo']) ? base_url() . "public/uploads/logo/" . $client['client_logo'] : base_url()."public/assets/images/avatar_2x.png" ?>"
width="75" height="75"
id="uploadPreview"
class="avatar img-circle img-thumbnail"
style="border-radius:25px; border:1px solid #00999E;padding:10px;color:#00999E;"
alt="avatar"/>
<span style="margin-bottom:5px;">
<input type="file" name="client_logo" id="client_logo" accept="image/*" onchange="PreviewImage();"><br>
<i class="text">( Image dimensions 100 x 100 pixels and size of 200KB. )</i>
</span>
<br>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
<label for="entity_type_id">Entity Type <span
@ -381,7 +378,7 @@ input:checked + .slider:before {
// Check if the file extension is allowed
if (!allowedExtensions.includes(fileExtension)) {
toastr.warning('Only JPG, JPEG, PNG files are allowed.', 'Invalid file type.');
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
$("#uploadPreview").attr("src", "<?= base_url()?>/public/assets/images/avatar_2x.png");
input.value = "";
}
@ -390,7 +387,7 @@ input:checked + .slider:before {
const fileSize = file.size / 1024; // in KB
if (fileSize > 200) {
toastr.warning('Maximum file size allowed is 200KB.', 'File size exceeds limit.');
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
$("#uploadPreview").attr("src", "<?= base_url()?>/public/assets/images/avatar_2x.png");
input.value = "";
}
@ -399,7 +396,7 @@ input:checked + .slider:before {
img.onload = function() {
if (this.width !== 100 || this.height !== 100) {
toastr.warning('Image dimensions should be 100x100 pixels.', 'Invalid image dimensions.');
$("#uploadPreview").attr("src", "http://ssl.gstatic.com/accounts/ui/avatar_2x.png");
$("#uploadPreview").attr("src", "<?= base_url()?>/public/assets/images/avatar_2x.png");
}
// If both size and dimensions are valid, you can proceed with your logic here
// For example, you can display the image

View File

@ -466,7 +466,12 @@ $("#branch_form").submit(function(event) {
$('.loader-mask').delay(350).fadeOut('slow');
console.log('Something Wrong!', 'warning');
}, 300);
},
complete: function() {
console.log('Ajax request completed');
window.scrollTo({ top: 0, behavior: 'smooth' });
}
});
}
contactCount = 1
@ -511,7 +516,7 @@ $('body').on('click', '.btnBranchEdit', function() {
$('.loader-mask').delay(350).fadeOut('slow');
}, 500);
// console.log('branch contact : ',res.contact)
$('#add_branch').show();
$('#branch_table').hide();

View File

@ -342,7 +342,7 @@
<input type="hidden" class="form-control" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>">
<input type="hidden" class="form-control" value="${item.id}" name="kyc_doc_type_id">
<input type="hidden" name="client_id" value="${client_id}">
<button class="btn btn-sm btn-primary submit" style="position: relative; right: 80px;">Submit</button>
<button class="btn btn-sm btn-primary submit" style="position: relative; right:0px;">Submit</button>
</form>
</td>
<td id="name_${item.id}" style="display:none;"></td>

View File

@ -1,12 +1,76 @@
<style>
<?php foreach ($hr_access_data as $key => $value) {
$key = $key + 1;
?>
#user<?php echo "$key"; ?>-active {
margin: 0;
}
#user<?= $key ?>-active .checkbox-item {
padding-left: 0;
}
#user<?= $key ?>-active label {
font-size: 11px !important;
height: auto !important;
}
#user<?php echo "$key"; ?>-pre {
margin: 0;
}
#user<?= $key ?>-pre .checkbox-item {
padding-left: 0;
}
#user<?= $key ?>-pre label {
font-size: 11px !important;
height: auto !important;
}
#user<?php echo "$key"; ?>-gmc2 {
margin: 0;
}
#user<?= $key ?>-gmc2 .checkbox-item {
padding-left: 0;
}
#user<?= $key ?>-gmc2 label {
font-size: 11px !important;
height: auto !important;
}
#user<?php echo "$key"; ?>-cd {
margin: 0;
}
#user<?= $key ?>-cd .checkbox-item {
padding-left: 0;
}
#user<?= $key ?>-cd label {
font-size: 11px !important;
height: auto !important;
}
<?php } ?>
</style>
<div class="container-fluid">
<div class="row">
<div class="col-12">
<?php if(isset($hr_access_data) && !empty($hr_access_data)) { ?>
<?php if (isset($hr_access_data) && !empty($hr_access_data)) { ?>
<form id="insuranceForm" onsubmit="submitForm(event)">
<?php foreach ($hr_access_data as $key => $value) {
$key = $key + 1 ?>
$key = $key + 1;
?>
<!-- User 1 Card -->
<div class="user-card" data-user-id="<?= 'user' . $key ?>">
@ -18,7 +82,7 @@
<div class="card-header" onclick="toggleAccordion(this)" style="background-color: #F5FFFF;">
<div class="user-info">
<h5 class="mb-0"><?= $value['hr_name'] ?>
<h5 class="mb-0"><?= $value['hr_name'] ?>
<!-- <i class="mdi mdi-information-outline" aria-hidden="true" data-id="<?= (!empty($value['pre_hr_id']) ? $value['pre_hr_id'] : 0) . '-' . (!empty($value['post_hr_id']) ? $value['post_hr_id'] : 0) ?>"></i> -->
</h5>
<p class="user-email"><?= $value['hr_mail'] ?></p>
@ -68,7 +132,9 @@
<div class="checkbox-item">
<input type="checkbox" class="policy-checkbox <?= $statusClass ?>" name="<?= 'user' . $key ?>_pre_policies" data-user="<?= $key ?>" data-group="pre" value="<?= $policies['client_policy_id'] ?>"
<?= in_array($policies['client_policy_id'], $value['allowed_pre_policies']) ? 'checked' : '' ?>>
<label style="<?php if($policies['policy_status'] == 0){echo 'color:#ff5757';} ?>"><?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?></label>
<label style="<?php if ($policies['policy_status'] == 0) {
echo 'color:#ff5757';
} ?>"><?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?></label>
</div>
<?php } ?>
</div>
@ -86,9 +152,13 @@
} ?>>
<i class="mdi mdi-check-circle mr-2"></i>Active policies
</div>
<div class="<?php if (in_array(2, $value['allowed_post_modules'])) {echo 'checkbox-group';} else {echo 'checkbox-group hidden';} ?>" id="<?= 'user' . $key ?>-active">
<div class="<?php if (in_array(2, $value['allowed_post_modules'])) {
echo 'checkbox-group';
} else {
echo 'checkbox-group hidden';
} ?>" id="<?= 'user' . $key ?>-active">
<!-- Select All -->
<div class="checkbox-item">
<input type="checkbox" class="select-all" data-type="all" data-user="<?= $key ?>" data-group="post">
@ -107,14 +177,20 @@
<label>Select all In-Active policies</label>
</div>
<?php foreach ($post_policy_data as $key2 => $policies) {
<?php foreach ($post_policy_data as $key2 => $policies) {
$statusText = $policies['policy_status'] == 1 ? 'Active' : 'In-Active';
$statusClass = $policies['policy_status'] == 1 ? 'active' : 'inactive';
?>
<div class="checkbox-item">
<input type="checkbox" class="policy-checkbox <?= $statusClass ?>" id="<?= 'user' . $key ?>-gmc2" name="<?= 'user' . $key ?>_active_policies" data-user="<?= $key ?>" data-group="post"
value="<?= $policies['client_policy_id'] ?>" <?php if (in_array($policies['client_policy_id'], $value['allowed_active_policies'])) {echo 'checked';} ?>>
<label for="<?= 'user' . $key ?>-gmc2" style="<?php if($policies['policy_status'] == 0){echo 'color:#ff5757';} ?>"><?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?></label>
value="<?= $policies['client_policy_id'] ?>" <?php if (in_array($policies['client_policy_id'], $value['allowed_active_policies'])) {
echo 'checked';
} ?>>
<label for="<?= 'user' . $key ?>-gmc2" style="<?php if ($policies['policy_status'] == 0) {
echo 'color:#ff5757';
} ?>">
<?= $policies['policy_type'] . ' - ' . $policies['policy_no'] ?>
</label>
</div>
<?php } ?>
@ -127,11 +203,17 @@
<div class="section">
<div class="section-title">
<input type="checkbox" class="main-checkbox"
onchange="toggleSection(this, '<?= 'user' . $key ?>-cd')" name="<?= 'user' . $key ?>_modules" value="3" <?php if (in_array(3, $value['allowed_post_modules'])) { echo 'checked';} ?>>
onchange="toggleSection(this, '<?= 'user' . $key ?>-cd')" name="<?= 'user' . $key ?>_modules" value="3" <?php if (in_array(3, $value['allowed_post_modules'])) {
echo 'checked';
} ?>>
<i class="mdi mdi-file mr-2"></i>CD statement
</div>
<div class="<?php if (in_array(3, $value['allowed_post_modules'])) {echo 'checkbox-group';} else {echo 'checkbox-group hidden';} ?>" id="<?= 'user' . $key ?>-cd">
<div class="<?php if (in_array(3, $value['allowed_post_modules'])) {
echo 'checkbox-group';
} else {
echo 'checkbox-group hidden';
} ?>" id="<?= 'user' . $key ?>-cd">
<!-- Select All -->
<div class="checkbox-item">
@ -141,7 +223,9 @@
<?php foreach ($post_cd_data as $key3 => $cd) { ?>
<div class="checkbox-item">
<input type="checkbox" class="policy-checkbox" data-user="<?= $key ?>" data-group="cd" id="<?= 'user' . $key ?>-icici1" name="<?= 'user' . $key ?>_cd" value="<?= $cd['cd_master_pk'] ?>" <?php if (in_array($cd['cd_master_pk'], $value['allowed_cd'])) { echo 'checked';} ?>>
<input type="checkbox" class="policy-checkbox" data-user="<?= $key ?>" data-group="cd" id="<?= 'user' . $key ?>-icici1" name="<?= 'user' . $key ?>_cd" value="<?= $cd['cd_master_pk'] ?>" <?php if (in_array($cd['cd_master_pk'], $value['allowed_cd'])) {
echo 'checked';
} ?>>
<label for="<?= 'user' . $key ?>-icici1"><?= $cd['insurer_short_name'] ?> - <span class="policy-number"><?= $cd['cd_account_no'] ?></span></label>
</div>
<?php } ?>
@ -152,7 +236,9 @@
<div class="col-md-6 col-lg-3">
<div class="section">
<div class="section-title">
<input type="checkbox" class="main-checkbox" name="<?= 'user' . $key ?>_modules" value="4" <?php if (in_array(4, $value['allowed_post_modules'])) {echo 'checked';} ?>>
<input type="checkbox" class="main-checkbox" name="<?= 'user' . $key ?>_modules" value="4" <?php if (in_array(4, $value['allowed_post_modules'])) {
echo 'checked';
} ?>>
<i class="mdi mdi-clipboard-text mr-2"></i>Claims
</div>
</div>
@ -173,7 +259,9 @@
</form>
<?php } else { ?>
<div class="submit-container"> <p align="center"> <b>There is no HR data</b></p> </div>
<div class="submit-container">
<p align="center"> <b>There is no HR data</b></p>
</div>
<?php } ?>
</div>
</div>

View File

@ -23,7 +23,30 @@ table.dataTable tbody td {
} */
</style>
<div class="row" style="position: relative;left: 250px;top: 55px;">
<style>
/* Put this in your CSS */
#scroll-horizontal-datatable_wrapper .btn-secondary {
cursor: pointer;
width: auto;
display: inline-flex;
align-items: center;
border: 1px solid #F5FFFF;
background-color: #F5FFFF !important;
}
#scroll-horizontal-datatable_wrapper #submitBtn{
background-color: #E26728 !important;
color: white !important;
border: 1px solid #E26728;
padding: 5px 10px !important;
border-radius: 10px !important;
cursor: pointer !important;
box-shadow: 0px 2px 4px 0px #00000024 !important;
}
</style>
<!-- <div class="row" style="position: relative;left: 250px;top: 55px;">
<div class="form-group col-md-3" id="date_div">
<div id="reportrange" class="form-control" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
<i class="mdi mdi-calendar-blank"></i>&nbsp;
@ -35,9 +58,9 @@ table.dataTable tbody td {
<div class="form-group col-md-3">
<button type="button" class="btn btn-primary" onclick="appendHrActivityHistoryHtml(this, true)"> submit </button>
</div>
</div>
</div> -->
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap">
<table data-custom-table-css="table" id="scroll-horizontal-datatable" class="table w-100 nowrap flex-grow">
<thead class="bg-light">
<tr>
<th>S. No</th>
@ -68,9 +91,9 @@ $(document).ready(function () {
var ticketsTable = $('#scroll-horizontal-datatable');
if (ticketsTable.length) {
ticketsTable.DataTable({
var table = ticketsTable.DataTable({
scrollX: true,
dom: "<'row'<'col-sm-2'f><'col-sm-2'>>" + // Filter left, buttons right
dom: "<'row'<'col-sm-6'f><'col-sm-6 text-right'B>>" + // search left, buttons right
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-3'i><'col-sm-2'l><'col-sm-7'p>>",
language: {
@ -79,40 +102,62 @@ $(document).ready(function () {
},
paging: true,
pageLength: 25,
ordering: false
ordering: false,
buttons: [
{
text: '<div id="reportrange" class="form-control d-inline-block mr-2 custom-daterange" style="background:white; cursor: pointer; width: auto; display:inline-flex; align-items:center;">' +
'<i class="mdi mdi-calendar-blank"></i>&nbsp;<span></span> <i class="mdi mdi-menu-down"></i>' +
'</div>' +
'<input type="hidden" id="startDate">' +
'<input type="hidden" id="endDate">' +
'<button type="button" id="submitBtn" class="btn btn-primary ml-2">Submit</button>',
className: 'btn-group d-inline-block btn-secondary',
style : 'background: white; border: 1px solid #ced4da; padding: 5px 10px; border-radius: 5px;',
action: function () {
appendHrActivityHistoryHtml(this, true);
}
}
]
});
// Attach submit handler separately so it works
$(document).on("click", "#submitBtn", function () {
appendHrActivityHistoryHtml(this, true);
});
// Daterangepicker setup
const params = new URLSearchParams(window.location.search);
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
const start = moment(startDateParam, 'DD-MM-YYYY');
const end = moment(endDateParam, 'DD-MM-YYYY');
function cb(start, end) {
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
$('#startDate').val(start.format('DD-MM-YYYY'));
$('#endDate').val(end.format('DD-MM-YYYY'));
}
$(document).ready(function () {
$('#reportrange').daterangepicker({
startDate: start,
endDate: end,
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
}
}, cb);
cb(start, end);
});
} else {
console.error("Table not found.");
}
// Daterangepicker setup
const params = new URLSearchParams(window.location.search);
const startDateParam = params.get('start_date') || moment().subtract(29, 'days').format('DD-MM-YYYY');
const endDateParam = params.get('end_date') || moment().format('DD-MM-YYYY');
const start = moment(startDateParam, 'DD-MM-YYYY');
const end = moment(endDateParam, 'DD-MM-YYYY');
function cb(start, end) {
$('#reportrange span').html(start.format('D-MM-YYYY') + ' - ' + end.format('D-MM-YYYY'));
$('#startDate').val(start.format('DD-MM-YYYY'));
$('#endDate').val(end.format('DD-MM-YYYY'));
}
$('#reportrange').daterangepicker({
startDate: start,
endDate: end,
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
}
}, cb);
cb(start, end);
});

View File

@ -1004,6 +1004,22 @@ $(document).ready(function(){
});
});
function openModal(modalId) {
var modalEl = document.getElementById(modalId);
if (typeof bootstrap !== "undefined" && bootstrap.Modal) {
// Bootstrap 5
var modal = bootstrap.Modal.getOrCreateInstance(modalEl);
modal.show();
} else if (typeof $ !== "undefined" && typeof $.fn.modal === "function") {
// Bootstrap 4
$('#' + modalId).modal('show');
} else {
console.error("No compatible Bootstrap modal found.");
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +1,115 @@
<style>
#notification_table{
overflow-x : unset;
#notification_table {
overflow-x: unset;
}
.preview_button{
display:none;
.preview_button {
display: none;
}
.scrollb {
overflow-y: auto !important;
}
#editor-container {
width: 100%;
min-height: 600px;
}
.modal-dialog {
max-width: 90% !important;
width: 90% !important;
}
.modal-dialog {
max-width: 90% !important;
width: 90% !important;
}
/* Also ensure the modal body has proper height */
/* Also ensure the modal body has proper height */
.modal-body {
min-height: 600px;
padding: 20px;
}
.modal-body {
min-height: 600px;
padding: 20px;
}
/* If you're using Bootstrap's modal, you might also want to ensure proper positioning */
.modal-dialog {
margin: 1.75rem auto;
}
/* If you're using Bootstrap's modal, you might also want to ensure proper positioning */
.modal-dialog {
margin: 1.75rem auto;
}
.mail-section{
border: 1px solid #00999E;
border-radius:10px;
padding:5px !important;
}
.mail-section {
border: 1px solid #00999E;
border-radius: 10px;
padding: 5px !important;
}
</style>
<style>
/* Custom switch (responsive, no inline styles) */
#notification-tab .switch {
position: relative;
display: inline-block;
width: 2.5rem;
height: 1.2rem;
}
#notification-tab .switch input {
opacity: 0;
width: 0;
height: 0;
}
#notification-tab .slider {
position: absolute;
cursor: pointer;
inset: 0;
background-color: #ccc;
transition: 0.3s;
border-radius: 34px;
}
#notification-tab .slider:before {
position: absolute;
content: "";
height: 1rem;
width: 1rem;
left: 0.2rem;
bottom: 0.1rem;
background-color: #fff;
transition: 0.3s;
border-radius: 50%;
}
#notification-tab input:checked+.slider {
background-color: #2196F3;
}
#notification-tab input:checked+.slider:before {
transform: translateX(1.2rem);
}
/* Reusable row styling */
#notification-tab .mail-row {
display: flex;
justify-content: space-between;
align-items: center;
padding-left: .5rem;
padding-right: .5rem;
}
#notification-tab .mail-row .mail-section {
display: flex;
width: 100%;
align-items: center;
}
#notification-tab .mail-row .mail-section .left {
display: flex;
align-items: center;
margin-top: .3rem;
flex: 0 0 70%;
}
#notification-tab .mail-row .mail-section .right {
flex: 0 0 30%;
text-align: right;
}
</style>
<div class="tab-pane fade" id="notification-tab">
<input type="hidden" id="client_id_for_client_branch" value="<?= isset($notification['id']) ? $notification['id'] : '' ?>" />
@ -114,66 +186,119 @@
<!-- mail section -->
<!-- Member welcome mail row-->
<div class="form-row">
<div class="form-group col-md-6 mail-section">
<label for="branch_name">Member welcome mail</label>
<label class="switch">
<input id="member_welcome_mail_btn" type="checkbox" name="member_welcome_mail_btn" <?= ($member_welcome_mail == 1) ? 'checked' : '' ?>>
<span class="slider round" style="height: 27px;"></span>
</label>
&nbsp; &nbsp;
<a href="" data-toggle="modal" id="member_welcome_mail" onclick="getMailTemplateData(this)" data-target="#member_welcome_mail_modal">Edit</a>
<!-- Example: Member welcome mail -->
<div class="form-group col-md-6 mail-row">
<div class="mail-section">
<div class="left">
<label class="switch">
<input id="member_welcome_mail_btn" type="checkbox" name="member_welcome_mail_btn" <?= ($member_welcome_mail == 1) ? 'checked' : '' ?>>
<span class="slider"></span>
</label>
<span class="ml-2">Member welcome mail</span>
</div>
<div class="right">
<a href="#" id="member_welcome_mail" onclick="getMailTemplateData(this)" data-toggle="modal" data-target="#member_welcome_mail_modal">
<i class="mdi mdi-pencil"></i>
</a>
</div>
</div>
</div>
<div class="form-group col-md-6 mail-section">
<label for="branch_name">Member reminder mail</label>
<label class="switch">
<input id="member_reminder_mail_btn" type="checkbox" name="member_reminder_mail_btn" <?= $member_reminder_mail == 1 ? 'checked' : '' ?>>
<span class="slider round" style="height: 27px;"></span>
</label>
&nbsp; &nbsp;
<a href="" data-toggle="modal" id="member_reminder_mail" onclick="getMailTemplateData(this)" data-target="#member_reminder_mail_modal">Edit</a>
<!-- Example: Member reminder mail -->
<div class="form-group col-md-6 mail-row">
<div class="mail-section">
<div class="left">
<label class="switch">
<input id="member_reminder_mail_btn" type="checkbox" name="member_reminder_mail_btn" <?= ($member_reminder_mail == 1) ? 'checked' : '' ?>>
<span class="slider"></span>
</label>
<span class="ml-2">Member reminder mail</span>
</div>
<div class="right">
<a href="#" id="member_reminder_mail" onclick="getMailTemplateData(this)" data-toggle="modal" data-target="#member_reminder_mail_modal">
<i class="mdi mdi-pencil"></i>
</a>
</div>
</div>
</div>
</div>
<!-- Member Ecard mail row-->
<div class="form-row">
<div class="form-group col-md-6 mail-row">
<div class="mail-section">
<div class="left">
<label class="switch">
<input id="member_ecard_mail_btn" type="checkbox" name="member_ecard_mail_btn" <?= $member_ecard_mail == 1 ? 'checked' : '' ?>>
<span class="slider round"></span>
</label>
<span class="ml-2"> Member ECard mail</span>
</div>
<div class="right">
<a href="" data-toggle="modal" id="member_ecard_mail" onclick="getMailTemplateData(this)" data-target="#member_ecard_mail_modal">
<i class="mdi mdi-pencil"></i>
</a>
</div>
</div>
</div>
<div class="form-group col-md-6 mail-row">
<div class="mail-section">
<div class="left">
<label class="switch">
<input id="member_review_and_summary_mail_btn" type="checkbox" name="member_review_and_summary_mail_btn" <?= $member_review_and_summary_mail == 1 ? 'checked' : '' ?>>
<span class="slider round"></span>
</label>
<span class="ml-2"> Member Review And Summary Mail</span>
</div>
<div class="right">
<a href="" data-toggle="modal" id="member_review_and_summary_mail" onclick="getMailTemplateData(this)" data-target="#member_review_and_summary_mail_modal">
<i class="mdi mdi-pencil"></i>
</a>
</div>
</div>
</div>
</div>
<!-- Account Manager Summary Mail row-->
<div class="form-row">
<div class="form-group col-md-6 mail-section">
<label for="branch_name">Member ECard mail</label>
<label class="switch">
<input id="member_ecard_mail_btn" type="checkbox" name="member_ecard_mail_btn" <?= $member_ecard_mail == 1 ? 'checked' : '' ?>>
<span class="slider round" style="height: 27px;"></span>
</label>
&nbsp; &nbsp;
<a href="" data-toggle="modal" id="member_ecard_mail" onclick="getMailTemplateData(this)" data-target="#member_ecard_mail_modal">Edit</a>
<div class="form-group col-md-6 mail-row">
<div class="mail-section">
<div class="left">
<label class="switch">
<input id="account_maneger_summary_mail_btn" type="checkbox" name="account_maneger_summary_mail_btn" <?= $account_maneger_summary_mail ? 'checked' : '' ?>>
<span class="slider round"></span>
</label>
<span class="ml-2"> Account Manager summary mail</span>
</div>
<div class="right">
<a href="" data-toggle="modal" id="account_maneger_summary_mail" onclick="getMailTemplateData(this)" data-target="#account_maneger_summary_mail_modal">
<i class="mdi mdi-pencil"></i>
</a>
</div>
</div>
</div>
<div class="form-group col-md-6 mail-section">
<label for="branch_name">Member Review and summary mail</label>
<label class="switch">
<input id="member_review_and_summary_mail_btn" type="checkbox" name="member_review_and_summary_mail_btn" <?= $member_review_and_summary_mail == 1 ? 'checked' : '' ?>>
<span class="slider round" style="height: 27px;"></span>
</label>
&nbsp; &nbsp;
<a href="" data-toggle="modal" id="member_review_and_summary_mail" onclick="getMailTemplateData(this)" data-target="#member_review_and_summary_mail_modal">Edit</a>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 mail-section">
<label for="branch_name">Account Manager summary mail</label>
<label class="switch">
<input id="account_maneger_summary_mail_btn" type="checkbox" name="account_maneger_summary_mail_btn" <?= $account_maneger_summary_mail ? 'checked' : '' ?>>
<span class="slider round" style="height: 27px;"></span>
</label>
&nbsp; &nbsp;
<a href="" data-toggle="modal" id="account_maneger_summary_mail" onclick="getMailTemplateData(this)" data-target="#account_maneger_summary_mail_modal">Edit</a>
</div>
<div class="form-group col-md-6 mail-section">
<label for="branch_name">Client HR summary mail</label>
<label class="switch">
<input id="client_hr_summary_mail_btn" type="checkbox" name="client_hr_summary_mail_btn" <?= $client_hr_summary_mail == 1 ? 'checked' : '' ?>>
<span class="slider round" style="height: 27px;"></span>
</label>
&nbsp; &nbsp;
<a href="" data-toggle="modal" id="client_hr_summary_mail" onclick="getMailTemplateData(this)" data-target="#client_hr_summary_mail_modal">Edit</a>
<div class="form-group col-md-6 mail-row">
<div class="mail-section">
<div class="left">
<label class="switch">
<input id="client_hr_summary_mail_btn" type="checkbox" name="client_hr_summary_mail_btn" <?= $client_hr_summary_mail == 1 ? 'checked' : '' ?>>
<span class="slider round"></span>
</label>
<span class="ml-2">Client HR summary mail</span>
</div>
<div class="right">
<a href="" data-toggle="modal" id="client_hr_summary_mail" onclick="getMailTemplateData(this)" data-target="#client_hr_summary_mail_modal">
<i class="mdi mdi-pencil"></i>
</a>
</div>
</div>
</div>
</div>
@ -184,6 +309,8 @@
<a style="float:right;" id="notification_enable_form_submit" class="btn btn-primary waves-effect waves-light mr-1">Submit</a>
</div>
</div>
</div>
<!-- </form> -->
@ -595,9 +722,9 @@
<hr>
<!-- Unlayer editor -->
<!-- <div class="form-row" id="rac_rate_dropdown"> -->
<div class="form-group col-md-12">
<div id="account_maneger_summary_mail_editor_container" style="height: 600px"></div>
</div>
<div class="form-group col-md-12">
<div id="account_maneger_summary_mail_editor_container" style="height: 600px"></div>
</div>
<!-- </div> -->
<div class="form-group text-right m-b-0">
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
@ -663,48 +790,48 @@
</select>
</div>
</div> -->
</div> -->
<div class="form-row" id="rac_rate_dropdown">
<div class="form-group col-md-12">
<select id="client_hr_summary_mail_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;" onchange="copyToClipboard(this)">
<option value="">PlaceHolders</option>
<?php foreach ($placeHolders as $value): ?>
<?php if ($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name' || $value == 'member_summary') { ?>
<?php $valueChange = str_replace('_', ' ', $value);
$valueChange = ucwords($valueChange); ?>
<option value="{{<?php echo $value; ?>}}"><?php echo $valueChange; ?></option>
<?php } ?>
<?php endforeach; ?>
</select>
<span id="copy-feedback" style="display: none; position: absolute; top: 50px; right: 10px; color: green; font-size: 12px;">Copied to clipboard!</span>
</div>
</div> -->
<div class="form-row" id="rac_rate_dropdown">
<div class="form-group col-md-12">
<select id="client_hr_summary_mail_customButton" class="form-control" style="border:none;right: 6px;width: auto;position: absolute;z-index: 1;top: 17px;height: 32px;float: right;" onchange="copyToClipboard(this)">
<option value="">PlaceHolders</option>
<?php foreach ($placeHolders as $value): ?>
<?php if ($value == 'member_name' || $value == 'nhance_logo' || $value == 'client_logo' || $value == 'app_link' || $value == 'client_name' || $value == 'member_summary') { ?>
<?php $valueChange = str_replace('_', ' ', $value);
$valueChange = ucwords($valueChange); ?>
<option value="{{<?php echo $value; ?>}}"><?php echo $valueChange; ?></option>
<?php } ?>
<?php endforeach; ?>
</select>
<span id="copy-feedback" style="display: none; position: absolute; top: 50px; right: 10px; color: green; font-size: 12px;">Copied to clipboard!</span>
</div>
<hr>
<!-- Unlayer editor -->
<div class="form-row" id="rac_rate_dropdown">
<div class="form-group col-md-12">
<div id="client_hr_summary_mail_editor_container" style="height: 600px"></div>
</div>
</div>
<hr>
<!-- Unlayer editor -->
<div class="form-row" id="rac_rate_dropdown">
<div class="form-group col-md-12">
<div id="client_hr_summary_mail_editor_container" style="height: 600px"></div>
</div>
<div id="editor"></div>
<input type="file" id="Question_title_fileInput" style="display: none;">
</div>
<div class="form-group text-right m-b-0">
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
id="">Preview</button>
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnGridSubmit_2">Submit</button>
</div>
</form>
<div id="editor"></div>
<input type="file" id="Question_title_fileInput" style="display: none;">
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
<div class="form-group text-right m-b-0">
<button class="btn btn-primary waves-effect waves-light mr-1 preview_button"
id="">Preview</button>
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1"
id="btnGridSubmit_2">Submit</button>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
<!-- /.modal -->
@ -1376,7 +1503,7 @@
console.log("Creating new editor instance...");
editor = unlayer.createEditor({
id: `${template_name}_editor_container`,
projectId: <?=getenv('unlayer.projectID') ?>,
projectId: <?= getenv('unlayer.projectID') ?>,
displayMode: "email",
features: {
textEditor: {
@ -1386,7 +1513,9 @@
enabled: true,
deviceOptions: ['desktop', 'mobile']
},
preview: { enabled: true },
preview: {
enabled: true
},
imageEditor: {
enabled: true
},
@ -1434,7 +1563,7 @@
function getMailTemplateData(element) {
template_name = element.id;
const validTemplates = [
"account_maneger_summary_mail", "member_reminder_mail", "member_ecard_mail", "member_welcome_mail","member_review_and_summary_mail","client_hr_summary_mail"
"account_maneger_summary_mail", "member_reminder_mail", "member_ecard_mail", "member_welcome_mail", "member_review_and_summary_mail", "client_hr_summary_mail"
];
if (!validTemplates.includes(template_name)) {
@ -1953,52 +2082,85 @@
});
}
}
$(document).on('click', '#notification_enable_form_submit', function() {
var formData = [];
console.log($('#hr_mail_id').val());
$(document).on('click', '#notification_enable_form_submit', function() {
var formData = [];
console.log($('#hr_mail_id').val());
formData.push({name:'client_id', value: $('#general_PrimaryKey').val()})
formData.push({ name: 'nhance_team_mail_ids', value: $('#nhance_team_mail_ids').val() });
formData.push({ name: 'hr_mail_id', value: $('#hr_mail_id').val() });
formData.push({ name: 'mail_domain', value: $('#mail_domain').val() });
formData.push({ name: 'reply_to', value: $('#reply_to').val() });
formData.push({ name: 'member_welcome_mail_btn', value: $('#member_welcome_mail_btn').prop('checked') });
formData.push({ name: 'member_reminder_mail_btn', value: $('#member_reminder_mail_btn').prop('checked') });
formData.push({ name: 'member_ecard_mail_btn', value: $('#member_ecard_mail_btn').prop('checked') });
formData.push({ name: 'member_review_and_summary_mail_btn', value: $('#member_review_and_summary_mail_btn').prop('checked') });
formData.push({ name: 'account_maneger_summary_mail_btn', value: $('#account_maneger_summary_mail_btn').prop('checked') });
formData.push({ name: 'client_hr_summary_mail_btn', value: $('#client_hr_summary_mail_btn').prop('checked') });
formData.push({
name: 'client_id',
value: $('#general_PrimaryKey').val()
})
formData.push({
name: 'nhance_team_mail_ids',
value: $('#nhance_team_mail_ids').val()
});
formData.push({
name: 'hr_mail_id',
value: $('#hr_mail_id').val()
});
formData.push({
name: 'mail_domain',
value: $('#mail_domain').val()
});
formData.push({
name: 'reply_to',
value: $('#reply_to').val()
});
formData.push({
name: 'member_welcome_mail_btn',
value: $('#member_welcome_mail_btn').prop('checked')
});
formData.push({
name: 'member_reminder_mail_btn',
value: $('#member_reminder_mail_btn').prop('checked')
});
formData.push({
name: 'member_ecard_mail_btn',
value: $('#member_ecard_mail_btn').prop('checked')
});
formData.push({
name: 'member_review_and_summary_mail_btn',
value: $('#member_review_and_summary_mail_btn').prop('checked')
});
formData.push({
name: 'account_maneger_summary_mail_btn',
value: $('#account_maneger_summary_mail_btn').prop('checked')
});
formData.push({
name: 'client_hr_summary_mail_btn',
value: $('#client_hr_summary_mail_btn').prop('checked')
});
var form_action = '<?= base_url("client/notification/update_enable") ?>';
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
$.ajax({
url: form_action,
type: "POST",
data: formData,
dataType: 'json',
success: function(res)
{
console.log(res);
if (res)
{
toastr.success('Update Successfully');
}
var form_action = '<?= base_url("client/notification/update_enable") ?>';
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
$.ajax({
url: form_action,
type: "POST",
data: formData,
dataType: 'json',
success: function(res) {
if (res.status == true) {
toastr.success('Update Successfully');
}
if (res.status == false) {
let empty_templates = res.empty_templates.join(", ");
toastr.warning(`Updation Failed. The following templates were empty: ${empty_templates}`);
}
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
},
error: function (xhr, status, error)
{
console.error(xhr.responseText);
console.error(status, error);
setTimeout(function()
{
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
toastr.warning('Something Wrong!', 'warning');
}, 1000);
}
});
})
toastr.warning('Something Wrong!', 'warning');
}, 1000);
}
});
})
</script>

View File

@ -95,6 +95,21 @@
/* margin-left: 141px; */
width: 576px;
}
#policyGMCTerms input ,
#policyGMCTerms select,
#policyGMCTerms .select2-container .select2-selection--single ,
#policyGMCTerms .select2-container .select2-selection--multiple {
background-color: #ECECEC !important;
border:1px solid #ECECEC !important;
box-shadow: none !important;
}
.policy-base-info{
margin-top:10px;
}
</style>
<div id="policyGMCTerms" style="display:none">
@ -112,196 +127,173 @@
<div class="form-group">
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-4">
<label for="sumInsured">Sum Insured</label>
</div>
<div class="col-md-4">
<input style="width: 128%;" type="text" name="sum_insured" id="sum_insured" class="form-control"
onkeypress="return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word(this)">
</div>
<div class="col-md-2" style="position: relative;left: 88px;">
<button type="button" class="btn btn-primary si-add-more" onclick="appendGMCSIAddMore()">+</button>
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
<div id='numberToWordGMC' class="text-danger-2"></div>
<div class="col">
<div class="d-flex align-items-center gap-2">
<label for="sumInsured" class="form-label" >Sum Insured</label>
<input class="form-control mr-2" type="text" name="sum_insured" id="sum_insured" style="max-width:200px;"
onkeypress="return onlyNumbers(event)" onkeyup=" formatNumber(this); si_keup_num_to_word(this)">
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGMCSIAddMore()"
style="background-color: #e26728; border:1px solid #e26728;"
>
<i class="mdi mdi-plus"></i>
</button>
<div id='numberToWordGMC' class="text-danger-2 mr-2"></div>
</div>
</div>
</div>
<div id="gmc_si_add_more"></div>
<div class="row" style="margin-bottom:10px;">
<div class="col">
<label for="totalSumInsured" class="form-label me-3">Family Floater</label>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="familyFloaterYes" name="family_floater" value="1">
<label class="form-check-label" for="familyFloaterYes">Yes</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="familyFloaterNo" name="family_floater" value="0">
<label class="form-check-label" for="familyFloaterNo">No</label>
</div>
</div>
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col"
style="background-color: #F5FFFF;border-radius:10px;box-shadow: 0px 2px 2px 0px #00000040;
padding:20px;">
<div class="col-md-4">
<label for="totalSumInsured">Family Floater</label>
</div>
<div class="d-flex align-items-center policy-base-info">
<input type="checkbox" style="margin-right: 10px;color:black;"
name="family_floaters[]" value="self" id="self" checked>
<div class="col-md-6">
&nbsp;&nbsp; <input type="radio" id="familyFloaterYes" name="family_floater" class="family_floater" value="1">
<label for="familyFloaterYes">Yes</label>
<span style="margin-right:150px;color:black;">Self:</span>
<br>
<input type="radio" id="familyFloaterNo" name="family_floater" class="family_floater" value="0" style="margin-left:10px">
<label for="familyFloaterNo">No</label>
</div>
<div class="col-md-4">
</div>
<div class="col-md-8" style="margin-bottom:10px">
<table data-custom-table-css="table">
<tbody>
<tr>
<td style="width: 11%;"><span style="margin-right:20px;color:black;">Self:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;color:black;"
name="family_floaters[]" value="self" id="self" checked> </td>
<td style="width: 28%;">
<div class="self-age"><span style="margin-right:20px;color:black;;">Min Age:</span><input
<div class="self-age">
<span style="margin-right:10px;color:black;;">Min Age:</span>
<input
class="underline-input min_age"
value="<?php echo (isset($self_min_age) && $self_min_age > 0) ? $self_min_age : '18'; ?>"
style="width: 35%;;" type="number" name="self_min_age" id="self_min_age"
onchange="lowerIsEighteen(this)">
</div>
</td>
<td style="width: 28%;">
<div class="self-age"><span style="margin-right:20px;color:black;">Max Age:</span><input
<div class="self-age">
<span style="margin-right:10px;color:black;">Max Age:</span>
<input
class="underline-input max_age"
value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>"
style="width: 35%;;" type="number" name="self_max_age" id="self_max_age"
onchange="lowerIsEighteen(this)"></div>
</td>
<!-- <td style="width: 11%;"><span class="self-age"
style="margin-right:20px;color:black;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="self-age" type="checkbox"
style="margin-right: 70px;" name="is_payable_employee_for_self"
id="is_payable_employee_for_self"> </td> -->
</tr>
<tr>
<td style="width: 11%;"><span style="margin-right:20px;color:black;">Spouse:</span></td>
<td style="width: 11%;"><input type="checkbox" style="margin-right: 70px;"
name="family_floaters[]" value="spouse" id="spouse"></td>
<td style="width: 28%;">
<div class="spouse-age"><span style="margin-right:20px;color:black;">Min Age:</span><input
onchange="lowerIsEighteen(this)">
</div>
</div>
<div class="d-flex align-items-center policy-base-info">
<input type="checkbox" style="margin-right:10px;"
name="family_floaters[]" value="spouse" id="spouse">
<span style="margin-right:125px;color:black;">
Spouse:</span>
<div class="spouse-age"><span style="margin-right:10px;color:black;">Min Age:</span>
<input
class="underline-input min_age"
value="<?php echo isset($spouse_min_age) ? $spouse_min_age : '18'; ?>"
style="width: 35%;;" type="number" name="spouse_min_age" id="spouse_min_age"
onchange="lowerIsEighteen(this)"></div>
</td>
<td style="width: 28%;">
<div class="spouse-age"><span style="margin-right:20px;color:black;">Max Age:</span><input
onchange="lowerIsEighteen(this)">
</div>
<div class="spouse-age"><span style="margin-right:10px;color:black;">Max Age:</span>
<input
class="underline-input max_age"
value="<?php echo isset($spouse_max_age) ? $spouse_max_age : '60'; ?>"
style="width: 35%;;" type="number" name="spouse_max_age" id="spouse_max_age"
onchange="lowerIsEighteen(this)"></div>
</td>
<!-- <td style="width: 11%;"><span class="spouse-age"
style="margin-right:20px;color:black;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="spouse-age" type="checkbox"
style="margin-right: 70px;" name="is_payable_employee_for_spouse"
id="is_payable_employee_for_spouse"> </td> -->
</tr>
<tr>
<td style="width: 11%;"><span for="children" style="color:black;">Children:</span></td>
<td style="width: 11%;"><select name="family_floaters[]" id="children">
onchange="lowerIsEighteen(this)">
</div>
</div>
<div class="d-flex align-items-center policy-base-info">
<span for="children" style="color:black;" class="mr-2">Children:</span>
<select name="family_floaters[]" id="children" style="margin-right:60px;" class="px-1" >
<option value="0">None</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</td>
<td style="width: 28%;">
<div class="child-age"><span style="margin-right:20px;color:black;">Min Age:</span><input
<div class="child-age"><span style="margin-right:10px;color:black;">Min Age:</span>
<input
class="underline-input min_age"
value="<?php echo isset($child_min_age) ? $child_min_age : '0'; ?>"
style="width: 35%;;" type="number" name="child_min_age" id="child_min_age"
oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div>
</td>
<td style="width: 28%;">
<div class="child-age"><span style="margin-right:20px;color:black;">Max Age:</span><input
<div class="child-age"><span style="margin-right:10px;color:black;">Max Age:</span>
<input
class="underline-input max_age"
value="<?php echo isset($child_max_age) ? $child_max_age : '25'; ?>"
style="width: 35%;;" type="number" name="child_max_age" id="child_max_age"
oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)"></div>
</td>
<!-- <td style="width: 11%;"><span class="child-age"
style="margin-right:20px;color:black;font-size: 12px;">Is Payable by employee:</span></td>
<td style="width: 11%;"><input class="child-age" type="checkbox"
style="margin-right: 70px;" name="is_payable_employee_for_child"
id="is_payable_employee_for_child"> </td> -->
</tr>
oninput="this.value = this.value.replace(/\D/g, '').substring(0, 2)">
</div>
</div>
</tbody>
</table>
<div class="d-flex align-items-center policy-base-info flex-nowrap">
<div style="margin-top:10px"></div>
<div style="margin-top:10px"></div>
<!-- Select Other Members -->
<div class="d-flex align-items-center">
<span class="me-2 fw-bold text-dark mr-3">
<b>Select Other Members:</b>
</span>
<select name="family_floaters[]" id="family_floaters" class="form-select mr-3 px-1">
<option value="0">None</option>
<option value="1P">Only one parent (Either Father / Mother)</option>
<option value="2P">Only two parents (Father+Mother)</option>
<option value="1PIL">Only one parent in law (Either MIL / FIL)</option>
<option value="2PIL">Only two parents in law (FIL + MIL)</option>
<option value="2EPORPIL">Parents or PIL (Any two of Father, Mother, MIL, FIL)</option>
<option value="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option>
<option value="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
</select>
</div>
<div style="margin-top:10px">
<span for="family_floaters" style="color:black;"><b>Select Other Members:</b></span>
<select name="family_floaters[]" id="family_floaters" style="margin-left: 10px;">
<option value="0">None</option>
<option value="1P">Only one parent (Either Father / Mother)</option>
<option value="2P">Only two parents (Father+Mother)</option>
<option value="1PIL">Only one parent in law (Either MIL / FIL)</option>
<option value="2PIL">Only two parents in law (FIL + MIL)</option>
<option value="2EPORPIL">Parents or PIL (Any two of Father, Mother, MIl, FIL)</option>
<option value="EPORPIL">Either Parents or PIL (Parents or Parents In Law)</option>
<option value="4EPORPIL">Parents + PIL (Father + Mother + MIL + FIL)</option>
</select>
</div>
<!-- Elders Count -->
<div class="d-flex align-items-center">
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Elders Count:</span>
<input class="underline-input" type="number" style="width: 35%;"
name="elder_member_count" id="member_count" readonly>
</div>
<div style="margin-top:10px">
<table data-custom-table-css="table">
<tbody>
<tr>
<td style="width: 22%;">
<div class="other-member-age"><span style="margin-right:20px;color:black;">Elders
Count:</span><input class="underline-input" id="member_count"
style="width: 30%; width: 30%;" type="number"
name="elder_member_count" id="member_count" readonly></div>
</td>
<td style="width: 28%;">
<div class="other-member-age" style="margin-left: 32px;"><span
style="margin-right:20px;color:black;">Min Age:</span><input
class="underline-input min_age"
value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>"
style="width: 35%;;" type="number" class="underline-input min_age"
name="other_member_min_age" id="other_member_min_age"
onchange="lowerIsEighteen(this)"></div>
</td>
<td style="width: 28%;">
<div class="other-member-age" style="margin-left: 17px;"><span
style="margin-right:20px;color:black;">Max Age:</span><input
class="underline-input max_age"
value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>"
style="width: 35%;;" type="number" class="underline-input max_age"
name="other_member_max_age" id="other_member_max_age"
onchange="lowerIsEighteen(this)"></div>
</td>
<!-- <td style="width: 11%;"><span class="other-member-age"
style="margin-right:20px;color:black;font-size: 12px;">Is Payable by employee:</span>
</td>
<td style="width: 11%;"><input class="other-member-age" type="checkbox"
style="margin-right: 70px;" name="is_payable_employee_for_elders"
id="is_payable_employee_for_elders"> </td> -->
</tr>
</tbody>
</table>
</div>
<!-- Min Age -->
<div class="d-flex align-items-center">
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Min Age:</span>
<input class="underline-input" type="number"
name="other_member_min_age" id="other_member_min_age" style="width: 35%;"
value="<?php echo isset($other_member_min_age) ? $other_member_min_age : '18'; ?>"
onchange="lowerIsEighteen(this)">
</div>
<!-- Max Age -->
<div class="d-flex align-items-center">
<span class="me-2 text-dark" style="margin-right:10px;color:black;">Max Age:</span>
<input class="underline-input" type="number"
name="other_member_max_age" id="other_member_max_age" style="width: 35%;"
value="<?php echo isset($other_member_max_age) ? $other_member_max_age : '60'; ?>"
onchange="lowerIsEighteen(this)">
</div>
</div>
</div>
</div>
<hr>
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-1">
<input type="checkbox" style="margin-top: 12px" name="waiverofpreexistingdiseases_display" id="waiverofpreexistingdiseases_display" class="unchecked" checked>
@ -1762,22 +1754,28 @@
var html = `
<div class="row" style="margin-bottom: 10px;">
<div class="col-md-4">
<label for="sumInsured">Additional Sum Insured</label>
</div>
<div class="col-md-4">
<input style="width: 128%;" value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]" class="form-control multiple_sum_insured" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this); numtowordinkeyup(this)">
</div>
<div class="col-md-2" style="position: relative;left: 88px;">
<button type="button" class="btn btn-danger si-remove-multi" onclick="removeGMCAdditionalSI(this)">x</button>
<button type="button" class="btn btn-primary si-add-more" onclick="appendGMCSIAddMore()">+</button>
</div>
<div class="col-md-4">
</div>
<div class="col-md-4">
<div class="text-danger-2 numberToWordSumInsured"></div>
</div>
</div>`;
<div class="col">
<div class="d-flex align-items-center gap-2">
<label for="sumInsured" class="form-label" >Additional Sum Insured</label>
<input class="form-control mr-2" style="max-width:200px;"
value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]"
class="form-control multiple_sum_insured mr-2" onkeypress="return onlyNumbers(event)"
onkeyup="formatNumber(this); numtowordinkeyup(this)">
<button type="button" class="btn btn-danger si-remove-multi mr-2" onclick="removeGMCAdditionalSI(this)"
style="background-color: #BD0707;border:1px solid #BD0707">
<i class="mdi mdi-delete"></i>
</button>
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGMCSIAddMore()"
style="background-color: #e26728; border:1px solid #e26728;"
>
<i class="mdi mdi-plus"></i>
</button>
<div id='numberToWordSumInsured' class="text-danger-2 mr-2"></div>
</div>
</div>
</div>
`;
$('#gmc_si_add_more').append(html);
}

View File

@ -74,6 +74,16 @@
width: 689px;
}
#policyGPATermsForm input ,
#policyGPATermsForm select,
#policyGPATermsForm .select2-container .select2-selection--single ,
#policyGPATermsForm .select2-container .select2-selection--multiple {
background-color: #ECECEC !important;
border:1px solid #ECECEC !important;
box-shadow: none !important;
}
</style>
<div id="policyGPATermsForm" style="display:none">
@ -101,7 +111,11 @@
<label for="sumInsured" class="form-label" >Sum Insured</label>
<input class="form-control mr-2" type="text" name="sumInsured2" id="sumInsured2" style="max-width:200px;"
onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this)">
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGPASIAddMore()">+</button>
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGPASIAddMore()"
style="background-color: #e26728; border:1px solid #e26728;"
>
<i class="mdi mdi-plus"></i>
</button>
<div id='numberToWordSumInsured' class="text-danger-2 mr-2"></div>
</div>
@ -123,43 +137,33 @@
</div>
<div class="row" style="margin-bottom: 10px;">
<div class="col">
<table data-custom-table-css="table">
<tbody>
<tr>
<td>
<input disabled type="checkbox" style="color:black;" name="family_floaters[]"
value="self" id="self" checked>
</td>
<td >
<span style="margin-right: 20px;color:black;">Self</span>
</td>
<td >
<div class="self-age">
<span style="margin-right: 20px;color:black;">Min Age:</span>
<input class="underline-input min_age"
style="background-color: white !important;"
value="<?php echo isset($self_min_age) ? $self_min_age : '18'; ?>"
type="number" name="self_min_age" id="self_min_age_gpa"
onchange="lowerIsEighteen(this)">
</div>
</td>
<td >
<div class="self-age">
<span style="margin-right: 20px;color:black;">Max Age:</span>
<input class="underline-input max_age"
style="background-color:white !important"
value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>"
type="number" name="self_max_age" id="self_max_age_gpa"
onchange="lowerIsEighteen(this)">
</div>
</td>
</tr>
<div class="col d-flex align-items-center"
style="background-color: #F5FFFF;border-radius:10px;box-shadow: 0px 2px 2px 0px #00000040;
padding:20px;">
</tbody>
</table>
<input disabled type="checkbox" style="color:black;" name="family_floaters[]"
value="self" id="self" checked>
<span style="margin-right: 40px;color:black;">Self</span>
<div class="self-age" style="margin-right: 20px;">
<span style="margin-right: 20px;color:black;">Min Age:</span>
<input class="underline-input min_age"
style="background-color: white !important;"
value="<?php echo isset($self_min_age) ? $self_min_age : '18'; ?>"
type="number" name="self_min_age" id="self_min_age_gpa"
onchange="lowerIsEighteen(this)">
</div>
<div class="self-age" style="margin-right: 20px;">
<span style="margin-right: 20px;color:black;">Max Age:</span>
<input class="underline-input max_age"
style="background-color:white !important"
value="<?php echo isset($self_max_age) ? $self_max_age : '60'; ?>"
type="number" name="self_max_age" id="self_max_age_gpa"
onchange="lowerIsEighteen(this)">
</div>
</div>
</div>
<div class="row mb-2">
@ -403,15 +407,13 @@
</div>
<hr>
<div class="gpa_special_condition">
</div>
<br>
<div class="form-group text-right m-b-0" style="margin-top: -49px;">
<a href="#" class="button-like" id="gpaButtonSpecialCondition" title="Special Condition">Special Condition</a>
<a href="#" class="btn button-like" id="gpaButtonSpecialCondition" title="Special Condition">Special Condition</a>
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnGPATermsSubmit" style="margin-top: 100px;">Submit</button>
</div>
</form>
@ -925,8 +927,14 @@
style="max-width:200px;"
value="${data == null || data == undefined || data == "" ? '' : data}" type="text" name="multiple_sum_insured[]"
class="form-control multiple_sum_insured mr-2" onkeypress="return onlyNumbers(event)" onkeyup="formatNumber(this); numtowordinkeyup(this)">
<button type="button" class="btn btn-danger si-remove-multi mr-2" onclick="removeGMCAdditionalSI(this)">x</button>
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGPASIAddMore()">+</button>
<button type="button" class="btn btn-danger si-remove-multi mr-2" onclick="removeGMCAdditionalSI(this)"
style="background-color: #BD0707;border:1px solid #BD0707">
<i class="mdi mdi-delete"></i>
</button>
<button type="button" class="btn btn-primary si-add-more mr-2" onclick="appendGPASIAddMore()"
style="background-color: #e26728; border:1px solid #e26728;" >
<i class="mdi mdi-plus"></i>
</button>
<div id='numberToWordSumInsured' class="text-danger-2 "></div>
</div>
</div>