FIX_KYC_AND_POLICY_MASTER_REDIRECT : RV
This commit is contained in:
parent
c32e2a6c13
commit
17c8f1558f
@ -324,6 +324,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
|
|
||||||
function removeKYCDocs(element) {
|
function removeKYCDocs(element) {
|
||||||
|
var kyc_docs_id_for_reload = $('#kyc_type_id').val();
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/kyc/kycdocs/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/kyc/kycdocs/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -338,7 +339,8 @@ $(document).ready(function () {
|
|||||||
if (res.status == true) {
|
if (res.status == true) {
|
||||||
toastr.success('Remove Done!', 'success');
|
toastr.success('Remove Done!', 'success');
|
||||||
|
|
||||||
location.reload();
|
// location.reload();
|
||||||
|
window.location.href = '<?= base_url("master/kyc/list/") ?>' + kyc_docs_id_for_reload;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Remove Not Done!', 'warning');
|
||||||
|
|||||||
@ -340,57 +340,58 @@ $(document).ready(function () {
|
|||||||
function loadPoliciesList() {
|
function loadPoliciesList() {
|
||||||
var base_url = '<?= base_url("master/policy/policies/list/"); ?>';
|
var base_url = '<?= base_url("master/policy/policies/list/"); ?>';
|
||||||
|
|
||||||
var insurer_branch_action = base_url + policy_type_PrimaryKey;
|
var insurer_branch_action = base_url + policy_type_PrimaryKey;
|
||||||
|
|
||||||
if ($('#policy_type_id').val() != '') {
|
if ($('#policy_type_id').val() != '') {
|
||||||
|
|
||||||
$('.loader').fadeIn();
|
$('.loader').fadeIn();
|
||||||
$('.loader-mask').fadeIn();
|
$('.loader-mask').fadeIn();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: insurer_branch_action,
|
url: insurer_branch_action,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
|
||||||
console.log("response", response);
|
console.log("response", response);
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
var branchTable = '';
|
var branchTable = '';
|
||||||
$.each(response.policies, function(index, item) {
|
$.each(response.policies, function(index, item) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
branchTable += `
|
branchTable += `
|
||||||
<tr>
|
<tr>
|
||||||
<td value=''>${item.insurer.name}</td>
|
<td value=''>${item.insurer.name}</td>
|
||||||
<td>${item.policy.name}</td>
|
<td>${item.policy.name}</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="btnBranchEdit" data-id="${item.policy.id}"><i data-id="${item.policy.id}" class="mdi mdi-lead-pencil btnBranchEdit" style="font-size:18px;"></i></a>
|
<a class="btnBranchEdit" data-id="${item.policy.id}"><i data-id="${item.policy.id}" class="mdi mdi-lead-pencil btnBranchEdit" style="font-size:18px;"></i></a>
|
||||||
<a style="color:#02a8b5" data-id="${item.id}" onclick="removePolicies(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
|
<a style="color:#02a8b5" data-id="${item.id}" onclick="removePolicies(this)"><i data-id="${item.id}" class="mdi mdi-delete" style="font-size:18px;"></i></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
$('#policies_list').append(branchTable);
|
$('#policies_list').append(branchTable);
|
||||||
},
|
},
|
||||||
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);
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').delay(350).fadeOut('slow');
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
toastr.warning('Something Wrong!', 'warning');
|
toastr.warning('Something Wrong!', 'warning');
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function removePolicies(element) {
|
function removePolicies(element) {
|
||||||
|
var policy_id_for_reload = $('#policy_type_id').val()
|
||||||
var id = element.getAttribute('data-id');
|
var id = element.getAttribute('data-id');
|
||||||
var form_action = '<?= base_url("master/policy/policies/remove/") ?>' + id;
|
var form_action = '<?= base_url("master/policy/policies/remove/") ?>' + id;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -407,7 +408,8 @@ function removePolicies(element) {
|
|||||||
|
|
||||||
// $('#branch_table').empty();
|
// $('#branch_table').empty();
|
||||||
|
|
||||||
location.reload();
|
// location.reload();
|
||||||
|
window.location.href = '<?= base_url("master/policy/list/") ?>' + policy_id_for_reload;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastr.warning('Remove Not Done!', 'warning');
|
toastr.warning('Remove Not Done!', 'warning');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user