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) {
|
||||
var kyc_docs_id_for_reload = $('#kyc_type_id').val();
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/kyc/kycdocs/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
@ -338,7 +339,8 @@ $(document).ready(function () {
|
||||
if (res.status == true) {
|
||||
toastr.success('Remove Done!', 'success');
|
||||
|
||||
location.reload();
|
||||
// location.reload();
|
||||
window.location.href = '<?= base_url("master/kyc/list/") ?>' + kyc_docs_id_for_reload;
|
||||
|
||||
} else {
|
||||
toastr.warning('Remove Not Done!', 'warning');
|
||||
|
||||
@ -340,57 +340,58 @@ $(document).ready(function () {
|
||||
function loadPoliciesList() {
|
||||
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() != '') {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: insurer_branch_action,
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
if ($('#policy_type_id').val() != '') {
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: insurer_branch_action,
|
||||
type: 'GET',
|
||||
success: function(response) {
|
||||
|
||||
console.log("response", response);
|
||||
console.log("response", response);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var branchTable = '';
|
||||
$.each(response.policies, function(index, item) {
|
||||
console.log(item);
|
||||
branchTable += `
|
||||
<tr>
|
||||
<td value=''>${item.insurer.name}</td>
|
||||
<td>${item.policy.name}</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 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>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
$('#policies_list').append(branchTable);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
console.error(status, error);
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
}, 1000);
|
||||
var branchTable = '';
|
||||
$.each(response.policies, function(index, item) {
|
||||
console.log(item);
|
||||
branchTable += `
|
||||
<tr>
|
||||
<td value=''>${item.insurer.name}</td>
|
||||
<td>${item.policy.name}</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 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>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
$('#policies_list').append(branchTable);
|
||||
},
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
setTimeout(function() {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').delay(350).fadeOut('slow');
|
||||
toastr.warning('Something Wrong!', 'warning');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
function removePolicies(element) {
|
||||
var policy_id_for_reload = $('#policy_type_id').val()
|
||||
var id = element.getAttribute('data-id');
|
||||
var form_action = '<?= base_url("master/policy/policies/remove/") ?>' + id;
|
||||
$.ajax({
|
||||
@ -407,7 +408,8 @@ function removePolicies(element) {
|
||||
|
||||
// $('#branch_table').empty();
|
||||
|
||||
location.reload();
|
||||
// location.reload();
|
||||
window.location.href = '<?= base_url("master/policy/list/") ?>' + policy_id_for_reload;
|
||||
|
||||
} else {
|
||||
toastr.warning('Remove Not Done!', 'warning');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user