FEAT_CLIENT_OPEN_ENROLLMENT : RV
This commit is contained in:
parent
0a0322276a
commit
8aa229a4e6
@ -185,6 +185,7 @@ $routes->group("/util", ["filter" => "authMVC"], function($routes){
|
|||||||
$routes->get("get-file-error/(:any)", "EmployeeController::getUploadedFileError/$1");
|
$routes->get("get-file-error/(:any)", "EmployeeController::getUploadedFileError/$1");
|
||||||
$routes->get("kyc-other-docs-delete/(:any)", "ClientController::deleteClientKycOtherDocs/$1");
|
$routes->get("kyc-other-docs-delete/(:any)", "ClientController::deleteClientKycOtherDocs/$1");
|
||||||
$routes->get("policy-premium", "ClientController::getpolicyGridData/$1");
|
$routes->get("policy-premium", "ClientController::getpolicyGridData/$1");
|
||||||
|
$routes->get("update-policy-status/(:any)", "ClientController::updateClientPolicyStatus/$1");
|
||||||
});
|
});
|
||||||
|
|
||||||
$routes->cli('processjob', 'JobWorker::processJob');
|
$routes->cli('processjob', 'JobWorker::processJob');
|
||||||
|
|||||||
@ -122,6 +122,7 @@ class ClientController extends AdminController
|
|||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In your controller
|
// In your controller
|
||||||
public function deposit($id = null)
|
public function deposit($id = null)
|
||||||
{
|
{
|
||||||
@ -139,9 +140,8 @@ class ClientController extends AdminController
|
|||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function view_Deposit($insurerId)
|
||||||
|
{
|
||||||
public function view_Deposit($insurerId) {
|
|
||||||
// Load your model to fetch data based on $clientId and $insurerId
|
// Load your model to fetch data based on $clientId and $insurerId
|
||||||
$subTypeOptions = [
|
$subTypeOptions = [
|
||||||
1 => 'Deposit',
|
1 => 'Deposit',
|
||||||
@ -165,13 +165,11 @@ public function view_Deposit($insurerId) {
|
|||||||
echo view('layout/header', $headerData);
|
echo view('layout/header', $headerData);
|
||||||
echo view('view_deposit',$data);
|
echo view('view_deposit',$data);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function saveDeposit()
|
||||||
|
{
|
||||||
public function saveDeposit()
|
|
||||||
{
|
|
||||||
// Retrieve form data from POST request
|
// Retrieve form data from POST request
|
||||||
$loggedInUserID = get_session_userid();
|
$loggedInUserID = get_session_userid();
|
||||||
|
|
||||||
@ -191,9 +189,7 @@ public function saveDeposit()
|
|||||||
|
|
||||||
// Return a boolean value based on success
|
// Return a boolean value based on success
|
||||||
return $this->response->setJSON(['success' => $response['success']]);
|
return $this->response->setJSON(['success' => $response['success']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function editClientOnboarding($id = null)
|
public function editClientOnboarding($id = null)
|
||||||
@ -620,7 +616,6 @@ public function saveDeposit()
|
|||||||
$premium = isset($premiumData[$i]) ? $premiumData[$i] : null;
|
$premium = isset($premiumData[$i]) ? $premiumData[$i] : null;
|
||||||
$grade = isset($this->request->getPost('grade')[$i]) ? $this->request->getPost('grade')[$i] : null;
|
$grade = isset($this->request->getPost('grade')[$i]) ? $this->request->getPost('grade')[$i] : null;
|
||||||
$max_si = isset($this->request->getPost('max_si')[$i]) ? $this->request->getPost('max_si')[$i] : null;
|
$max_si = isset($this->request->getPost('max_si')[$i]) ? $this->request->getPost('max_si')[$i] : null;
|
||||||
$created_by = get_session_userid();
|
|
||||||
|
|
||||||
if ($si !== null) {
|
if ($si !== null) {
|
||||||
$data['si'] = $si;
|
$data['si'] = $si;
|
||||||
@ -739,6 +734,7 @@ public function saveDeposit()
|
|||||||
|
|
||||||
|
|
||||||
$data = $this->policesModel->getPolicyPremium($policy_id);
|
$data = $this->policesModel->getPolicyPremium($policy_id);
|
||||||
|
$policy_name = $data[0]->policy_name;
|
||||||
$pattern = '/gmc/i';
|
$pattern = '/gmc/i';
|
||||||
$subject = $data[0]->policy_type;
|
$subject = $data[0]->policy_type;
|
||||||
if (preg_match($pattern, $subject)) {
|
if (preg_match($pattern, $subject)) {
|
||||||
@ -754,10 +750,11 @@ public function saveDeposit()
|
|||||||
$premiumData = $this->policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
|
$premiumData = $this->policyPremium2Model->where(['client_id' => $client_id, 'client_policy_id' => $policy_id, 'is_active' => 1])->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// echo '<pre>';
|
// echo '<pre>';
|
||||||
// print_r($results);
|
// print_r($results);
|
||||||
// print_r($data[0]->policy_type); die;
|
// print_r($data[0]->policy_type); die;
|
||||||
return $this->respond(['status' => true,'code' => 200,'data' => $results, 'premiumData' => $premiumData, 'count' => $emp_count], 200);
|
return $this->respond(['status' => true,'code' => 200,'data' => $results, 'premiumData' => $premiumData, 'count' => $emp_count, 'policy_name' => $policy_name], 200);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -864,6 +861,7 @@ public function saveDeposit()
|
|||||||
{
|
{
|
||||||
$client_id = $this->request->getVar('client_id');
|
$client_id = $this->request->getVar('client_id');
|
||||||
$policy_id = $this->request->getVar('policy_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();
|
$record = $this->clientPolicyModel->where(['client_id' => $client_id, 'policy_id' => $policy_id])->first();
|
||||||
$emp_count = $this->employeeModel ->join('client_policy cp',"employees.client_id = cp.client_id")
|
$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")
|
->join('employee_polices ep',"cp.id = ep.client_policy_id AND employees.id = ep.employee_id")
|
||||||
@ -877,9 +875,9 @@ public function saveDeposit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($record) {
|
if ($record) {
|
||||||
return $this->respond(['Status' => true,'code' => 200,'data' => $record['policy_terms'], 'count' => $emp_count], 200);
|
return $this->respond(['Status' => true,'code' => 200,'data' => $record['policy_terms'], 'count' => $emp_count, 'policy_name' => $policy_name], 200);
|
||||||
} else {
|
} else {
|
||||||
return $this->respond(['Status' => false,'code' => 200,'message' => 'Record not found.', 'count' => $emp_count], 200);
|
return $this->respond(['Status' => false,'code' => 200,'message' => 'Record not found.', 'count' => $emp_count, 'policy_name' => $policy_name], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -994,4 +992,12 @@ public function saveDeposit()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateClientPolicyStatus($id=null){
|
||||||
|
|
||||||
|
|
||||||
|
$policy_status = $this->clientPolicyModel->where('id', $id )->set('policy_status', 1)->update();
|
||||||
|
return $this->respond(['status' => true,'code' => 200,'data' => $id], 200);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -22,6 +22,7 @@ class PolicesModel extends Model
|
|||||||
|
|
||||||
return $this->db->table('policies')
|
return $this->db->table('policies')
|
||||||
->select('policy_type.*')
|
->select('policy_type.*')
|
||||||
|
->select('policies.name as policy_name')
|
||||||
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
->join('policy_type', 'policy_type.id = policies.policy_type_id')
|
||||||
->where('policies.id', $policy_id)
|
->where('policies.id', $policy_id)
|
||||||
->get()
|
->get()
|
||||||
|
|||||||
@ -18,6 +18,7 @@ class PolicyPremium2Model extends Model
|
|||||||
'age_to',
|
'age_to',
|
||||||
'si',
|
'si',
|
||||||
'premium',
|
'premium',
|
||||||
|
'max_si',
|
||||||
'grade',
|
'grade',
|
||||||
"created_by",
|
"created_by",
|
||||||
"updated_by",
|
"updated_by",
|
||||||
|
|||||||
@ -38,11 +38,7 @@
|
|||||||
<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>
|
<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">
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
<a class="dropdown-item" href="<?= base_url("client/list/"); ?><?= $row->id;?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
<a class="dropdown-item" href="<?= base_url("client/list/"); ?><?= $row->id;?>"><i class="mdi mdi-pencil mr-2 text-muted font-18 vertical-middle"></i>Edit</a>
|
||||||
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>">
|
<a class="dropdown-item" href="<?= base_url("client/deposit/{$row->id}"); ?>"><i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>Deposit</a>
|
||||||
<i class="mdi mdi-cash mr-2 text-muted font-18 vertical-middle"></i>Deposit
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
<a class="dropdown-item" href="#"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
<a class="dropdown-item" href="#"><i class="mdi mdi-delete mr-2 text-muted font-18 vertical-middle"></i>Delete</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
<label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label>
|
<label for="policy_end_date">Policy End Date<span class="text-danger">*</span></label>
|
||||||
<input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required>
|
<input value="" type="text" class="form-control" placeholder="Enter End Date " name="policy_end_date" id="end_date" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4" id="policy_status_field">
|
||||||
<label for="policy_status">Policy Status</label>
|
<label for="policy_status">Policy Status</label>
|
||||||
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
|
<input value="" type="text" class="form-control" placeholder="Policy Status" id="policy_status" readonly>
|
||||||
</div>
|
</div>
|
||||||
@ -126,6 +126,8 @@
|
|||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
$('#policy_status_field').hide()
|
||||||
|
|
||||||
// Get today's date
|
// Get today's date
|
||||||
var today = new Date();
|
var today = new Date();
|
||||||
|
|
||||||
@ -198,9 +200,15 @@
|
|||||||
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
<td>${rearrangeDateFormat(item.policy_start_date)} - ${rearrangeDateFormat(item.policy_end_date)}</td>
|
||||||
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
<td>${checkDateStatus(item.policy_end_date, 1)}</td>
|
||||||
<td>
|
<td>
|
||||||
<a data-id="${item.id}" class="btnPolicyEdit mdi mdi-lead-pencil" href="#" style="font-size:18px;"></a>
|
<div class="btn-group dropdown">
|
||||||
<a data-id="${item.policy_id}" class="btnPolicyMaster mdi mdi-wrench" href="#" data-toggle="modal" id="${item.policy_type_id}" style="font-size:18px;"></a>
|
<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>
|
||||||
<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; margin-left: 7px;"></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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
@ -212,7 +220,6 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/******** for form submit using AJAX *******/
|
/******** for form submit using AJAX *******/
|
||||||
$("#policy_form").submit(function(event) {
|
$("#policy_form").submit(function(event) {
|
||||||
|
|
||||||
@ -297,7 +304,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/********* To get th POLICY base on Insurer *******/
|
/********* To get th POLICY base on Insurer *******/
|
||||||
$('#insurer').change(function() {
|
$('#insurer').change(function() {
|
||||||
var id = $(this).val();
|
var id = $(this).val();
|
||||||
@ -321,8 +327,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/********* set the Policy_Type_id for Form Submit *******/
|
||||||
// set the Policy_Type_id for Form Submit
|
|
||||||
$('#policy').change(function(){
|
$('#policy').change(function(){
|
||||||
|
|
||||||
var dataId = $(this).children('option:selected').attr('data-id');
|
var dataId = $(this).children('option:selected').attr('data-id');
|
||||||
@ -337,7 +342,6 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// get the client policy data for edit
|
// get the client policy data for edit
|
||||||
$('body').on('click', '.btnPolicyEdit', function () {
|
$('body').on('click', '.btnPolicyEdit', function () {
|
||||||
|
|
||||||
@ -354,7 +358,6 @@
|
|||||||
success: function (res) {
|
success: function (res) {
|
||||||
|
|
||||||
console.log('clientPolicy : ', res);
|
console.log('clientPolicy : ', res);
|
||||||
|
|
||||||
$('#policy_form_action').val('<?= base_url("client/policy/edit"); ?>');
|
$('#policy_form_action').val('<?= base_url("client/policy/edit"); ?>');
|
||||||
|
|
||||||
if (res.status === false) {
|
if (res.status === false) {
|
||||||
@ -375,12 +378,17 @@
|
|||||||
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date));
|
$('#start_date').val(rearrangeDateFormat(res.data.policy_start_date));
|
||||||
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date));
|
$('#end_date').val(rearrangeDateFormat(res.data.policy_end_date));
|
||||||
$('#policy_status').val(checkDateStatus(res.data.policy_end_date));
|
$('#policy_status').val(checkDateStatus(res.data.policy_end_date));
|
||||||
|
$('#policy_status_field').show();
|
||||||
|
|
||||||
if(res.data.policy_type_id == 1){
|
/** do not delete this comment condition
|
||||||
appendPolicyFormFields(1, res.data);
|
|
||||||
}else if(res.data.policy_type_id >= 2) {
|
// if(res.data.policy_type_id == 1){
|
||||||
appendPolicyFormFields(2, res.data);
|
// appendPolicyFormFields(1, res.data);
|
||||||
}
|
// }else if(res.data.policy_type_id >= 2) {
|
||||||
|
// appendPolicyFormFields(2, res.data);
|
||||||
|
// }
|
||||||
|
|
||||||
|
do not delete this comment condition **/
|
||||||
|
|
||||||
var policeOptionHTML = '';
|
var policeOptionHTML = '';
|
||||||
$.each(res.policy, function(index, item) {
|
$.each(res.policy, function(index, item) {
|
||||||
@ -396,6 +404,26 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('body').on('click', '.btnOpenEnroll', function () {
|
||||||
|
|
||||||
|
var policy_id = $(this).attr('data-id');
|
||||||
|
console.log(policy_id)
|
||||||
|
if(policy_id){
|
||||||
|
$('.loader').fadeIn();
|
||||||
|
$('.loader-mask').fadeIn();
|
||||||
|
}
|
||||||
|
|
||||||
|
$.get('<?php echo base_url('util/update-policy-status/');?>'+policy_id, function (data) {
|
||||||
|
if(data){
|
||||||
|
setTimeout(function() {
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
toastr.success('Policy Status Updated Successfully', 'Success');
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
function appendPolicyFormFields(policy_type, data = false){
|
function appendPolicyFormFields(policy_type, data = false){
|
||||||
|
|
||||||
@ -571,57 +599,57 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to convert numbers into Indian numbering system
|
const numberWords = {
|
||||||
function convertToIndianNumberingSystem(number) {
|
0: "Zero", 1: "One", 2: "Two", 3: "Three", 4: "Four", 5: "Five", 6: "Six", 7: "Seven", 8: "Eight", 9: "Nine",
|
||||||
// Define Indian numbering system
|
10: "Ten", 11: "Eleven", 12: "Twelve", 13: "Thirteen", 14: "Fourteen", 15: "Fifteen", 16: "Sixteen", 17: "Seventeen", 18: "Eighteen", 19: "Nineteen",
|
||||||
var suffixes = ["", "Thousand", "Lakh", "Crore"];
|
20: "Twenty", 30: "Thirty", 40: "Forty", 50: "Fifty", 60: "Sixty", 70: "Seventy", 80: "Eighty", 90: "Ninety"
|
||||||
|
};
|
||||||
|
|
||||||
// Split the number into groups of 3 digits each
|
function convertNumberToWords(number) {
|
||||||
var numberChunks = [];
|
if (number === 0) {
|
||||||
while (number > 0) {
|
return numberWords[number];
|
||||||
numberChunks.push(number % 1000);
|
|
||||||
number = Math.floor(number / 1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert each chunk into words
|
let word = '';
|
||||||
var result = "";
|
|
||||||
for (var i = 0; i < numberChunks.length; i++) {
|
if (number >= 10000000) {
|
||||||
if (numberChunks[i] !== 0) {
|
word += convertNumberToWords(Math.floor(number / 10000000)) + " Crore ";
|
||||||
result = convertThreeDigitNumberToWords(numberChunks[i]) + " " + suffixes[i] + " " + result;
|
number %= 10000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (number >= 100000) {
|
||||||
|
word += convertNumberToWords(Math.floor(number / 100000)) + " Lakh ";
|
||||||
|
number %= 100000;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (number >= 1000) {
|
||||||
|
word += convertNumberToWords(Math.floor(number / 1000)) + " Thousand ";
|
||||||
|
number %= 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (number >= 100) {
|
||||||
|
word += convertNumberToWords(Math.floor(number / 100)) + " Hundred ";
|
||||||
|
number %= 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (number > 0) {
|
||||||
|
if (word !== '') {
|
||||||
|
word += "and ";
|
||||||
|
}
|
||||||
|
if (number <= 20) {
|
||||||
|
word += numberWords[number];
|
||||||
|
} else {
|
||||||
|
word += numberWords[Math.floor(number / 10) * 10] + " " + numberWords[number % 10];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.trim();
|
return word;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to convert a three-digit number into words
|
function onlyNumbers(event){
|
||||||
function convertThreeDigitNumberToWords(num) {
|
var charcode;
|
||||||
var ones = ["", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"];
|
charcode = event.which || event.keyCode;
|
||||||
var tens = ["", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"];
|
if(charcode>= 48 && charcode <= 57)return true;
|
||||||
var teens = ["", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"];
|
return false;
|
||||||
|
|
||||||
var words = "";
|
|
||||||
|
|
||||||
// Convert hundreds place
|
|
||||||
if (Math.floor(num / 100) > 0) {
|
|
||||||
words += ones[Math.floor(num / 100)] + " Hundred ";
|
|
||||||
num %= 100;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert tens and ones place
|
|
||||||
if (num >= 20) {
|
|
||||||
words += tens[Math.floor(num / 10)] + " ";
|
|
||||||
num %= 10;
|
|
||||||
} else if (num >= 11 && num <= 19) {
|
|
||||||
words += teens[num - 10] + " ";
|
|
||||||
num = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (num > 0) {
|
|
||||||
words += ones[num] + " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
return words.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
<div id="policyGMCTerms" style="display:none">
|
<div id="policyGMCTerms" style="display:none">
|
||||||
<span id="policyGMCTermsClose" style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
<span id="policyGMCTermsClose" style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
||||||
<h5><label for="gmcTerms" style="margin-bottom: 20px;">Policy GMC Terms</label></h5>
|
<h5><label for="gmcTerms" style="margin-bottom: 20px;">Policy Terms <span id="nameOfThePolicyInGMC"></span></label></h5>
|
||||||
<form role="form" class="parsley-examples" method="post" id="policyJsonForm" enctype="multipart/form-data" >
|
<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" 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_id" id="Client_id" value="<?= isset($client['id']) ? $client['id'] : '' ?>"/>
|
||||||
@ -88,8 +88,11 @@
|
|||||||
<div class="form-column">
|
<div class="form-column">
|
||||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||||
<label for="emp_code" class=" " style="width: 400px;">Sum Insured</label>
|
<label for="emp_code" class=" " style="width: 400px;">Sum Insured</label>
|
||||||
<input type="text" name="sum_insured" id="sum_insured" class="form-control form-control-client-policy-master">
|
<input type="text" name="sum_insured" id="sum_insured" class="form-control form-control-client-policy-master" onkeypress = "return onlyNumbers(event)">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id='numberToWordGMC' class="text-danger" style="float: right;position: relative;right: 25px;bottom: 10px;"></div>
|
||||||
|
|
||||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||||
<label class=" " style="width: 400px;">Family Floater</label><br>
|
<label class=" " style="width: 400px;">Family Floater</label><br>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
@ -471,11 +474,11 @@ var grid_html = '';
|
|||||||
var client_id = $('#Client_id').val();
|
var client_id = $('#Client_id').val();
|
||||||
$('#client_policy_id').val(policy_id);
|
$('#client_policy_id').val(policy_id);
|
||||||
|
|
||||||
var policy_type_id = $(this).attr('id');
|
var gmc_policy_type_id = $(this).attr('id');
|
||||||
console.log('policy_type_id', typeof policy_type_id)
|
console.log('gmc_policy_type_id', typeof gmc_policy_type_id)
|
||||||
|
|
||||||
|
|
||||||
if(policy_type_id >= '2'){
|
if(gmc_policy_type_id >= '2'){
|
||||||
|
|
||||||
$('#policyGMCTerms').css('display', '');
|
$('#policyGMCTerms').css('display', '');
|
||||||
$('#police-tab').css('display', 'none');
|
$('#police-tab').css('display', 'none');
|
||||||
@ -489,6 +492,7 @@ var grid_html = '';
|
|||||||
data: { policy_id : policy_id , client_id: client_id},
|
data: { policy_id : policy_id , client_id: client_id},
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
|
||||||
|
$('#nameOfThePolicyInGMC').html(' - ' + response.policy_name.name);
|
||||||
$('gmc_emp_count').val(response.count)
|
$('gmc_emp_count').val(response.count)
|
||||||
if(response.count){
|
if(response.count){
|
||||||
|
|
||||||
@ -598,6 +602,15 @@ var grid_html = '';
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#sum_insured").on("keyup", function() {
|
||||||
|
var inputNumber = parseInt($(this).val());
|
||||||
|
if (!isNaN(inputNumber)) {
|
||||||
|
var result = convertNumberToWords(inputNumber);
|
||||||
|
$("#numberToWordGMC").text(result);
|
||||||
|
} else {
|
||||||
|
$("#numberToWordGMC").text("");
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -77,11 +77,11 @@
|
|||||||
|
|
||||||
<div id="policyGPATermsForm" style="display:none">
|
<div id="policyGPATermsForm" style="display:none">
|
||||||
<span id="policyGPATermsClose" style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
<span id="policyGPATermsClose" style="float: right;font-size: 26px;color: red;margin-top: -42px;margin-left: 3px;margin-right: 7px;">x</span>
|
||||||
<h5><label for="gpaTerms" style="margin-bottom: 20px;">Policy GMC Terms</label></h5>
|
<h5><label for="gpaTerms" style="margin-bottom: 20px;">Policy Terms <span id="nameOfThePolicyInGPA"></span></label></h5>
|
||||||
<form role="form" class="parsley-examples" method="post" id="policyGPATerms" enctype="multipart/form-data">
|
<form role="form" class="parsley-examples" method="post" id="policyGPATerms" enctype="multipart/form-data">
|
||||||
<input type="hidden" value="<?= csrf_hash() ?>" name="<?= csrf_token() ?>"/>
|
<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_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="gpa_client_policy_id" />
|
||||||
<input type="hidden" name="policy_id" id="gpa_policy_id"/>
|
<input type="hidden" name="policy_id" id="gpa_policy_id"/>
|
||||||
<input type="hidden" id="emp_count"/>
|
<input type="hidden" id="emp_count"/>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -90,10 +90,10 @@
|
|||||||
|
|
||||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||||
<label for="sumInsured" class=" " style="width: 400px;">Sum Insured</label>
|
<label for="sumInsured" class=" " style="width: 400px;">Sum Insured</label>
|
||||||
<input type="text" name="sumInsured2" id="sumInsured2" class="form-control form-control-client-policy-master"> <br>
|
<input type="text" name="sumInsured2" id="sumInsured2" class="form-control form-control-client-policy-master" onkeypress = "return onlyNumbers(event)"> <br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id='numberToWord' class="text-danger"></div>
|
<div id='numberToWord' class="text-danger" style="float: right;position: relative;right: 25px;bottom: 10px;"></div>
|
||||||
|
|
||||||
<div class="form-group col-md-6 form-group-client-policy-master">
|
<div class="form-group col-md-6 form-group-client-policy-master">
|
||||||
<label for="totalSumInsured" class=" " style="width: 400px;">Total Sum Insured</label>
|
<label for="totalSumInsured" class=" " style="width: 400px;">Total Sum Insured</label>
|
||||||
@ -393,11 +393,9 @@
|
|||||||
$('#gpa_policy_id').val(policy_id);
|
$('#gpa_policy_id').val(policy_id);
|
||||||
|
|
||||||
var client_id = $('#Client_id').val();
|
var client_id = $('#Client_id').val();
|
||||||
console.log('client_id :' ,client_id);
|
$('#gpa_client_policy_id').val(client_id);
|
||||||
$('#client_policy_id').val(client_id);
|
|
||||||
|
|
||||||
var policy_type_id = $(this).attr('id');
|
var policy_type_id = $(this).attr('id');
|
||||||
console.log('policy_type_id', policy_type_id)
|
|
||||||
|
|
||||||
if(policy_type_id == '1'){
|
if(policy_type_id == '1'){
|
||||||
|
|
||||||
@ -413,9 +411,12 @@
|
|||||||
data: { policy_id : policy_id , client_id: client_id},
|
data: { policy_id : policy_id , client_id: client_id},
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
$('#nameOfThePolicyInGPA').html(' - ' + res.policy_name.name);
|
||||||
|
|
||||||
if(res.count){
|
if(res.count){
|
||||||
|
|
||||||
$('emp_count').val(res.count)
|
$('#emp_count').val(res.count)
|
||||||
if(res.count === false){
|
if(res.count === false){
|
||||||
$("#btnGPATermsSubmit").prop("disabled", true);
|
$("#btnGPATermsSubmit").prop("disabled", true);
|
||||||
}else{
|
}else{
|
||||||
@ -427,7 +428,7 @@
|
|||||||
if (res) {
|
if (res) {
|
||||||
|
|
||||||
let jsonObject = JSON.parse(res.data);
|
let jsonObject = JSON.parse(res.data);
|
||||||
|
$("#numberToWord").text(convertNumberToWords(jsonObject.sumInsured2));
|
||||||
if(jsonObject.compassionateVisitExpenses == '1'){
|
if(jsonObject.compassionateVisitExpenses == '1'){
|
||||||
var element = $('input[name="compassionateVisitExpenses"]').parent().parent().next()[0];
|
var element = $('input[name="compassionateVisitExpenses"]').parent().parent().next()[0];
|
||||||
$(element).css("display", "");
|
$(element).css("display", "");
|
||||||
@ -501,7 +502,7 @@
|
|||||||
$("#sumInsured2").on("keyup", function() {
|
$("#sumInsured2").on("keyup", function() {
|
||||||
var inputNumber = parseInt($(this).val());
|
var inputNumber = parseInt($(this).val());
|
||||||
if (!isNaN(inputNumber)) {
|
if (!isNaN(inputNumber)) {
|
||||||
var result = convertToIndianNumberingSystem(inputNumber);
|
var result = convertNumberToWords(inputNumber);
|
||||||
$("#numberToWord").text(result);
|
$("#numberToWord").text(result);
|
||||||
} else {
|
} else {
|
||||||
$("#numberToWord").text("");
|
$("#numberToWord").text("");
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<!-- Modal content for the Large example -->
|
<!-- Modal content for the Large example -->
|
||||||
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" aria-modal="true" data-backdrop="static">
|
||||||
<div class="modal-dialog modal-full-width">
|
<div class="modal-dialog modal-full-width">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title" id="myLargeModalLabel">Policy Premium </h4>
|
<h4 class="modal-title" id="myLargeModalLabel">Policy Premium <span id="nameOfThePolicy"></span></h4>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
@ -40,22 +40,22 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var policy_grid_id = $('#client_id').val();
|
var policy_grid_id = $('#client_id').val();
|
||||||
var grid_html = '';
|
var grid_html = '';
|
||||||
|
|
||||||
$('#gmc_remove').hide();
|
$('#gmc_remove').hide();
|
||||||
$('#btnGridSubmit').hide();
|
$('#btnGridSubmit').hide();
|
||||||
|
|
||||||
$('.close').click(function(){
|
$('.close').click(function(){
|
||||||
|
|
||||||
for (var i = 1; i <= 11; i++) {
|
for (var i = 1; i <= 11; i++) {
|
||||||
$('#grid_' + i).remove();
|
$('#grid_' + i).remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function addGridHTML(event = false, data = false, ui_type = false){
|
function addGridHTML(event = false, data = false, ui_type = false){
|
||||||
|
|
||||||
var grid_container = document.getElementById('grid_content_input');
|
var grid_container = document.getElementById('grid_content_input');
|
||||||
var dataIdValue = ''
|
var dataIdValue = ''
|
||||||
@ -135,8 +135,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="gpa_premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="gpa_premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0, 3)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0, 3)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(3)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(3)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -167,8 +167,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,4)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,4)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(4)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(4)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
@ -199,8 +199,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,5)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,5)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(5)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(5)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -231,8 +231,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,6)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,6)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(6)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(6)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
@ -263,8 +263,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,7)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,7)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(7)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(7)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -292,8 +292,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,8)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,8)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(8)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(8)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -319,8 +319,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,9)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,9)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(9)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(9)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -350,8 +350,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,10)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,10)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(10)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(10)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -381,8 +381,8 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.max_si : ''}" type="text" class="form-control" placeholder="Enter Max SI" name="max_si[]" id="max_si" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.max_si : ''}" type="text" class="form-control" placeholder="Enter Max SI" name="max_si[]" id="max_si" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,11)">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(0,11)">x</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(11)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(11)">+</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -421,16 +421,16 @@ function addGridHTML(event = false, data = false, ui_type = false){
|
|||||||
$('#si_or_bp').val("2");
|
$('#si_or_bp').val("2");
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$("#GridForm").submit(function(event) {
|
$("#GridForm").submit(function(event) {
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
console.log($('#grid_emp_count').val());
|
console.log($('#grid_emp_count').val());
|
||||||
|
|
||||||
if($('#grid_emp_count').val() == false){
|
if($('#grid_emp_count').val() == 'true'){
|
||||||
console.log('test')
|
console.log('test')
|
||||||
toastr.warning('Client has active employees', 'Warning');
|
toastr.warning('Client has active employees', 'Warning');
|
||||||
return;
|
return;
|
||||||
@ -442,6 +442,9 @@ $("#GridForm").submit(function(event) {
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('.loader').fadeIn();
|
||||||
|
$('.loader-mask').fadeIn();
|
||||||
|
|
||||||
var formData = new FormData($('#GridForm')[0]);
|
var formData = new FormData($('#GridForm')[0]);
|
||||||
var policy_form_action = '<?= base_url("client/premimum/create") ?>';
|
var policy_form_action = '<?= base_url("client/premimum/create") ?>';
|
||||||
|
|
||||||
@ -454,29 +457,34 @@ $("#GridForm").submit(function(event) {
|
|||||||
contentType: false,
|
contentType: false,
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
|
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
if (res.status === false) {
|
if (res.status === false) {
|
||||||
toastr.error('Policy Dose Not Create', 'Error');
|
toastr.error('Policy Dose Not Create', 'Error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(res);
|
setTimeout(function() {
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
var message = (policy_PrimaryKey === '') ? 'Policy Premium Added successfully' : 'Policy Premium Added Successfully';
|
var message = (policy_PrimaryKey === '') ? 'Policy Premium Added successfully' : 'Policy Premium Added Successfully';
|
||||||
toastr.success(message, 'Success');
|
toastr.success(message, 'Success');
|
||||||
$('.close').click();
|
$('.close').click();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('body').on('click', '.btnPolicyModel', function () {
|
$('body').on('click', '.btnPolicyModel', function () {
|
||||||
|
|
||||||
|
|
||||||
var policy_id = $(this).data('id');
|
var policy_id = $(this).data('id');
|
||||||
console.log('policy_id :' ,policy_id);
|
|
||||||
var client_id = $('#Client_id').val();
|
var client_id = $('#Client_id').val();
|
||||||
$('#client_policy_id').val(policy_id);
|
$('#client_policy_id').val(policy_id);
|
||||||
|
|
||||||
@ -486,8 +494,9 @@ $('body').on('click', '.btnPolicyModel', function () {
|
|||||||
data: { policy_id: policy_id, client_id: client_id },
|
data: { policy_id: policy_id, client_id: client_id },
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('responce :', res);
|
|
||||||
|
|
||||||
|
console.log('responce :', res);
|
||||||
|
$('#nameOfThePolicy').html(' - ' + res.policy_name);
|
||||||
$('#grid_emp_count').val(res.count);
|
$('#grid_emp_count').val(res.count);
|
||||||
|
|
||||||
if (res.status === false) {
|
if (res.status === false) {
|
||||||
@ -514,7 +523,6 @@ $('body').on('click', '.btnPolicyModel', function () {
|
|||||||
addGridHTML(false, res.premiumData[0], res.premiumData[0].policy_grid_id);
|
addGridHTML(false, res.premiumData[0], res.premiumData[0].policy_grid_id);
|
||||||
|
|
||||||
res.premiumData.shift();
|
res.premiumData.shift();
|
||||||
console.log(res.premiumData)
|
|
||||||
$.each(res.premiumData, function(index, item){
|
$.each(res.premiumData, function(index, item){
|
||||||
console.log('premiumData index :',index)
|
console.log('premiumData index :',index)
|
||||||
appendGridtHtml(item.policy_grid_id, item);
|
appendGridtHtml(item.policy_grid_id, item);
|
||||||
@ -531,11 +539,11 @@ $('body').on('click', '.btnPolicyModel', function () {
|
|||||||
console.error(status, error);
|
console.error(status, error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var Count = 1
|
var Count = 1
|
||||||
function appendGridtHtml(ui_type = false, data = false,) {
|
function appendGridtHtml(ui_type = false, data = false,) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
console.log('appendGridtHtml function called ');
|
console.log('appendGridtHtml function called ');
|
||||||
@ -557,8 +565,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="gpa_premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="gpa_premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml(3)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml(3)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@ -581,8 +589,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml(4)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml(4)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -608,8 +616,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml(5)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more_${Count}" onclick="appendGridtHtml(5)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -635,8 +643,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(6)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(6)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
@ -662,8 +670,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(7)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(7)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -684,8 +692,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(8)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(8)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -706,8 +714,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(9)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(9)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -732,8 +740,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.premium : ''}" type="text" class="form-control" placeholder="Enter Premium" name="premium[]" id="premium" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(10)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(10)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
@ -758,8 +766,8 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
<input value="${data !== false && data !== undefined && data !== '' ? data.max_si : ''}" type="text" class="form-control" placeholder="Enter Max SI" name="max_si" id="max_si[]" required>
|
<input value="${data !== false && data !== undefined && data !== '' ? data.max_si : ''}" type="text" class="form-control" placeholder="Enter Max SI" name="max_si" id="max_si[]" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(11)">+</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-primary" id="gmc_add_more" onclick="appendGridtHtml(11)">+</button>
|
||||||
<button style="margin-top: 29px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
<button style="margin-top: 44px;" type="button" class="btn btn-danger" id="gmc_remove" onclick="removebutton(${Count})">x</button>
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
@ -777,9 +785,9 @@ function appendGridtHtml(ui_type = false, data = false,) {
|
|||||||
Count++
|
Count++
|
||||||
// console.log('count 3',Count)
|
// console.log('count 3',Count)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function removebutton(index, type) {
|
function removebutton(index, type) {
|
||||||
|
|
||||||
if(index == 0){
|
if(index == 0){
|
||||||
var inputs = document.querySelectorAll('#grid_'+ type +' input');
|
var inputs = document.querySelectorAll('#grid_'+ type +' input');
|
||||||
@ -804,7 +812,7 @@ function removebutton(index, type) {
|
|||||||
$('#gmc_add_more_'+index).show();
|
$('#gmc_add_more_'+index).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user