<script>
    $(document).ready(function () {
        // $('#GCData').dataTable({
        //     "ajax": "<?= site_url('documents/get_documents') ?>"
        // });
        $('#GCData').DataTable({
            'bProcessing': true,
            'bServerSide': true,
            "responsive": true,
            "order": [[ 2, "desc" ]],
            "processing": true,
            "serverSide": true,
            "ajax": {
                "url": "<?= site_url('documents/get_documents') ?>",
            },
            "columns": [
                { "data": "id" ,
                    className: "text-center"},
                { "data": "description"},
                { "data": "code",
                    className: "text-center" },
                { "data": "option",
                    className: "text-center" }
            ],
            columnDefs: [
                { orderable: false, targets: -1 },
                { orderable: false, targets: -2 },
                { orderable: false, targets: -3 }
            ]                        
        });

    });

// <!-- {"mRender":hrsd} -->
</script>


<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box" style="border-top: 2.5px solid #004785;">
                <!--div class="box-header">
                    <h3 class="box-title"><?= lang('list_results'); ?></h3>
                </div-->
                <div class="box-body">
                    <div class="table-responsive">
                        <table id="GCData" class="table table-bordered table-hover table-striped table-condensed" style="width:100%">
                            <thead class="text-center">
                                <tr>
                                    <th class="col-sm-1 " ><?= lang("code"); ?></th>
                                    <th class="col-sm-8"><?= lang("description"); ?></th>
                                    <th class="col-sm-2" style="text-align:center;"><?= lang("code_sunat"); ?></th>
                                    <th class="col-sm-1" style="text-align:center;">Ver</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td colspan="9" class="dataTables_empty"><?= lang('loading_data_from_server') ?></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>
<script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script type="text/javascript" src="<?= $assets ?>plugins/datatables/datatable.min.js"></script>
