<script type="text/javascript">

    $(document).ready(function () {

        var table_details_id = "#tbl_audit_details";
        var table_details = $(table_details_id).DataTable({
            scrollY: "450px",
            "bAutoWidth": true,
            pageLength: 50,
            ajax: {
                url: "index.php?r=auditlog/GetList",
                type: "POST",
                cache: false,
            },
            serverSide: true,
            fixedColumns: true,
            processing: true,
            order: [[1, "asc"]],
           /* "fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
                if (aData[1] == "Closed") {
                    $("td", nRow).addClass("bg-success");
                }
                if (aData[9] == true) {
                    $("td", nRow).addClass("bg-danger");
                }
            }*/
        });
        $(".dataTables_scrollFoot").hide();
    });
    function del(id) {
        var dr = confirm("Are you sure to delete this item?");
        if (dr) {
            $.ajax({
                url: 'index.php?r=auditlog/delete',
                data: {'id': id},
                dataType: 'json',
                type: 'POST',
                success: function (data, textStatus, jqXHR) {
                    if (data.status == "success") {
                        t8.success("Saved!!");
                    } else {
                        $.each(data, function (key, val) {
                            t8.error("" + val + "");
                        });
                    }
                },
                beforeSend: function (xhr) {
                    $("#loader").show();
                },
                complete: function (jqXHR, textStatus) {
                    $("#loader").hide();
                    reloadTable("#tbl_audit_details");
                }

            });

        }

    }
</script>

<section class="panel">
    <header class="panel-heading clearfix panel-theame">
        <i class="fa fa-list"></i> Audit Log
        <div class="pull-right">
            </div>

    </header>
    <div class="panel-body">
        <div class="custom-data-table">
            <table class="table table-hover table-bordered personal-task" id="tbl_audit_details">
                <thead>
                    <tr>
                        <th>No</th>
                        <th>Funtionality</th>
                        <th>Year</th>
                        <th>Month</th>
                        <th>Changes</th>
                        <th>Product</th>
                        <th>New Value</th>
                        <th>Old Value</th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <th>No</th>
                        <th>Funtionality</th>
                        <th>Year</th>
                        <th>Month</th>
                        <th>Changes</th>
                        <th>Product</th>
                        <th>New Value</th>
                        <th>Old Value</th>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</section>