
//===================== PERSONAL DETAILS ===============================

$('#personal_edit').on('click',function(e){
    e.preventDefault();
    $('#personal_view').hide(500)
    $('#personal_entry').show(500)   
})
$('#personal_cancel').on('click',function(e){
    e.preventDefault();
    $('#personal_view').show(500)
    $('#personal_entry').hide(500)   
})

//===================== CONTACT DETAILS ===============================

$('#contact_edit').on('click',function(e){
    e.preventDefault();
    $('#contact_view').hide(500)
    $('#contact_entry').show(500)
})
$('#contact_cancel').on('click',function(e){
    e.preventDefault();
    $('#contact_view').show(500)
    $('#contact_entry').hide(500)
})







$('#employment_view').show()
$('#employment_entry').hide()


$('#employment_edit').on('click',function(e){
    e.preventDefault();
    $('#employment_view').hide(500)
    $('#employment_entry').show(500)   
})
$('#employment_cancel').on('click',function(e){
    e.preventDefault();
    $('#employment_view').show(500)
    $('#employment_entry').hide(500)   
})



$('#bank_view').show()
$('#bank_entry').hide()


$('#bank_edit').on('click',function(e){
    e.preventDefault();
    $('#bank_view').hide(500)
    $('#bank_entry').show(500)   
})
$('#bank_cancel').on('click',function(e){
    e.preventDefault();
    $('#bank_view').show(500)
    $('#bank_entry').hide(500)   
})



$('#passbook').on('input',function(e){
    e.preventDefault();
      $('#passbook-error').hide();
    swal({
        title: 'Are you sure? ',
        text: "You Want to Upload This File!",
        type: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: 'Yes'
    }).then((result) => {
        if (result.value) {
               var form = $('#passbook_form')[0];
               var data = new FormData(form);
            if(data){
                
                    $('.page-loader-wrapper').fadeIn();
                    $.ajax({
                        type: "POST",
                        enctype: 'multipart/form-data',
                        processData: false,
                        contentType: false,
                        cache: false,
                        url: 'updoaddocument',
                        data:data,
                        dataType: "json",
                        success: function (data) {
                            if (data.msgType == true) {
                                
                                toastr.success(data.msg)
                            } else {
                                toastr.error(data.msg)
                            }

                        },
                        error: function (jqXHR, textStatus, errorThrown) {

                            callAjaxErrorFunction(jqXHR, textStatus, errorThrown);
                        },
                        complete: function (data) {
                            $('.page-loader-wrapper').fadeOut();
                        }
                    });
                
            }else{
                $('#passbook-error').hide();
                toastr.error($('#passbook-error').text());
            }
        }else{
             $('#passbook-error').hide();
             toastr.error($('#passbook-error').text());
        }
    })
})

/*$('#passbook').siblings('label').hide();

$("#passbook_form").validate({
    rules: {
        passbook: {
            required: true,
            extension: "jpg|jpeg|png|pdf",
            filesize: 200,
        }
    },
    messages: {
        passbook: {
            required: "Passbook File is mandatory",
        }
    }
});

$.validator.addMethod('filesize', function (value, element, param) {
    param = param * 1024;
    return this.optional(element) || (element.files[0].size <= param)
}, 'File size must be less than {0} KB');*/



function get_personal_data(){
    
    
}

