function saveForm(elem)
{
    event.preventDefault(); 
    var action = $(elem).attr('action');
    var urls = action;
    let dataform = new FormData( $(elem)[0]);
    $.ajax
        ({
            url : urls,
            type: 'POST',              
            data: dataform,
            contentType: false, 
            processData: false, 
            success:function(data)
            {
                $('#confirmModal').modal('show');
                setTimeout(
                    function()
                    {
                        location.reload();
                    }, 1000);
            }
            ,error:function(data) 
            {
                $('#errors').html('');
                $.each(data.responseJSON.errors, function(key,value) 
                {
                    $('#errors').append('<h3 class="title color-primary text-center">'+value+'</h3>');
                }); 
                $('#cancelModal').modal('show');
            }
        })
}


function seeDetail(elem)
{
    let data = $(elem).attr('data-id');
    
    $.ajax({
      url : url_see_details,
      type : 'GET',
      data : 'id='+data,
      success:function(data)
      {
        $('#details').html(data);
      }
    })
}