<script type="text/javascript">
    function deleteFile(url,dataId) {
        $.confirm({
            title: '{{ lang.delete_title }}',
            content: '{{ lang.delete_confirm }}',
            buttons: {
                confirm: function () {
                    $.ajax({
                        url: url,
                        type: 'GET',
                        success: function (data) {
                            $('div[data-id="row-' + dataId + '"]').slideUp("slow");
                        },
                        error: function (data) {
                            $.alert({title: 'Message Alert!', content: data.message, type: 'red'});
                        }
                    });
                },
                cancel: function () {
                }
            }
        });
    }

    //delete
    function deleteRecord(url){
        $.confirm({
            title: '{{ lang.delete_title }}',
            content: '{{ lang.delete_confirm }}',
            buttons: {
                confirm: function () {
                    $.ajax({
                        url:url,
                        type: 'POST',
                        data: {{ token()|raw }},
                        success:function(data) {
                            location.reload();
                        }
                    })
                },
                cancel: function () {
                }
            }
        });
    }

</script>
