jQuery(document).ready(function($){
    var cpp_form = $('#cpp-form');
    $('#cpp-upload-file').css('display', 'none');
    $('#cpp-preloader').css('display', 'none');
    $('#cpp-alert').css('display', 'none');

    $('#cpp-ctr-upload-file').click(function(event){
        event.preventDefault();
        $('#cpp-upload-file').click();
    });
    $('#cpp-upload-file').change(function(){
        $(cpp_form).submit()  
    });
    $(cpp_form).submit(function(e){
        e.preventDefault();
        $.ajax({
            type: 'POST',
            url: 'contents/plugins/eedu_portal/ajax.php',
            data: new FormData(this),
            contentType: false,
            cache: false,
            processData: false,
            success: function(data) {
                location.reload();
            }
        });
    })
})