1368 lines
56 KiB
PHP
Executable File
1368 lines
56 KiB
PHP
Executable File
|
|
<script>
|
|
function isFutureDate(data){
|
|
var year = new Date().getFullYear();
|
|
if(data > year)
|
|
{
|
|
$(".yearError").html("<div class='alert alert-danger'> Please enter a valid year.</div>");
|
|
$('.educationSubmitBtn').attr("disabled", true);
|
|
}else{
|
|
$(".yearError").html("");
|
|
$('.educationSubmitBtn').attr("disabled", false);
|
|
}
|
|
}
|
|
$('#listOfService').select2();
|
|
$('#primary_langualge').select2();
|
|
$('#boros').select2();
|
|
//$('#availability').select2();
|
|
$( document ).ready(function() {
|
|
$(".activate_depending").click(function(){
|
|
var target_val = $(this).val();
|
|
var open_value = $(this).attr("open_value");
|
|
var change_required_to = $(this).attr("change_required_to");
|
|
var required_field = $(this).attr("required_field");
|
|
//alert(change_required_to);
|
|
if (target_val == open_value)
|
|
{
|
|
$("#"+change_required_to).show();
|
|
$("#"+required_field).attr("required","required");
|
|
}
|
|
else
|
|
{
|
|
$("#"+change_required_to).hide();
|
|
$("#"+required_field).removeAttr("required");
|
|
}
|
|
checkBasicCheckList();
|
|
});
|
|
$('.criminal_convictions').click(function(){
|
|
var inputValue = $(this).attr("value");
|
|
if(inputValue == true)
|
|
{
|
|
$("#criminal_convictions_details").show();
|
|
//$("#criminalConvictionsDetailsField").attr("required","required");
|
|
$("#criminalConvictionsDetailsField").attr("required", "true");
|
|
}
|
|
else{
|
|
$("#criminal_convictions_details").hide();
|
|
$("#criminalConvictionsDetailsField").removeAttr("required");
|
|
}
|
|
checkBasicCheckList();
|
|
});
|
|
//$("#injuryDetails").hide();
|
|
$('.injury').click(function(){
|
|
var inputValue = $(this).attr("value");
|
|
if(inputValue == true)
|
|
{
|
|
$("#injuryDetails").show();
|
|
$("#injuryDetailsField").attr("required","required");
|
|
}
|
|
else{
|
|
$("#injuryDetails").hide();
|
|
$("#injuryDetailsField").removeAttr("required");
|
|
}
|
|
checkBasicCheckList();
|
|
});
|
|
//$("#physicaldefectsDetails").hide();
|
|
$('.physicaldefects').click(function(){
|
|
var inputValue = $(this).attr("value");
|
|
if(inputValue == true)
|
|
{
|
|
$("#physicaldefectsDetails").show();
|
|
$("#physicaldefectsDetailsField").attr("required","required");
|
|
}
|
|
else{
|
|
$("#physicaldefectsDetails").hide();
|
|
$("#physicaldefectsDetailsField").removeAttr("required");
|
|
}
|
|
checkBasicCheckList();
|
|
});
|
|
//$("#hearingdefectsDetails").hide();
|
|
$('.hearingdefects').click(function(){
|
|
var inputValue = $(this).attr("value");
|
|
if(inputValue == true)
|
|
{
|
|
$("#hearingdefectsDetails").show();
|
|
$("#hearingdefectsDetailsField").attr("required","required");
|
|
}
|
|
else{
|
|
$("#hearingdefectsDetails").hide();
|
|
$("#hearingdefectsDetailsField").removeAttr("required");
|
|
}
|
|
checkBasicCheckList();
|
|
});
|
|
//$("#visiondefectsDetails").hide();
|
|
$('.visiondefects').click(function(){
|
|
var inputValue = $(this).attr("value");
|
|
if(inputValue == true)
|
|
{
|
|
$("#visiondefectsDetails").show();
|
|
$("#visiondefectsDetailsField").attr("required","required");
|
|
}
|
|
else{
|
|
$("#visiondefectsDetails").hide();
|
|
$("#visiondefectsDetailsField").removeAttr("required");
|
|
}
|
|
checkBasicCheckList();
|
|
});
|
|
//$("#speechdefectsDetails").hide();
|
|
$('.speechdefects').click(function(){
|
|
var inputValue = $(this).attr("value");
|
|
if(inputValue == true)
|
|
{
|
|
$("#speechdefectsDetails").show();
|
|
$("#speechdefectsDetailsField").attr("required","required");
|
|
}
|
|
else{
|
|
$("#speechdefectsDetails").hide();
|
|
$("#speechdefectsDetailsField").removeAttr("required");
|
|
}
|
|
checkBasicCheckList();
|
|
});
|
|
checkBasicCheckList();
|
|
getExperienceDetails();
|
|
});
|
|
function checkBasicCheckList(){
|
|
var citizen=$('input[name=citizen]:checked').val();
|
|
var remain_permanently=$('input[name=remain_permanently]:checked').val();
|
|
var authorization_to_work=$('input[name=authorization_to_work]:checked').val();
|
|
|
|
if((citizen==true) || (remain_permanently==true) || (authorization_to_work==true)){
|
|
$("#basic_submit_btn").removeAttr('disabled');
|
|
}else{
|
|
$('#basic_submit_btn').prop("disabled", true);
|
|
}
|
|
|
|
}
|
|
$("#other_reg_number").keyup(function(){
|
|
var raw_text = $(this).val();
|
|
var return_text = raw_text.replace(/[^a-zA-Z0-9 _]/g,'');
|
|
$(this).val(return_text);
|
|
});
|
|
$("#driving_lic_no").keyup(function(){
|
|
var raw_text = $(this).val();
|
|
var return_text = raw_text.replace(/[^a-zA-Z0-9 _]/g,'');
|
|
$(this).val(return_text);
|
|
});
|
|
$("#uscis").keyup(function(){
|
|
var raw_text = $(this).val();
|
|
var return_text = raw_text.replace(/[^a-zA-Z0-9 _]/g,'');
|
|
$(this).val(return_text);
|
|
});
|
|
//$('#years_of_exp').on('change', function() {
|
|
function getExperienceDetails() {
|
|
var YearExperience = $('#years_of_exp').val();
|
|
var caregiver_type=$("input[name=qualification_type]:checked").val();
|
|
var CargiverId=<?php echo $nurse->caregiver_table_id; ?>;
|
|
// alert(caregiver_type);
|
|
// alert(CargiverId);
|
|
if(caregiver_type>0 && YearExperience>0){
|
|
$(".experienceLabel").removeClass("hide");
|
|
$.ajax({
|
|
url:"<?php echo base_url(); ?>CaregiversDashboard/getExperienceDetails",
|
|
type:"GET",
|
|
data:{caregiver_type:caregiver_type,CargiverId:CargiverId,YearExperience:YearExperience},
|
|
dataType: "html",
|
|
success:function(data){
|
|
$("#experience_details").html(data);
|
|
}
|
|
});
|
|
$('.ExpDtl').show();
|
|
}else{
|
|
$(".experienceLabel").addClass("hide");
|
|
$('.ExpDtl').hide();
|
|
}
|
|
}
|
|
//});
|
|
$("#same_emergency").click(function(){
|
|
if($(this).is(":checked")){
|
|
var address1=$("#address1").val();
|
|
var state1=$("#state1").val();
|
|
var county1=$("#county1").val();
|
|
var city1=$("#city1").val();
|
|
var zipcode1=$("#zipcode1").val();
|
|
var check_p_address=$("#check_p_address").val();
|
|
if(address1!="" && check_p_address=='checked'){
|
|
$("#address2").val(address1);
|
|
$("#state2").val(county1);
|
|
$("#county2").val(state1);
|
|
$("#city2").val(city1);
|
|
$("#zipcode2").val(zipcode1);
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Please check parmanent address.',
|
|
showConfirmButton: false,
|
|
timer: 1500
|
|
});
|
|
$(this).prop('checked', false);
|
|
}
|
|
}
|
|
});
|
|
$("#same_emergency2").click(function(){
|
|
if($(this).is(":checked")){
|
|
var address1=$("#address1").val();
|
|
var state1=$("#state1").val();
|
|
var county1=$("#county1").val();
|
|
var city1=$("#city1").val();
|
|
var zipcode1=$("#zipcode1").val();
|
|
var check_p_address=$("#check_p_address").val();
|
|
if(address1!="" && check_p_address=='checked'){
|
|
$("#Emergency_Contact_Address1").val(address1);
|
|
$("#Emergency_Contact_Country1").val(county1);
|
|
$("#Emergency_Contact_State1").val(state1);
|
|
$("#Emergency_Contact_City1").val(city1);
|
|
$("#Emergency_Contact_zipcode1").val(zipcode1);
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Please check parmanent address.',
|
|
showConfirmButton: false,
|
|
timer: 1500
|
|
});
|
|
$(this).prop('checked', false);
|
|
}
|
|
}
|
|
});
|
|
$("#same_emergency1").click(function(){
|
|
if($(this).is(":checked")){
|
|
var address1=$("#address1").val();
|
|
var state1=$("#state1").val();
|
|
var county1=$("#county1").val();
|
|
var city1=$("#city1").val();
|
|
var zipcode1=$("#zipcode1").val();
|
|
var check_p_address=$("#check_p_address").val();
|
|
if(address1!="" && check_p_address=='checked'){
|
|
$("#Emergency_Contact_Address").val(address1);
|
|
$("#Emergency_Contact_Country").val(county1);
|
|
$("#Emergency_Contact_State").val(state1);
|
|
$("#Emergency_Contact_City").val(city1);
|
|
$("#Emergency_Contact_zipcode").val(zipcode1);
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Please check parmanent address.',
|
|
showConfirmButton: false,
|
|
timer: 1500
|
|
});
|
|
$(this).prop('checked', false);
|
|
}
|
|
}
|
|
});
|
|
$( document ).ready(function() {
|
|
checkNone();
|
|
getExperienceDetails();
|
|
});
|
|
function checkNone(headId){
|
|
if($("#NoneExp_"+headId).is(":checked")){
|
|
$(".NoneExp_"+headId).hide();
|
|
}else{
|
|
$(".NoneExp_"+headId).show();
|
|
}
|
|
}
|
|
|
|
function check_emergency_address_loader(){
|
|
//alert();
|
|
var address=$('#Emergency_Contact_Address').val();
|
|
var zipcode=$('#Emergency_Contact_zipcode').val();
|
|
if(address!="" && zipcode!=""){
|
|
$.ajax({
|
|
url:"caregivers/checkEmergencyAddress",
|
|
type:"GET",
|
|
data:{address:address,zipcode:zipcode},
|
|
dataType: "json",
|
|
beforeSend: function() {
|
|
$("#check_emg_address_btn").hide();
|
|
$("#check_emg_address_loader").show();
|
|
},
|
|
success:function(data){
|
|
|
|
if(data.address_info.status_code=="200"){
|
|
$('#Emergency_Contact_State').val(data.address_info.address.state);
|
|
$('#Emergency_Contact_Country').val(data.address_info.address.county);
|
|
$('#Emergency_Contact_City').val(data.address_info.address.city);
|
|
$('#Emergency_Contact_City_lang2').val(data.geo_info.latlong.Latitude);
|
|
$('#Emergency_Contact_City_long2').val(data.geo_info.latlong.Longitude);
|
|
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'address not found.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('address not found.');
|
|
}
|
|
$("#check_emg_address_btn").show();
|
|
$("#check_emg_address_loader").hide();
|
|
}
|
|
});
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Enter street address and zipcode.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('Enter street address and zipcode.');
|
|
}
|
|
}
|
|
function check_emergency_address_loader1(){
|
|
//alert();
|
|
var address=$('#Emergency_Contact_Address1').val();
|
|
var zipcode=$('#Emergency_Contact_zipcode1').val();
|
|
if(address!="" && zipcode!=""){
|
|
$.ajax({
|
|
url:"caregivers/checkEmergencyAddress",
|
|
type:"GET",
|
|
data:{address:address,zipcode:zipcode},
|
|
dataType: "json",
|
|
beforeSend: function() {
|
|
$("#check_emg_address_btn1").hide();
|
|
$("#check_emg_address_loader1").show();
|
|
},
|
|
success:function(data){
|
|
//console.log(data);
|
|
if(data.address_info.status_code=="200"){
|
|
$('#Emergency_Contact_State1').val(data.address_info.address.state);
|
|
$('#Emergency_Contact_Country1').val(data.address_info.address.county);
|
|
$('#Emergency_Contact_City1').val(data.address_info.address.city);
|
|
$('#Emergency_Contact_City_lang1').val(data.geo_info.latlong.Latitude);
|
|
$('#Emergency_Contact_City_long1').val(data.geo_info.latlong.Longitude);
|
|
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'address not found.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('address not found.');
|
|
}
|
|
$("#check_emg_address_btn1").show();
|
|
$("#check_emg_address_loader1").hide();
|
|
}
|
|
});
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Enter street address and zipcode.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('Enter street address and zipcode.');
|
|
}
|
|
}
|
|
function validateExp(id) {
|
|
//alert(id);
|
|
if($('#experience_id_'+id).prop('checked')){
|
|
$('#exp_label_'+id+'_0').prop('required',true);
|
|
// if(type == 'None'){
|
|
// $('#exp_label_'+id+'_0').prop('checked', true);
|
|
// }
|
|
}else{
|
|
$('#exp_label_'+id+'_0').removeAttr('required');
|
|
$('#exp_label_'+id+'_0').prop('checked', false);
|
|
$('#exp_label_'+id+'_1').prop('checked', false);
|
|
$('#exp_label_'+id+'_2').prop('checked', false);
|
|
$('#exp_label_'+id+'_3').prop('checked', false);
|
|
}
|
|
}
|
|
|
|
function validateForm() {
|
|
var address1 = document.forms["caregiverBasicForm"]["address1"].value;
|
|
var state1 = document.forms["caregiverBasicForm"]["state1"].value;
|
|
var county1 = document.forms["caregiverBasicForm"]["county1"].value;
|
|
var city1 = document.forms["caregiverBasicForm"]["city1"].value;
|
|
var zipcode1 = document.forms["caregiverBasicForm"]["zipcode1"].value;
|
|
var address2 = document.forms["caregiverBasicForm"]["address2"].value;
|
|
var zipcode2 = document.forms["caregiverBasicForm"]["zipcode2"].value;
|
|
var county2 = document.forms["caregiverBasicForm"]["county2"].value;
|
|
var state2 = document.forms["caregiverBasicForm"]["state2"].value;
|
|
var city2 = document.forms["caregiverBasicForm"]["city2"].value;
|
|
|
|
var Emergency_Contact_Address = document.forms["caregiverBasicForm"]["Emergency_Contact_Address"].value;
|
|
var Emergency_Contact_Country = document.forms["caregiverBasicForm"]["Emergency_Contact_Country"].value;
|
|
var Emergency_Contact_State = document.forms["caregiverBasicForm"]["Emergency_Contact_State"].value;
|
|
var Emergency_Contact_City = document.forms["caregiverBasicForm"]["Emergency_Contact_City"].value;
|
|
var Emergency_Contact_zipcode = document.forms["caregiverBasicForm"]["Emergency_Contact_zipcode"].value;
|
|
|
|
if(zipcode1 != ""){
|
|
if ((county1 == "") || (state1 == "") || (city1== "")) {
|
|
$(".zipcode1Error").html("<div class='alert alert-danger' role='alert'> Please enter a valid Zipcode.</div>");
|
|
return false;
|
|
}else{
|
|
$("#zipcode1Error").hide();
|
|
}
|
|
|
|
}
|
|
if (zipcode2 != "") {
|
|
if (address2 == "") {
|
|
$(".address2Error").html("<div class='alert alert-danger' role='alert'> Please enter a House Number.</div>");
|
|
return false;
|
|
}
|
|
else if ((county2 == "") || (state2 == "") || (city2=="")){
|
|
$(".zipcode2Error").html("<div class='alert alert-danger' role='alert'> Please enter a valid Zipcode.</div>");
|
|
return false;
|
|
}
|
|
else{
|
|
$("#address2Error").hide();
|
|
$("#zipcode2Error").hide();
|
|
}
|
|
|
|
}
|
|
if (Emergency_Contact_zipcode != "") {
|
|
if (Emergency_Contact_zipcode == "") {
|
|
$(".address3Error").html("<div class='alert alert-danger' role='alert'> Please enter a House Number.</div>");
|
|
return false;
|
|
}
|
|
else if ((Emergency_Contact_Country == "") || (Emergency_Contact_State == "") || (Emergency_Contact_City=="")) {
|
|
$(".zipcode3Error").html("<div class='alert alert-danger' role='alert'> Please enter a valid Zipcode.</div>");
|
|
return false;
|
|
}
|
|
else{
|
|
$("#address3Error").hide();
|
|
$("#zipcode3Error").hide();
|
|
}
|
|
|
|
}
|
|
//alert('validateForm');
|
|
return true;
|
|
}
|
|
function add_education_documents(data){
|
|
var appenddata = $("div[use=educationUploadFormContainer]").find("div[use='educationPart']").clone();
|
|
if(data!=null)
|
|
{
|
|
$.each($(appenddata).find("input,select"),function(){
|
|
//console.log($(this).attr("mname"));
|
|
var val = data[$(this).attr("mname")];
|
|
$(this).val(val);
|
|
});
|
|
}
|
|
$('#more_education_documents').append(appenddata);
|
|
$('#more_education_documents').find("i[use=plusbutt]").hide();
|
|
$('#more_education_documents').find("i[use=plusbutt]").last().show();
|
|
$('#more_education_documents').find("i[use=minusbutt]").last().show();
|
|
if($('#more_education_documents').find("i[use=minusbutt]").length<=1)
|
|
{
|
|
$('#more_education_documents').find("i[use=minusbutt]").first().hide();
|
|
}
|
|
}
|
|
function less_education_documents(obj,id){
|
|
var part = $(obj).parent().closest("div[use='educationPart']");
|
|
//console.log(part);
|
|
|
|
swal.fire({
|
|
title: 'Are you sure?',
|
|
text: "You won't be able to revert this!",
|
|
type: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Yes, delete it!'
|
|
}).then((result) => {
|
|
if (result.value) {
|
|
$.ajax({
|
|
url:'../CaregiversDashboard/deleteDocument?id='+id+'',
|
|
//data : 'id:id',
|
|
type :'GET',
|
|
success:function(data){
|
|
$(part).remove();
|
|
$('#more_education_documents').find("i[use=plusbutt]").hide();
|
|
$('#more_education_documents').find("i[use=plusbutt]").last().show();
|
|
$('#more_education_documents').find("i[use=minusbutt]").last().show();
|
|
if($('#more_education_documents').find("i[use=minusbutt]").length<=1)
|
|
{
|
|
$('#more_education_documents').find("i[use=minusbutt]").first().hide();
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
swal.fire("Your file is safe!");
|
|
}
|
|
});
|
|
}
|
|
function add_additional_certificates(data){
|
|
var appenddata = $("div[use=moreAdditionalCertificateFormContainer]").find("form[use=docUploadForm]").clone();
|
|
|
|
//alert('addl Certificate');
|
|
if(data!=null)
|
|
{
|
|
$.each($(appenddata).find("input"),function(){
|
|
var val = data[$(this).attr("name")];
|
|
if($(this).attr("type") != 'file')
|
|
{
|
|
$(this).val(val);
|
|
}else{
|
|
$(this).removeAttr('required');
|
|
$(this).parent().closest('div').find('label').removeClass('required-field');
|
|
|
|
}
|
|
});
|
|
|
|
if(data.ADC!='')
|
|
{
|
|
file ="<?php echo base_url(); ?>"+data.ADC;
|
|
var img_data='<a target="_blank" href="'+file+'">'
|
|
+'<img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 30px;">'
|
|
//+'<img src="uploads/uploaded.png" class="img-thumbnail" style="height: 50px;">'
|
|
+'</a>';
|
|
$(appenddata).find("span[use=uploadContainer]").append(img_data);
|
|
}else{
|
|
var img_data='<img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 30px;">';
|
|
$(appenddata).find("span[use=uploadContainer]").append(img_data);
|
|
}
|
|
}
|
|
// alert('2');
|
|
// console.log('Additional Certificate');
|
|
// console.log(appenddata);
|
|
// $(appenddata).append('<h1>TEST APPEND DATA</h1>');
|
|
$(appenddata).on("submit",function(e){
|
|
// e.preventDefault();
|
|
// alert('submit addl certificate');
|
|
submit_upload_form(e,this);
|
|
});
|
|
|
|
$('#more_additional_certifications').append(appenddata);
|
|
$('#more_additional_certifications').find("i[use=plusbutt]").hide();
|
|
$('#more_additional_certifications').find("i[use=plusbutt]").last().show();
|
|
$('#more_additional_certifications').find("i[use=minusbutt]").last().show();
|
|
if($('#more_additional_certifications').find("i[use=minusbutt]").length<=1)
|
|
{
|
|
$('#more_additional_certifications').find("i[use=minusbutt]").first().hide();
|
|
}
|
|
}
|
|
function less_additional_certificates(obj,id){
|
|
//alert();
|
|
var form = $(obj).parent().closest("form");
|
|
swal.fire({
|
|
title: 'Are you sure?',
|
|
text: "You won't be able to revert this!",
|
|
type: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Yes, delete it!'
|
|
}).then((result) => {
|
|
if (result.value) {
|
|
$.ajax({
|
|
url:'../CaregiversDashboard/deleteDocument?id='+id+'',
|
|
//data : 'id:id',
|
|
type :'GET',
|
|
success:function(data){
|
|
$(form).remove();
|
|
$('#more_additional_certifications').find("i[use=plusbutt]").hide();
|
|
$('#more_additional_certifications').find("i[use=plusbutt]").last().show();
|
|
$('#more_additional_certifications').find("i[use=minusbutt]").last().show();
|
|
if($('#more_additional_certifications').find("i[use=minusbutt]").length<=1)
|
|
{
|
|
$('#more_additional_certifications').find("i[use=minusbutt]").first().hide();
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
swal.fire("Your file is safe!");
|
|
}
|
|
});
|
|
|
|
}
|
|
function add_other_documents(data){
|
|
var appenddata = $("div[use=otherUploadFormContainer]").find("form[use=otherUploadForm]").clone();
|
|
|
|
if(data!=null)
|
|
{
|
|
$.each($(appenddata).find("input"),function(){
|
|
var val = data[$(this).attr("name")];
|
|
if($(this).attr("type") != 'file')
|
|
{
|
|
$(this).val(val);
|
|
}else{
|
|
$(this).removeAttr('required');
|
|
$(this).parent().closest('div').find('label').removeClass('required-field');
|
|
|
|
}
|
|
});
|
|
|
|
if(data.OTR!='')
|
|
{
|
|
file ="<?php echo base_url(); ?>"+data.OTR;
|
|
var img_data='<a target="_blank" href="'+file+'">'
|
|
+'<img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 30px;">'
|
|
//+'<img src="uploads/uploaded.png" class="img-thumbnail" style="height: 50px;">'
|
|
+'</a>';
|
|
$(appenddata).find("span[use=uploadContainer]").append(img_data);
|
|
}else{
|
|
var img_data='<img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 30px;">';
|
|
$(appenddata).find("span[use=uploadContainer]").append(img_data);
|
|
}
|
|
}
|
|
|
|
$(appenddata).on("submit",function(e){
|
|
submit_upload_form(e,this);
|
|
});
|
|
|
|
$('#more_other_documents').append(appenddata);
|
|
$('#more_other_documents').find("i[use=plusbutt]").hide();
|
|
$('#more_other_documents').find("i[use=plusbutt]").last().show();
|
|
$('#more_other_documents').find("i[use=minusbutt]").last().show();
|
|
if($('#more_other_documents').find("i[use=minusbutt]").length<=1)
|
|
{
|
|
$('#more_other_documents').find("i[use=minusbutt]").first().hide();
|
|
}
|
|
}
|
|
function less_other_documents(obj,id){
|
|
var form = $(obj).parent().closest("form");
|
|
swal.fire({
|
|
title: 'Are you sure?',
|
|
text: "You won't be able to revert this!",
|
|
type: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Yes, delete it!'
|
|
}).then((result) => {
|
|
if (result.value) {
|
|
$.ajax({
|
|
url:'../CaregiversDashboard/deleteDocument?id='+id+'',
|
|
//data : 'id:id',
|
|
type :'GET',
|
|
success:function(data){
|
|
$(form).remove();
|
|
$('#more_other_documents').find("i[use=plusbutt]").hide();
|
|
$('#more_other_documents').find("i[use=plusbutt]").last().show();
|
|
$('#more_other_documents').find("i[use=minusbutt]").last().show();
|
|
if($('#more_other_documents').find("i[use=minusbutt]").length<=1)
|
|
{
|
|
$('#more_other_documents').find("i[use=minusbutt]").first().hide();
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
swal.fire("Your file is safe!");
|
|
}
|
|
});
|
|
|
|
}
|
|
function add_training_documents(data){
|
|
var appenddata = $("div[use=trainingUploadFormContainer]").find("form[use=trainingUploadForm]").clone();
|
|
|
|
if(data!=null)
|
|
{
|
|
$.each($(appenddata).find("input"),function(){
|
|
var val = data[$(this).attr("name")];
|
|
if($(this).attr("type") != 'file')
|
|
{
|
|
$(this).val(val);
|
|
}else{
|
|
$(this).removeAttr('required');
|
|
$(this).parent().closest('div').find('label').removeClass('required-field');
|
|
|
|
}
|
|
});
|
|
|
|
if(data.TRN!='')
|
|
{
|
|
file ="<?php echo base_url(); ?>"+data.TRN;
|
|
var img_data='<a target="_blank" href="'+file+'">'
|
|
+'<img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 50px;">'
|
|
//+'<img src="uploads/uploaded.png" class="img-thumbnail" style="height: 50px;">'
|
|
+'</a>';
|
|
$(appenddata).find("span[use=uploadContainer]").append(img_data);
|
|
}else{
|
|
var img_data='<img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 50px;">';
|
|
$(appenddata).find("span[use=uploadContainer]").append(img_data);
|
|
}
|
|
}
|
|
|
|
$(appenddata).on("submit",function(e){
|
|
submit_upload_form(e,this);
|
|
});
|
|
//console.log(appenddata);
|
|
$('#more_training_documents').append(appenddata);
|
|
$('#more_training_documents').find("i[use=plusbutt]").hide();
|
|
$('#more_training_documents').find("i[use=plusbutt]").last().show();
|
|
$('#more_training_documents').find("i[use=minusbutt]").last().show();
|
|
if($('#more_training_documents').find("i[use=minusbutt]").length<=1)
|
|
{
|
|
$('#more_training_documents').find("i[use=minusbutt]").first().hide();
|
|
}
|
|
}
|
|
function less_training_documents(obj,id){
|
|
var form = $(obj).parent().closest("form");
|
|
swal.fire({
|
|
title: 'Are you sure?',
|
|
text: "You won't be able to revert this!",
|
|
type: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Yes, delete it!'
|
|
}).then((result) => {
|
|
if (result.value) {
|
|
$.ajax({
|
|
url:'../CaregiversDashboard/deleteDocument?id='+id+'',
|
|
//data : 'id:id',
|
|
type :'GET',
|
|
success:function(data){
|
|
$(form).remove();
|
|
$('#more_training_documents').find("i[use=plusbutt]").hide();
|
|
$('#more_training_documents').find("i[use=plusbutt]").last().show();
|
|
$('#more_training_documents').find("i[use=minusbutt]").last().show();
|
|
if($('#more_training_documents').find("i[use=minusbutt]").length<=1)
|
|
{
|
|
$('#more_training_documents').find("i[use=minusbutt]").first().hide();
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
swal.fire("Your file is safe!");
|
|
}
|
|
});
|
|
|
|
}
|
|
function load_progress(){
|
|
//alert();
|
|
$.ajax({
|
|
url:'<?php echo base_url(); ?>CaregiversDashboard/load_progress?id=<?php echo $nurse->ion_user_id; ?>',
|
|
type :'GET',
|
|
success:function(data){
|
|
var obj=JSON.parse(data);
|
|
//console.log(obj.upload);
|
|
var progress='';
|
|
if(obj.progress>99){
|
|
progress=100;
|
|
$('.Complete-Submit').show();
|
|
$('.submit-due').hide();
|
|
}else{
|
|
progress=obj.progress;
|
|
$('.Complete-Submit').hide();
|
|
$('.submit-due').show();
|
|
}
|
|
$('#progress_lbl').html(progress);
|
|
$('#progress_bar').html(progress+'%');
|
|
$('#progress_bar').attr('aria-valuenow',progress);
|
|
$('#progress_bar').attr('style','width: '+progress+'%;');
|
|
checkDocStatus(obj.upload);
|
|
}
|
|
});
|
|
}
|
|
function checkDocStatus(docArr){
|
|
//console.log(docArr);
|
|
//Photo
|
|
if( $.inArray("PHO", docArr) !== -1 ) {
|
|
$('.PHO-UP').show();
|
|
$('.PHO-DOWN').hide();
|
|
}else{
|
|
$('.PHO-UP').hide();
|
|
$('.PHO-DOWN').show();
|
|
}
|
|
//Citizen Documentation
|
|
if( $.inArray("CTZ", docArr) !== -1 ) {
|
|
$('.CTZ-UP').show();
|
|
$('.CTZ-DOWN').hide();
|
|
}else{
|
|
$('.CTZ-UP').hide();
|
|
$('.CTZ-DOWN').show();
|
|
}
|
|
//Social Security Card
|
|
if( $.inArray("SSC", docArr) !== -1 ) {
|
|
$('.SSC-UP').show();
|
|
$('.SSC-DOWN').hide();
|
|
}else{
|
|
$('.SSC-UP').hide();
|
|
$('.SSC-DOWN').show();
|
|
}
|
|
//Resume
|
|
if( $.inArray("RSM", docArr) !== -1 ) {
|
|
$('.RSM-UP').show();
|
|
$('.RSM-DOWN').hide();
|
|
}else{
|
|
$('.RSM-UP').hide();
|
|
$('.RSM-DOWN').show();
|
|
}
|
|
//State or Federal Issued ID
|
|
if( $.inArray("SFI", docArr) !== -1 ) {
|
|
$('.SFI-UP').show();
|
|
$('.SFI-DOWN').hide();
|
|
}else{
|
|
$('.SFI-UP').hide();
|
|
$('.SFI-DOWN').show();
|
|
}
|
|
//Malpractice Insurance Policy
|
|
if( $.inArray("MIC", docArr) !== -1 ) {
|
|
$('.MIC-UP').show();
|
|
$('.MIC-DOWN').hide();
|
|
}else{
|
|
$('.MIC-UP').hide();
|
|
$('.MIC-DOWN').show();
|
|
}
|
|
//NPI Document
|
|
if( $.inArray("NPI", docArr) !== -1 ) {
|
|
$('.NPI-UP').show();
|
|
$('.NPI-DOWN').hide();
|
|
}else{
|
|
$('.NPI-UP').hide();
|
|
$('.NPI-DOWN').show();
|
|
}
|
|
//PCA Document
|
|
if( $.inArray("PCA", docArr) !== -1 ) {
|
|
$('.PCA-UP').show();
|
|
$('.PCA-DOWN').hide();
|
|
}else{
|
|
$('.PCA-UP').hide();
|
|
$('.PCA-DOWN').show();
|
|
}
|
|
//References
|
|
if( $.inArray("REF", docArr) !== -1 ) {
|
|
$('.REF-UP').show();
|
|
$('.REF-DOWN').hide();
|
|
}else{
|
|
$('.REF-UP').hide();
|
|
$('.REF-DOWN').show();
|
|
}
|
|
//Annual Physical Examination
|
|
if( $.inArray("EHA", docArr) !== -1 ) {
|
|
$('.EHA-UP').show();
|
|
$('.EHA-DOWN').hide();
|
|
}else{
|
|
$('.EHA-UP').hide();
|
|
$('.EHA-DOWN').show();
|
|
}
|
|
//Hapatitis B Vaccine Acceptence
|
|
if( $.inArray("HBV", docArr) !== -1 ) {
|
|
$('.HBV-UP').show();
|
|
$('.HBV-DOWN').hide();
|
|
}else{
|
|
$('.HBV-UP').hide();
|
|
$('.HBV-DOWN').show();
|
|
}
|
|
//PPD / Quantiferonon
|
|
if( $.inArray("PPD", docArr) !== -1 ) {
|
|
$('.PPD-UP').show();
|
|
$('.PPD-DOWN').hide();
|
|
}else{
|
|
$('.PPD-UP').hide();
|
|
$('.PPD-DOWN').show();
|
|
}
|
|
//Drug Screen
|
|
if( $.inArray("DSC", docArr) !== -1 ) {
|
|
$('.DSC-UP').show();
|
|
$('.DSC-DOWN').hide();
|
|
}else{
|
|
$('.DSC-UP').hide();
|
|
$('.DSC-DOWN').show();
|
|
}
|
|
//Flu Vaccine :
|
|
if( $.inArray("FLV", docArr) !== -1 ) {
|
|
$('.FLV-UP').show();
|
|
$('.FLV-DOWN').hide();
|
|
}else{
|
|
$('.FLV-UP').hide();
|
|
$('.FLV-DOWN').show();
|
|
}
|
|
//Covid Report :
|
|
if( $.inArray("CVD", docArr) !== -1 ) {
|
|
$('.CVD-UP').show();
|
|
$('.CVD-DOWN').hide();
|
|
}else{
|
|
$('.CVD-UP').hide();
|
|
$('.CVD-DOWN').show();
|
|
}
|
|
//Covid Report :
|
|
if( $.inArray("CPR", docArr) !== -1 ) {
|
|
$('.CPR-UP').show();
|
|
$('.CPR-DOWN').hide();
|
|
}else{
|
|
$('.CPR-UP').hide();
|
|
$('.CPR-DOWN').show();
|
|
}
|
|
//Licenses or Certification :
|
|
if( $.inArray("ADC", docArr) !== -1 ) {
|
|
$('.ADC-UP').show();
|
|
$('.ADC-DOWN').hide();
|
|
}else{
|
|
$('.ADC-UP').hide();
|
|
$('.ADC-DOWN').show();
|
|
}
|
|
//Other Documents
|
|
if( $.inArray("OTR", docArr) !== -1 ) {
|
|
$('.OTR-UP').show();
|
|
$('.OTR-DOWN').hide();
|
|
}else{
|
|
$('.OTR-UP').hide();
|
|
$('.OTR-DOWN').show();
|
|
}
|
|
//CHRC 102
|
|
if( $.inArray("102", docArr) !== -1 ) {
|
|
$('.102-UP').show();
|
|
$('.102-DOWN').hide();
|
|
}else{
|
|
$('.102-UP').hide();
|
|
$('.102-DOWN').show();
|
|
}
|
|
//CHRC 103
|
|
if( $.inArray("103", docArr) !== -1 ) {
|
|
$('.103-UP').show();
|
|
$('.103-DOWN').hide();
|
|
}else{
|
|
$('.103-UP').hide();
|
|
$('.103-DOWN').show();
|
|
}
|
|
//RRF
|
|
if( $.inArray("RRF", docArr) !== -1 ) {
|
|
$('.RRF-UP').show();
|
|
$('.RRF-DOWN').hide();
|
|
}else{
|
|
$('.RRF-UP').hide();
|
|
$('.RRF-DOWN').show();
|
|
}
|
|
}
|
|
$( document ).ready(function() {
|
|
|
|
setInterval(function(){
|
|
load_progress();
|
|
}, 1000);
|
|
var today = new Date();
|
|
var dd = today.getDate();
|
|
var mm = today.getMonth()+1; //January is 0!
|
|
var yyyy = today.getFullYear();
|
|
if(dd<10){
|
|
dd='0'+dd
|
|
}
|
|
if(mm<10){
|
|
mm='0'+mm
|
|
}
|
|
|
|
today = yyyy+'-'+mm+'-'+dd;
|
|
document.getElementById("dob").setAttribute("max", today);
|
|
|
|
var PPD_Quantiferonon_max_date = new Date();
|
|
PPD_Quantiferonon_max_date.setMonth(PPD_Quantiferonon_max_date.getMonth() + 12);
|
|
var dd1 = PPD_Quantiferonon_max_date.getDate();
|
|
var mm1 = PPD_Quantiferonon_max_date.getMonth()+1; //January is 0!
|
|
var yyyy1 = PPD_Quantiferonon_max_date.getFullYear();
|
|
if(dd1<10){
|
|
dd1='0'+dd1
|
|
}
|
|
if(mm1<10){
|
|
mm1='0'+mm1
|
|
}
|
|
PPD_Quantiferonon_max_date = yyyy1+'-'+mm1+'-'+dd1;
|
|
document.getElementById("PPD_Quantiferonon_date").setAttribute("max", PPD_Quantiferonon_max_date);
|
|
|
|
<?php if($traing_doc_count>0){ ?>
|
|
<?php for($i=0;$i<$traing_doc_count;$i++){?>
|
|
var trainingUploadData = {};
|
|
trainingUploadData['Ion_id'] = "<?php if (!empty($nurse->ion_user_id)) echo $nurse->ion_user_id; ?>";
|
|
trainingUploadData['id'] = "<?php if (!empty($nurse->caregiver_table_id)) echo $nurse->caregiver_table_id; ?>";
|
|
trainingUploadData['doc_type'] = "<?php echo _DOC_TRAININGCODE_ ; ?>";
|
|
trainingUploadData['<?php echo _DOC_TRAININGCODE_ ; ?>_remarks'] = "<?php echo $documentsrem[_DOC_TRAININGCODE_][$i]; ?>";
|
|
trainingUploadData['<?php echo _DOC_TRAININGCODE_ ; ?>_documents_no'] = "<?php echo $documentsno[_DOC_TRAININGCODE_][$i]; ?>";
|
|
trainingUploadData['<?php echo _DOC_TRAININGCODE_ ; ?>'] = "<?php echo $documentsarr[_DOC_TRAININGCODE_][$i]; ?>";
|
|
trainingUploadData['doc_id'] = "<?php echo $documentsid[_DOC_TRAININGCODE_][$i]; ?>";
|
|
trainingUploadData['progress'] = "10";
|
|
trainingUploadData['csrf_test_name'] = "<?= $get_csrf_token_value ?>";
|
|
add_training_documents(trainingUploadData);
|
|
<?php } ?>
|
|
<?php }else{ ?>
|
|
add_training_documents(null);
|
|
<?php } ?>
|
|
|
|
<?php if($other_doc_count>0){ ?>
|
|
<?php for($i=0;$i<$other_doc_count;$i++){?>
|
|
var otherUploadData = {};
|
|
otherUploadData['Ion_id'] = "<?php if (!empty($nurse->ion_user_id)) echo $nurse->ion_user_id; ?>";
|
|
otherUploadData['id'] = "<?php if (!empty($nurse->caregiver_table_id)) echo $nurse->caregiver_table_id; ?>";
|
|
otherUploadData['doc_type'] = "<?php echo _DOC_OTHERCODE_ ; ?>";
|
|
otherUploadData['<?php echo _DOC_OTHERCODE_ ; ?>_remarks'] = "<?php echo $documentsrem[_DOC_OTHERCODE_][$i]; ?>";
|
|
otherUploadData['<?php echo _DOC_OTHERCODE_ ; ?>'] = "<?php echo $documentsarr[_DOC_OTHERCODE_][$i]; ?>";
|
|
otherUploadData['doc_id'] = "<?php echo $documentsid[_DOC_OTHERCODE_][$i]; ?>";
|
|
otherUploadData['progress'] = "10";
|
|
otherUploadData['csrf_test_name'] = "<?= $get_csrf_token_value ?>";
|
|
add_other_documents(otherUploadData);
|
|
<?php } ?>
|
|
<?php }else{ ?>
|
|
add_other_documents(null);
|
|
<?php } ?>
|
|
|
|
<?php if($additional_certificate_count>0){ ?>
|
|
<?php for($i=0;$i<$additional_certificate_count;$i++){?>
|
|
var additionalCertificateData = {};
|
|
additionalCertificateData['Ion_id'] = "<?php if (!empty($nurse->ion_user_id)) echo $nurse->ion_user_id; ?>";
|
|
additionalCertificateData['id'] = "<?php if (!empty($nurse->caregiver_table_id)) echo $nurse->caregiver_table_id; ?>";
|
|
additionalCertificateData['doc_type'] = "<?php echo _ADDL_CERTIFICATE_ ; ?>";
|
|
additionalCertificateData['Name_Additional_Certifications'] = "<?php echo $documentsrem[_ADDL_CERTIFICATE_][$i]; ?>";
|
|
additionalCertificateData['Additional_Certifications_Number'] = "<?php echo $documentsno[_ADDL_CERTIFICATE_][$i]; ?>";
|
|
additionalCertificateData['<?php echo _ADDL_CERTIFICATE_ ; ?>'] = "<?php echo $documentsarr[_ADDL_CERTIFICATE_][$i]; ?>";
|
|
additionalCertificateData['doc_id'] = "<?php echo $documentsid[_ADDL_CERTIFICATE_][$i]; ?>";
|
|
additionalCertificateData['progress'] = "5";
|
|
additionalCertificateData['form_status'] = "5";
|
|
additionalCertificateData['data_type'] = "Additional_Certifications";
|
|
add_additional_certificates(additionalCertificateData);
|
|
<?php } ?>
|
|
<?php }else{ ?>
|
|
add_additional_certificates(null);
|
|
<?php } ?>
|
|
|
|
<?php if($school_certificate_count>0){ ?>
|
|
<?php for($i=0;$i<$school_certificate_count;$i++){?>
|
|
var education_documents = {};
|
|
education_documents['school'] = "<?php if (!empty($educationBackground[$i]->school)) echo $educationBackground[$i]->school; ?>";
|
|
education_documents['location_school'] = "<?php if (!empty($educationBackground[$i]->location_school)) echo $educationBackground[$i]->location_school; ?>";
|
|
education_documents['edu_years'] = "<?php if (!empty($educationBackground[$i]->edu_years)) echo $educationBackground[$i]->edu_years; ?>";
|
|
education_documents['certificate_date'] = "<?php if (!empty($educationBackground[$i]->certificate_date)) echo $educationBackground[$i]->certificate_date; ?>";
|
|
education_documents['major_subject'] = "<?php if (!empty($educationBackground[$i]->major_subject)) echo $educationBackground[$i]->major_subject; ?>";
|
|
|
|
add_education_documents(education_documents);
|
|
<?php } ?>
|
|
<?php }else{ ?>
|
|
add_education_documents(null);
|
|
<?php } ?>
|
|
|
|
$("form[use=docSaveForm]").on("submit",function(e){
|
|
//alert('test');
|
|
e.preventDefault();
|
|
var frm = this;
|
|
setTimeout( function(){
|
|
|
|
var proceed = true;
|
|
$.each($(frm).find(".help-block,.with-errors"),function(){
|
|
//console.log((this));
|
|
if($(this).find('.list-unstyled').length>0){
|
|
//console.log('>>>>>>>>>>');
|
|
proceed = false;
|
|
return false;
|
|
}
|
|
});
|
|
|
|
$.each($(frm).find("input[type=file]"),function(){
|
|
var fileObj = $(this).prop('files')[0];
|
|
//console.log(fileObj);
|
|
if(fileObj)
|
|
{
|
|
var fileName = fileObj.name;
|
|
var ext = fileName.split(".").pop();
|
|
|
|
var allowedTypes = $(this).attr("allowedType");
|
|
|
|
if(allowedTypes.indexOf(ext)<0)
|
|
{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Invalid File type.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
|
|
proceed = false;
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
|
|
if(proceed==true)
|
|
{
|
|
var formObj = $(frm);
|
|
//alert("trying to submit");
|
|
var from_data=new FormData(frm);
|
|
$.ajax({
|
|
url: $(frm).attr("action"),
|
|
type : 'POST',
|
|
data : from_data,
|
|
dataType: "json",
|
|
contentType: false,
|
|
cache: false,
|
|
processData:false,
|
|
beforeSend : function(){
|
|
//$("#preview").fadeOut();
|
|
$("#err").fadeOut();
|
|
},
|
|
success : function(data){
|
|
//console.log(data);
|
|
|
|
if(data.upload=='success'){
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'success',
|
|
title: data.msg,
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
|
|
$(formObj).find("span[use=uploadContainer]").empty();
|
|
file ="<?php echo base_url(); ?>"+data.file_url;
|
|
//console.log(file);
|
|
var insert = '<a class="img-icon" target="_blank" href="'+file+'">'
|
|
+'<img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 30px;">'
|
|
//+'<img src="uploads/uploaded.png" class="img-thumbnail" style="height: 75px;">'
|
|
+'</a>';
|
|
$(formObj).find("span[use=uploadContainer]").append(insert);
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: data.msg,
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
}
|
|
},
|
|
error : function(err){
|
|
alert("error");
|
|
}
|
|
|
|
});
|
|
}
|
|
}, 1000);
|
|
});
|
|
|
|
});
|
|
function submit_upload_form(e,formObject){
|
|
e.preventDefault();
|
|
//console.log('>>>>>>>>>>');
|
|
var formObj = $(formObject);
|
|
//alert("submit");
|
|
var from_data=new FormData(formObject);
|
|
//alert(from_data);
|
|
$.ajax({
|
|
url: $(formObject).attr("action"),
|
|
type : 'POST',
|
|
data : from_data,
|
|
dataType: "json",
|
|
contentType: false,
|
|
cache: false,
|
|
processData:false,
|
|
beforeSend : function(){
|
|
//$("#preview").fadeOut();
|
|
$("#err").fadeOut();
|
|
},
|
|
success : function(data){
|
|
//console.log(data);
|
|
if(data.upload=='success'){
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'success',
|
|
title: data.msg,
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
|
|
$(formObj).find("span[use=uploadContainer]").empty();
|
|
file ="<?php echo base_url(); ?>"+data.file_url;
|
|
var insert = '<a target="_blank" href="'+file+'">'
|
|
+'<img src="<?php echo base_url(); ?>uploads/attachment.png" class="img-thumbnail" style="height: 50px;">'
|
|
//+'<img src="uploads/uploaded.png" class="img-thumbnail" style="height: 75px;">'
|
|
+'</a>';
|
|
$(formObj).find("span[use=uploadContainer]").append(insert);
|
|
}
|
|
},
|
|
error : function(err){
|
|
alert("error2");
|
|
}
|
|
|
|
});
|
|
}
|
|
function isNumberKey(evt) {
|
|
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
|
if (charCode > 31 && (charCode < 48 || charCode > 57))
|
|
return false;
|
|
return true;
|
|
}
|
|
$("#caregiverBasicForm").submit(function(e){
|
|
var proceed = true;
|
|
$.each($("input[type=email]"),function(){
|
|
//alert('1');
|
|
var email = $.trim($(this).val());
|
|
if(email!='')
|
|
{
|
|
//alert('2');
|
|
var reg =/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
|
if (reg.test(email)==false)
|
|
{
|
|
//alert('3');
|
|
var parent = $(this).parent().closest("div.form-group");
|
|
// console.log(parent);
|
|
$(parent).addClass('has-error').addClass('has-danger');
|
|
$(parent).find('div.help-block').append('<ul class="list-unstyled"><li>Please enter a valid email.</li></ul>');
|
|
//$(parent).show();
|
|
proceed = false;
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
if(!proceed)
|
|
{
|
|
e.preventDefault();
|
|
}
|
|
});
|
|
function isEmpty(obj) {
|
|
for(var key in obj) {
|
|
if(obj.hasOwnProperty(key))
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function getSkill(skillId){
|
|
getExperienceDetails();
|
|
}
|
|
function check_parmanent_address(){
|
|
|
|
var address1=$('#address1').val();
|
|
var zipcode1=$('#zipcode1').val();
|
|
if(address1!="" && zipcode1!=""){
|
|
$.ajax({
|
|
url:"caregivers/checkaddress",
|
|
type:"GET",
|
|
data:{address:address1,zipcode:zipcode1},
|
|
dataType: "json",
|
|
beforeSend: function() {
|
|
$("#check_parmanent_address_btn").hide();
|
|
$("#check_parmanent_address_loader").show();
|
|
$("#basic_submit_btn").prop("disabled", true);
|
|
},
|
|
success:function(data){
|
|
//console.log(data);
|
|
$("#basic_submit_btn").removeAttr('disabled');
|
|
if(data.address_info.status_code=="200"){
|
|
$('#state1').val(data.address_info.address.state);
|
|
$('#county1').val(data.address_info.address.county);
|
|
$('#city1').val(data.address_info.address.city);
|
|
$('#lang1').val(data.geo_info.latlong.Latitude);
|
|
$('#long1').val(data.geo_info.latlong.Longitude);
|
|
$('#contact_info_submit').prop('disabled',false);
|
|
$('#check_p_address').val('checked');
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'address not found.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('address not found.');
|
|
$('#contact_info_submit').prop('disabled',true);
|
|
}
|
|
$("#check_parmanent_address_btn").show();
|
|
$("#check_parmanent_address_loader").hide();
|
|
}
|
|
});
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Enter street address and zipcode.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('Enter street address and zipcode.');
|
|
}
|
|
}
|
|
function check_alternative_address(){
|
|
var address=$('#address2').val();
|
|
var zipcode=$('#zipcode2').val();
|
|
if(address!="" && zipcode!=""){
|
|
$.ajax({
|
|
url:"caregivers/checkaddress",
|
|
type:"GET",
|
|
data:{address:address,zipcode:zipcode},
|
|
dataType: "json",
|
|
beforeSend: function() {
|
|
$("#check_alternative_address_btn").hide();
|
|
$("#check_alternative_address_loader").show();
|
|
$("#basic_submit_btn").prop("disabled", true);
|
|
},
|
|
success:function(data){
|
|
//console.log(data);
|
|
$("#basic_submit_btn").removeAttr('disabled');
|
|
if(data.address_info.status_code=="200"){
|
|
$('#state2').val(data.address_info.address.state);
|
|
$('#county2').val(data.address_info.address.county);
|
|
$('#city2').val(data.address_info.address.city);
|
|
$('#lang2').val(data.geo_info.latlong.Latitude);
|
|
$('#long2').val(data.geo_info.latlong.Longitude);
|
|
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'address not found.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('address not found.');
|
|
}
|
|
$("#check_alternative_address_btn").show();
|
|
$("#check_alternative_address_loader").hide();
|
|
}
|
|
});
|
|
}else{
|
|
Swal.fire({
|
|
position: 'center',
|
|
icon: 'error',
|
|
title: 'Enter street address and zipcode.',
|
|
showConfirmButton: false,
|
|
timer: 3500
|
|
});
|
|
//alert('Enter street address and zipcode.');
|
|
}
|
|
}
|
|
|
|
function USformatPhoneNumber(phoneNumberString,_this) {
|
|
var cleaned = ('' + phoneNumberString).replace(/\D/g, '')
|
|
if(cleaned.length > 10){
|
|
cleaned = cleaned.substr(0, 10);
|
|
}
|
|
var match = cleaned.match(/^(1|)?(\d{3})(\d{3})(\d{4})$/)
|
|
if (cleaned.length == 10 && match) {
|
|
var intlCode = (match[1] ? '+1 ' : '')
|
|
var fres = [intlCode, '(', match[2], ') ', match[3], '-', match[4]].join('')
|
|
_this.value = fres;
|
|
}else{
|
|
_this.value = cleaned
|
|
}
|
|
return null
|
|
}
|
|
|
|
|
|
function showHideXRay(){
|
|
var PPD_Quantiferonon_status=$("#PPD_Quantiferonon_status").val();
|
|
$('input[name=CXR]').removeAttr('required');
|
|
if(PPD_Quantiferonon_status=='Negative'){
|
|
$("#chest_X_ray_File").find('div').first().hide();
|
|
}else{
|
|
//$("#chest_X_ray_File").html(html_data);
|
|
$("#chest_X_ray_File").find('div').first().show();
|
|
$('input[name=CXR]').attr('required','required');
|
|
}
|
|
}
|
|
function ShowHideAutomobileInfo(){
|
|
var drive_info=$("#drive_info").val();
|
|
if(drive_info=="Yes"){
|
|
$("#automobile_insurance_info").show();
|
|
$("input[name='Automobile_Policy_Holder_Name']").attr('required','required');
|
|
$("input[name='Automobile_Policy_Number']").attr('required','required');
|
|
$("input[name='Automobile_Policy_Expiration_Date']").attr('required','required');
|
|
}else{
|
|
$("#automobile_insurance_info").hide();
|
|
$("input[name='Automobile_Policy_Holder_Name']").removeAttr('required');
|
|
$("input[name='Automobile_Policy_Number']").removeAttr('required');
|
|
$("input[name='Automobile_Policy_Expiration_Date']").removeAttr('required');
|
|
}
|
|
}
|
|
$('.nav-item').click(function(event){
|
|
if ($(this).hasClass('disabled')) {
|
|
return false;
|
|
}else{
|
|
//alert();
|
|
$(".nav-item").removeClass("active");
|
|
$(this).addClass("active");
|
|
}
|
|
});
|
|
</script>
|