//alert auto close
setTimeout(function(){
    $('.alert').fadeOut('slow');
}, 3000);

//update class type function
$(document).on('click', '#btnUpdate', function(){
    let id = $(this).data('id');

    $.ajax({
        url: base_url + "userrole/get/" + id,
        type: "GET",
        dataType: "json",
        success: function(data){
            $('#updid').val(data.id);

            $('#updcode').val(data.code);
            $('#updname').val(data.name);
            $('#upddescription').val(data.description);
            $('#updstatus').val(data.status);
        },
        error:function(){
            alert('Unable to load data');
        }
    });
});

//delete class type function
$(document).on('click', '#btnDelete', function(){
    let id = $(this).data('id');
    $('#delid').val(id);
});



