CHANGE_CLIENT_MODULT_POLICY_GRID_TERMS_OPEN_ENROLLMENT : RV

This commit is contained in:
VENKATESHWARAN 2024-03-05 14:05:28 +05:30
parent 84016cd0e8
commit 91bf0ceb2d
9 changed files with 284 additions and 227 deletions

View File

@ -186,7 +186,7 @@ $routes->group("/util", ["filter" => "authMVC"], function($routes){
$routes->get("get-file-error/(:any)", "EmployeeController::getUploadedFileError/$1");
$routes->get("kyc-other-docs-delete/(:any)", "ClientController::deleteClientKycOtherDocs/$1");
$routes->get("policy-premium", "ClientController::getpolicyGridData/$1");
$routes->get("update-policy-status/(:any)", "ClientController::updateClientPolicyStatus/$1");
$routes->get("update-policy-status", "ClientController::updateClientPolicyStatus/$1");
});
$routes->cli('processjob', 'JobWorker::processJob');

View File

@ -658,9 +658,6 @@ class ClientController extends AdminController
public function getKycDocsById($id=null)
{
@ -717,12 +714,12 @@ class ClientController extends AdminController
public function getpolicyGridData()
{
$policy_id = $this->request->getGet('policy_id');
$client_id = $this->request->getGet('client_id');
$client_policy_id = $this->request->getGet('client_policy_id');
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
$emp_count = $this->employeeModel ->join('client_policy cp',"employees.client_id = cp.client_id")
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
->where("employees.client_id",$client_id)
->where("employees.client_id",$record['client_id'])
->where("employees.emp_status",'active')
->countAllResults();
@ -733,7 +730,7 @@ class ClientController extends AdminController
}
$data = $this->policesModel->getPolicyPremium($policy_id);
$data = $this->policesModel->getPolicyPremium($record['policy_id']);
$policy_name = $data[0]->policy_name;
$pattern = '/gmc/i';
$subject = $data[0]->policy_type;
@ -745,9 +742,9 @@ class ClientController extends AdminController
$results = $this->policyGridModel->like('policy_type', $search_term)->findAll();
if($search_term === 'GPA'){
$premiumData = $this->policyPremium1Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
$premiumData = $this->policyPremium1Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->findAll();
}else{
$premiumData = $this->policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
$premiumData = $this->policyPremium2Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->findAll();
}
@ -763,12 +760,12 @@ class ClientController extends AdminController
try {
$this->myLogger->logme('error','Terms CREATE function called');
// print_r($this->request->getPost());
$client_id = $this->request->getPost("client_id");
$policy_id = $this->request->getPost("policy_id");
/*** Client Policy Table Primary Key(ID) ***/
$client_policy_id = $this->request->getPost("client_policy_id");
$data['sum_insured'] =$this->request->getPost("sum_insured");
$data['family_floater'] =$this->request->getPost("family_floater");
// print_r($data['familyfloater']);
if (!$data['family_floater'] || $data['family_floater'] == 0) {
$data['corporatebuffer'] = "";
$data['family_floaters'] = "";
@ -827,14 +824,12 @@ class ClientController extends AdminController
$jsonData = json_encode($data);
$dataa = array(
'policy_terms' => $jsonData,
'client_id' => $client_id,
'policy_id' => $policy_id
);
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
if ($record) {
$update = $this->clientPolicyModel->update($record['id'], $dataa);
$update = $this->clientPolicyModel->update($client_policy_id, $dataa);
if ($update) {
return $this->respond(['status' => true,'code' => 200,'message' => 'Data updated successfully'], 200);
} else {
@ -859,15 +854,17 @@ class ClientController extends AdminController
public function getterms()
{
$client_id = $this->request->getVar('client_id');
$policy_id = $this->request->getVar('policy_id');
$policy_name = $this->policesModel->select('name')->where('id', $policy_id)->first();
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
$client_policy_id = $this->request->getVar('client_policy_id');
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
$policy_name = $this->policesModel->select('name')->where('id', $record['policy_id'])->first();
$emp_count = $this->employeeModel ->join('client_policy cp',"employees.client_id = cp.client_id")
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
->where("employees.client_id",$client_id)
->where("employees.emp_status",'active')
->countAllResults();
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
->where("employees.client_id", $record['client_id'])
->where("employees.emp_status",'active')
->countAllResults();
if($emp_count = 0){
$emp_count = true;
}else{
@ -888,9 +885,8 @@ class ClientController extends AdminController
try {
$this->myLogger->logme('error','Policy GPA Terms CREATE function called');
// print_r($this->request->getPost());
$client_id = $this->request->getPost("client_id");
$policy_id = $this->request->getPost("policy_id");
/*** Client Policy Table Primary Key(ID) ***/
$client_policy_id = $this->request->getPost("client_policy_id");
$data['sumInsured2'] =$this->request->getPost("sumInsured2");
$data['totalSumInsured'] =$this->request->getPost("totalSumInsured");
@ -940,38 +936,30 @@ class ClientController extends AdminController
$data['terrorism'] = $this->request->getPost("terrorism");
$data['worldwideCover'] = $this->request->getPost("worldwideCover");
$jsonData = json_encode($data);
$dataa = array(
'policy_terms' => $jsonData,
);
print_r($data);
// print_r($this->request->getPost());
// die();
$jsonData = json_encode($data);
$dataa = array(
'policy_terms' => $jsonData,
'client_id' => $client_id,
'policy_id' => $policy_id
);
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
if ($record) {
$update = $this->clientPolicyModel->update($record['id'], $dataa);
$update = $this->clientPolicyModel->update($client_policy_id, $dataa);
if ($update) {
return $this->respond(['status' => true,'code' => 200,'message' => 'Data updated successfully'], 200);
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Data updated successfully', 'client_policy_id' => $client_policy_id], 200);
} else {
return $this->respond(['status' => false,'code' => 404, 'message' => 'Failed to update data'], 200);
}
}else{
$insert = $this->clientPolicyModel->insert($dataa);
if ($insert) {
return $this->respond(['status' => true,'code' => 200,'message' => 'Data stored successfully'], 200);
return $this->respond(['status' => true,'code' => 200,'message' => 'Data stored successfully', 'client_policy_id' => $client_policy_id], 200);
} else {
return $this->respond(['status' => false,'code' => 404, 'message' => 'Failed to store data'], 200);
}
}
} catch (\Exception $e) {
// Handle the exception
echo "Failed to insert data: " . $e->getMessage();
// Log the error
log_message('error', 'Failed to insert data: ' . $e->getMessage());
}
@ -992,11 +980,63 @@ class ClientController extends AdminController
}
public function updateClientPolicyStatus($id=null){
public function updateClientPolicyStatus(){
$client_policy_id = $this->request->getGet('client_policy_id');
$record = $this->clientPolicyModel->where('id', $client_policy_id)->first();
$data = $this->policesModel->getPolicyPremium($record['policy_id']);
$pattern = '/gmc/i';
$subject = $data[0]->policy_type;
if (preg_match($pattern, $subject)) {
$search_term = 'GMC';
} else {
$search_term = 'GPA';
}
if($search_term === 'GPA'){
$racRate = $this->policyPremium1Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->countAllResults();
}else if($search_term === 'GMC'){
$racRate = $this->policyPremium2Model->where(['client_id' => $record['client_id'], 'client_policy_id' => $client_policy_id, 'is_active' => 1])->countAllResults();
}
$termsData = $this->clientPolicyModel->where(['id' => $client_policy_id, 'is_active' => 1])->first();
if(empty($termsData['policy_terms'])){
return $this->respond(['status' => false,'code' => 200,'message' => 'This Policy does not Create Terms'], 200);
}
$termsData = json_decode($termsData['policy_terms']);
if (isset($termsData->sum_insured) && empty($termsData->sum_insured)) {
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Sum Insured field is empty', 'data' => $record], 200);
}
if (isset($termsData->SumInsured) && empty($termsData->sum_insured)) {
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Sum Insured field is empty'], 200);
}
// Check if 'family_floater' key exists and has a value
if (isset($termsData->family_floater) && empty($termsData->family_floater)) {
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Family Floater field is empty'], 200);
}
// Check if 'family_floaters' key exists and has a value
if (isset($termsData->family_floaters) && is_array($termsData->family_floaters) && count($termsData->family_floaters) <= 0) {
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy terms Family Members field is empty'], 200);
$familyFloatersCount = count($termsData->family_floaters);
}
if($racRate == 0){
return $this->respond(['status' => false,'code' => 200,'message' => 'The Policy has no Data for Rac Rate'], 200);
}
$policy_status = $this->clientPolicyModel->where('id', $client_policy_id )->set('policy_status', 1)->update();
return $this->respond(['status' => true,'code' => 200, 'message' => 'Policy Status Updated Successfully', 'data' => $termsData, 'racRate' => $racRate], 200);
$policy_status = $this->clientPolicyModel->where('id', $id )->set('policy_status', 1)->update();
return $this->respond(['status' => true,'code' => 200,'data' => $id], 200);
}

View File

@ -18,9 +18,10 @@ use App\Controllers\JobWorker ;
use App\Controllers\Jobs\SubJob;
use App\Controllers\EmployeeServiceController;
use CodeIgniter\API\ResponseTrait;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
class EmployeeController extends AdminController
{
@ -192,9 +193,68 @@ class EmployeeController extends AdminController
public function getExcelFileErrors()
{
$file_id = $this->request->uri->getSegment(3);
echo view('excel_errors');
$file = $this->fileModel->find($file_id);
$error_data = json_decode($file['reason']);
$file_name_with_path = WRITEPATH."/uploads/excel/".$file['file_name'];
//check the file exist or not
if(!file_exists($file_name_with_path))
{
$error_message = "File not found";
$this->myLogger->logme('error',($error_message . ' for file id ' . $file_id));
}
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file_name_with_path);
$sheet = $spreadsheet->getActiveSheet();
$highestRowAndColumn = $sheet->getHighestRowAndColumn();
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
$data['excel_header'] = $excel_data[0];
unset($excel_data[0]);
$data['excel_data'] = $excel_data;
echo '<pre>';
// foreach ($error_data->error_data as $key => $value) {
// print_r($excel_data[$key]);
// foreach($value as $key2 => $value2){
// // echo '<pre>';
// // print_r($excel_data[$key][$value2->col_idx]);
// }
// }
$finalArray = [];
foreach ($error_data->error_data as $key => $value) {
foreach($value as $key2 => $value2){
$error_data = $value2->error;
echo '<pre>';
// print_r([$value2->col_idx]);
$excel_data[$key][$value2->col_idx] = $error_data;
// print_r($excel_data[$key]);
}
// print_r($excel_data[$key]);
// array_push($finalArray, $excel_data);
}
print_r($excel_data);
die;
// echo '###################################################################### <br>';
// print_r($excel_data);
// echo '###################################################################### <br>';
// print_r($error_data->error_data); die;
$headerData['page_name'] = 'Excel Error';
echo view('layout/header', $headerData);
echo view('excel_errors', $data);
echo view('layout/footer');
}

View File

@ -203,10 +203,10 @@
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="#" data-id="${item.id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="#" data-id="${item.policy_id}" class="dropdown-item btnPolicyMaster" data-toggle="modal" id="${item.policy_type_id}"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
<a href="#" data-id="${item.policy_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rac Rate</a>
<a href="#" data-id="${item.id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a>
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="#" data-id="${item.id}" id="${item.policy_type_id}" class="dropdown-item btnPolicyMaster" data-toggle="modal" id="${item.policy_type_id}"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
<a href="#" data-id="${item.id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rac Rate</a>
<a href="#" data-id="${item.id}" id="${item.policy_id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a>
</div>
</div>
</td>
@ -286,11 +286,17 @@
<td>${item.policy_name}</td>
<td>${item.tpa_short} - ${item.tpa_branch_code}</td>
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
<td>${checkDateStatus(item.policy_end_date)}</td>
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
<td>
<a data-id="${item.id}" class="btnPolicyEdit mdi mdi-lead-pencil" href="#" style="font-size:18px;"></a>&nbsp;&nbsp;
<a data-id="${item.policy_id}" class="btnPolicyMaster mdi mdi-wrench" href="#" data-toggle="modal" data-target="${item.policy_type_id}" style="font-size:18px; margin-left: 7px;"></a>
<a data-id="${item.policy_id}" class="btnPolicyModel mdi mdi-book-open" href="#" data-toggle="modal" data-target="#bs-example-modal-lg" style="font-size:18px;"></a>
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown"aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="#" data-id="${item.id}" class="dropdown-item btnPolicyEdit"><i class="mdi mdi-lead-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
<a href="#" data-id="${item.policy_id}" class="dropdown-item btnPolicyMaster" data-toggle="modal" id="${item.policy_type_id}"><i class="mdi mdi-wrench mr-2 text-muted font-18 vertical-middle"></i>Terms</a>
<a href="#" data-id="${item.policy_id}" class="dropdown-item btnPolicyModel" data-toggle="modal" data-target="#bs-example-modal-lg"><i class="mdi mdi-book-open mr-2 text-muted font-18 vertical-middle"></i>Rac Rate</a>
<a href="#" data-id="${item.id}" class="dropdown-item btnOpenEnroll"><i class="mdi mdi-file-lock mr-2 text-muted font-18 vertical-middle"></i>Open Enrollment</a>
</div>
</div>
</td>
</tr>
`;
@ -300,6 +306,17 @@
error: function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
if (xhr.status === 404) {
toastr.warning('Resource not found', 'Warning');
} else if (xhr.status === 500) {
toastr.warning('Internal server error', 'Warning');
} else {
toastr.warning('Unknown error occurred', 'Warning');
}
}, 1000);
}
});
});
@ -406,22 +423,53 @@
$('body').on('click', '.btnOpenEnroll', function () {
var policy_id = $(this).attr('data-id');
console.log(policy_id)
if(policy_id){
var client_policy_id = $(this).attr('data-id');
var policy_id = $(this).attr('id');
var client_id = $('#client_id_policy').val()
console.log('client_policy_id', client_policy_id);
if(client_policy_id){
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
}
$.get('<?php echo base_url('util/update-policy-status/');?>'+policy_id, function (data) {
if(data){
$.ajax({
url: '<?php echo base_url('util/update-policy-status');?>',
type: 'GET',
data: {
client_policy_id : client_policy_id,
},
success: function(res) {
console.log(res);
if(res) {
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
if(res.status === true){
toastr.success(res.message, 'Success');
}else if(res.status === false){
toastr.warning(res.message, 'Warning');
}
}, 1000);
}
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
toastr.success('Policy Status Updated Successfully', 'Success');
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
if (xhr.status === 404) {
toastr.warning('Resource not found', 'Warning');
} else if (xhr.status === 500) {
toastr.warning('Internal server error', 'Warning');
} else {
toastr.warning('Unknown error occurred', 'Warning');
}
}, 1000);
}
})
});
});

View File

@ -1,131 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>nHANCE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
<meta content="Coderthemes" name="author" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url()."public"; ?>/assets/images/favicon.ico">
<!-- App css -->
<link href="<?= base_url()."public"; ?>/assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css"
id="bs-default-stylesheet" />
<link href="<?= base_url()."public"; ?>/assets/css/app-material.min.css" rel="stylesheet" type="text/css"
id="app-default-stylesheet" />
<link href="<?= base_url()."public"; ?>/assets/css/bootstrap-material-dark.min.css" rel="stylesheet" type="text/css"
id="bs-dark-stylesheet" />
<link href="<?= base_url()."public"; ?>/assets/css/app-material-dark.min.css" rel="stylesheet" type="text/css"
id="app-dark-stylesheet" />
<!-- icons -->
<link href="<?= base_url()."public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
<style>
a:hover {
cursor: pointer;
}
</style>
</head>
<body class="loading auth-fluid-pages pb-0">
<!-- <div class="auth-fluid"> -->
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<h4 class="header-title">Contextual classes</h4>
<p class="sub-header">
Use contextual classes to color table rows or individual cells.
</p>
<div class="table-responsive">
<table class="table mb-0">
<thead>
<tr>
<th>#</th>
<th>Column heading</th>
<th>Column heading</th>
<th>Column heading</th>
</tr>
</thead>
<tbody>
<tr class="table-active">
<th scope="row">1</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
<tr class="table-success">
<th scope="row">3</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
<tr>
<th scope="row">4</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
<tr class="table-info">
<th scope="row">5</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
<tr>
<th scope="row">6</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
<tr class="table-warning">
<th scope="row">7</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
<tr>
<th scope="row">8</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
<tr class="table-danger">
<th scope="row">9</th>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>
</tr>
</tbody>
</table>
</div> <!-- end table-responsive-->
</div>
</div> <!-- end card -->
</div> <!-- end col -->
<div class="row" id="List-page">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="row" style="margin-bottom:1rem;">
<div class="col-6" style="align-self: center;">
<h4 class="header-title" style="position: relative;">Excel Error List</h4>
</div>
<!-- </div> -->
<!-- end auth-fluid-->
<!-- Vendor js -->
<script src="<?= base_url()."public"; ?>/assets/js/vendor.min.js"></script>
<!-- App js -->
<script src="<?= base_url()."public"; ?>/assets/js/app.min.js"></script>
</body>
</html>
</div>
<div class="table-responsive">
<table class="table table-sm table-hover m-0 table-centered dt-responsive nowrap w-100" cellspacing="0" id="tickets-table">
<thead class="bg-light">
<tr>
<?php foreach ($excel_header as $header): ?>
<th><?php echo $header; ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php for ($i = 1; $i < count($excel_data); $i++): ?>
<tr>
<?php foreach ($excel_data[$i] as $data): ?>
<td><?php echo $data; ?></td>
<?php endforeach; ?>
</tr>
<?php endfor; ?>
</tbody>
</table>
<div>
</div>
</div>
</div>
<!-- end col -->
</div>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<title>nHance</title>
<title><?= isset($page_name) ? $page_name : 'nHance'; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="" name="description" />
<meta content="nHANCE" name="nHANCE" />

View File

@ -79,7 +79,7 @@
<form role="form" class="parsley-examples" method="post" id="policyJsonForm" enctype="multipart/form-data" >
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>"/>
<input type="hidden" name="client_id" id="Client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
<input type="hidden" name="client_policy_id" id="client_policy_id" />
<input type="hidden" name="client_policy_id" id="gmc_client_policy_id" />
<input type="hidden" name="policy_id" id="policy_id"/>
<input type="hidden" id="gmc_emp_count"/>
@ -468,16 +468,14 @@ var grid_html = '';
$('body').on('click', '.btnPolicyMaster', function () {
var policy_id = $(this).data('id');
$('#policy_id').val(policy_id);
var client_policy_id = $(this).data('id');
console.log('gmc_client_policy_id :' ,client_policy_id);
$('#gmc_client_policy_id').val(client_policy_id)
var client_id = $('#Client_id').val();
$('#client_policy_id').val(policy_id);
var gmc_policy_type_id = $(this).attr('id');
console.log('gmc_policy_type_id', typeof gmc_policy_type_id)
if(gmc_policy_type_id >= '2'){
$('#policyGMCTerms').css('display', '');
@ -489,11 +487,12 @@ var grid_html = '';
$.ajax({
url: '<?= base_url("client/policy/getterms") ?>',
method: 'GET',
data: { policy_id : policy_id , client_id: client_id},
data: {client_policy_id: client_policy_id},
success: function(response) {
$('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
$('gmc_emp_count').val(response.count)
$('gmc_emp_count').val(response.count);
if(response.count){
$('emp_count').val(response.count)

View File

@ -108,17 +108,17 @@
</div>
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<div class="form-group col-md-6 form-group-client-policy-master" >
<label for="permanentTotalDisablement" class=" " style="width: 400px;">Permanent Total Disablement</label>
<input type="text" name="permanentTotalDisablement" id="permanentTotalDisablement" class="form-control form-control-client-policy-master">
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<div class="form-group col-md-6 form-group-client-policy-master">
<label for="permanentPartialDisablement" class=" " style="width: 400px;">Permanent Partial Disablement</label>
<input type="text" name="permanentPartialDisablement" id="permanentPartialDisablement" class="form-control form-control-client-policy-master">
</div>
<div class="form-group col-md-6 form-group-client-policy-master" style="display:none;">
<div class="form-group col-md-6 form-group-client-policy-master">
<label for="temporaryTotalDisablementBenefit" class=" " style="width: 400px;">Temporary Total Disablement benefit</label>
<input type="text" name="temporaryTotalDisablementBenefit" id="temporaryTotalDisablementBenefit" class="form-control form-control-client-policy-master">
</div>
@ -388,16 +388,15 @@
$('body').on('click', '.btnPolicyMaster', function () {
var policy_id = $(this).data('id');
console.log('policy_id :' ,policy_id);
$('#gpa_policy_id').val(policy_id);
var client_policy_id = $(this).data('id');
console.log('client_policy_id :' ,client_policy_id);
var client_id = $('#Client_id').val();
$('#gpa_client_policy_id').val(client_id);
$('#gpa_client_policy_id').val(client_policy_id);
var policy_type_id = $(this).attr('id');
var gpa_policy_type_id = $(this).attr('id');
console.log('gpa_policy_type_id', gpa_policy_type_id)
if(policy_type_id == '1'){
if(gpa_policy_type_id == '1'){
$('#policyGPATermsForm').css('display', '');
$('#police-tab').css('display', 'none');
@ -408,7 +407,7 @@
$.ajax({
url: '<?= base_url("client/policy/getterms") ?>',
method: 'GET',
data: { policy_id : policy_id , client_id: client_id},
data: {client_policy_id: client_policy_id},
success: function(res) {
console.log(res)

View File

@ -428,8 +428,6 @@
event.preventDefault();
console.log($('#grid_emp_count').val());
if($('#grid_emp_count').val() == 'true'){
console.log('test')
toastr.warning('Client has active employees', 'Warning');
@ -476,6 +474,17 @@
error: function(xhr, status, error) {
console.error(xhr.responseText);
console.error(status, error);
setTimeout(function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
if (xhr.status === 404) {
toastr.warning('Resource not found', 'Warning');
} else if (xhr.status === 500) {
toastr.warning('Internal server error', 'Warning');
} else {
toastr.warning('Unknown error occurred', 'Warning');
}
}, 1000);
}
});
});
@ -484,14 +493,13 @@
$('body').on('click', '.btnPolicyModel', function () {
var policy_id = $(this).data('id');
var client_id = $('#Client_id').val();
$('#client_policy_id').val(policy_id);
var client_policy_id = $(this).data('id');
$('#client_policy_id').val(client_policy_id);
$.ajax({
url: '<?= base_url("util/policy-premium") ?>' ,
type: "GET",
data: { policy_id: policy_id, client_id: client_id },
data: { client_policy_id: client_policy_id},
dataType: 'json',
success: function (res) {