$(document).ready(function () { $('.life-claim-form').parsley(); $('.life-claim-form').on('submit', function (e) { e.preventDefault(); var form = $(this); $.ajax({ type: "POST", url: "ajax/claims.php?request=life_claim", data: new FormData(this), dataType: 'JSON', processData: false, cache: false, contentType: false, beforeSend: function () { $('.btn').attr("disabled", true).html('Processing'); }, success: function (response) { if (response.status == 1) { swal.fire({ title: '
Thank you for providing us with details of your claim. One of our agents will contact you ' +
'shortly to guide you through the next process. ' +
'
' +
'For inquires or assistance you can contact us with the following mobile number: (+254) 70991277, O20 286 2000. ' +
'Or send an email to claims@apalife.co.ke' +
'
' + response.message + '
', type: 'error', allowOutsideClick: false, showCloseButton: true, focusConfirm: false, confirmButtonText: 'Ok!' }); } $('.btn').attr("disabled", false).html('INITIATE CLAIM'); } }); }); $('.life-group-claim-form').parsley(); $('.life-group-claim-form').on('submit', function (e) { e.preventDefault(); var form = $(this); $.ajax({ type: "POST", url: "ajax/claims.php?request=life_group_claim", data: new FormData(this), dataType: 'JSON', processData: false, cache: false, contentType: false, beforeSend: function () { $('.btn').attr("disabled", true).html('Processing'); }, success: function (response) { if (response.status == 1) { swal.fire({ title: 'Thank you for providing us with details of your claim. One of our agents will contact you ' +
'shortly to guide you through the next process. ' +
'
' +
'For inquires or assistance you can contact us with the following mobile number: (+254) 70991277, O20 286 2000. ' +
'Or send an email to claims@apalife.co.ke' +
'
' + response.message + '
', type: 'error', allowOutsideClick: false, showCloseButton: true, focusConfirm: false, confirmButtonText: 'Ok!' }); } $('.btn').attr("disabled", false).html('INITIATE CLAIM'); } }); }); $('.life-personal-property-claim-form').parsley(); $('.life-personal-property-claim-form').on('submit', function (e) { e.preventDefault(); var form = $(this); $.ajax({ type: "POST", url: "ajax/claims.php?request=life_personal_property_claim", data: new FormData(this), dataType: 'JSON', processData: false, cache: false, contentType: false, beforeSend: function () { $('.btn').attr("disabled", true).html('Processing'); }, success: function (response) { if (response.status == '1') { swal.fire({ title: 'Thank you for providing us with details of your claim. One of our agents will contact you ' +
'shortly to guide you through the next process. ' +
'
' +
'For inquires or assistance you can contact us with the following mobile number: (+254) 70991277, O20 286 2000. ' +
'Or send an email to claims@apalife.co.ke' +
'
' + response.message + '
', type: 'error', allowOutsideClick: false, showCloseButton: true, focusConfirm: false, confirmButtonText: 'Ok!' }); } $('.btn').attr("disabled", false).html('INITIATE CLAIM'); } }); }); $('.form').parsley(); $('.form').on('submit', function (e) { e.preventDefault(); var form = $(this); var pdf = $(this).find('input[name="claim_type"]').val(); if (pdf == 'windscreen') { //motor claims var claim_form = 'pdf/claim/Windscreen CLM_FRM.pdf'; } else if (pdf == 'accident') { var claim_form = 'pdf/claim/motor_claim_form.pdf'; } else if (pdf == 'theft') { var claim_form = 'pdf/claim/motor_claim_form.pdf'; } //personal life claims else if (pdf == 'hospital cash') { var claim_form = 'pdf/claim/Hosicare- claim form.pdf'; } else if (pdf == 'last expense') { var claim_form = 'pdf/claim/APA LIFE - Last expense claim form -2019.pdf'; } else if (pdf == 'critical illness') { var claim_form = 'pdf/claim/Critical Ilness Claim form.pdf'; `` } else if (pdf == 'death') { var claim_form = 'pdf/claim/Pumzisha Claim form.pdf'; } else if (pdf == 'maturity') { var claim_form = ''; } else if (pdf == 'partial maturity') { var claim_form = ''; } //personal and property claim else if (pdf == 'property damage') { var claim_form = 'pdf/claim/PROPERTY DAMAGE CLAIM FORM.pdf'; } else if (pdf == 'wiba') { var claim_form = 'pdf/claim/WIBA CLAIM FORM.pdf'; } else if (pdf == 'personal accident') { var claim_form = 'pdf/claim/GPA CLAIM FORM.pdf'; } //group life claims else if (pdf == 'group life last expense') { var claim_form = 'pdf/claim/APA LIFE - Last expense claim form -2019.pdf'; } else if (pdf == 'group life critical illness') { var claim_form = 'pdf/claim/Critical Ilness Claim form.pdf'; } else if (pdf == 'group life benefit') { var claim_form = ''; } else if (pdf == 'group life hospital cash') { var claim_form = 'pdf/claim/Hosicare- claim form.pdf'; } else if (pdf == 'group life total permanent disablility') { var claim_form = ''; } else if (pdf == 'group life occupational') { var claim_form = ''; } else if (pdf == 'group life credit') { var claim_form = ''; } //agriculture else if (pdf == 'livestock') { var claim_form = 'pdf/claim/LIVESTOCK INSURANCE CLAIM FORM.pdf'; } else if (pdf == 'crop') { var claim_form = ''; } else { var claim_form = ''; } //sweet alert content var claim_type = $('input[name=claim_type]').val(); switch (claim_type) { //personal life claims case 'hospital cash': var sweet_alert = 'Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please attach the following document:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please attach the following document:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation:' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
To help us process your claim faster, please download and complete the claim form and prepare the following documentation: ' +
'
Thank you for providing us with details of your claim. One of our agents will contact you shortly to guide you through the process.
',
showCloseButton: true,
showCancelButton: false,
allowOutsideClick: false,
focusConfirm: false,
confirmButtonText: ' Ok!',
confirmButtonAriaLabel: 'Thumbs up, great!',
});
} else if (response.status == 0) {
Swal.fire({
type: 'error',
title: response.message,
//text: 'Something went wrong!',
})
} else {
Swal.fire({
type: 'error',
title: 'An error occurred!',
//text: 'Something went wrong!',
})
}
form.find('button[name=request_upload]').attr('disabled', true).html('INITIATE CLAIM');
$('button[name=request_upload]').attr('disabled', false);
}
});
})
$('.agriculture-claim-form').parsley();
$('.agriculture-claim-form').on('submit', function (e) {
e.preventDefault();
var form = $(this);
$.ajax({
type: "POST",
url: "ajax/claims.php?request=agriculture_claim",
data: new FormData(this),
dataType: 'JSON',
processData: false,
cache: false,
contentType: false,
beforeSend: function () {
$('.btn').attr("disabled", true).html('Processing');
},
success: function (response) {
if (response.status == '1') {
swal.fire({
title: '
Thank you for providing us with details of your claim. One of our agents will contact you ' +
'shortly to guide you through the next process. ' +
'
' +
'For inquires or assistance you can contact us with the following mobile number: (+254) 70991277, O20 286 2000. ' +
'Or send an email to claims@apalife.co.ke' +
'
' + response.message + '
', type: 'error', allowOutsideClick: false, showCloseButton: true, focusConfirm: false, confirmButtonText: 'Ok!' }); } $('.btn').attr("disabled", false).html('INITIATE CLAIM'); } }); }); });