<div class="main-panel">
    <div class="content-wrapper">
        <div class="row">
            <div class="card col-sm-12">
                <div class="card-body">
                    <!-- 
                    <h4 class="card-title">Hoverable Table</h4>
                    <p class="card-description">
                        Add class <code>.table-hover</code>
                    </p> -->
                    <div class="table-responsive">
                        <table id="example" class="table table-hover">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Image</th>
                                    <th>Status</th>
                                    <th>Title</th>
                                    <th>Paragraph</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script>
    $(document).ready(function() {
        $('[data-toggle="tooltip"]').tooltip();
    });


    $('#example').DataTable({
        ajax: {
            url: '<?= site_url() ?>/admin-get-banners-list',
            type: 'POST',
            data: function(d) {
                // d.order = [{
                //     column: 0, // Specify the column index for sorting (0 represents the first column)
                //     dir: 'desc' // Set the sorting direction to 'desc' for descending order
                // }];
            },
        },
        processing: true,
        serverSide: true
    });

    function changeStatus(id) {

        $.ajax({
            url: '<?= site_url() ?>/admin-change-banner-status?id=' + id,
            type: 'GET',
            processData: false,
            contentType: false,
            dataType: 'json',
            success: function(result) {

                if (result.status == '1') {

                    setTimeout(function() {
                        location.reload();
                    }, 1500);


                }

            }
        })


    }
</script>