$(document).ready(function () {
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    $('table[data-form="deleteForm"]').on('click', '.form-delete', function(e){
        e.preventDefault();
        var $form=$(this);
        $('#confirm').modal({ backdrop: 'static', keyboard: false })
            .on('click', '#delete-btn', function(){
                $form.submit();
            });
    });

    $('#listaPremios').select2();
    
});

function actualizarEstado(id){
    $.ajax({
        type: "POST",
        url: baseURL + '/actualizarEstado',
        data: { idpremio: id },
        dataType: "JSON",
        success: function (rs) {
            location.reload();
        }
    });
}


