<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); ?><!DOCTYPE html>
    <input type="hidden" id="negocio" name="negocio" value="<?php echo $_SESSION["negocio"];?>">
<script>
    $(document).ready(function () {


        $('#spData').dataTable({
            "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, '<?= lang('all'); ?>']],
            "aaSorting": [[ 0, "asc" ]], 
            "iDisplayLength": <?= $Settings->rows_per_page ?>,
            'bProcessing': true, 
            'bServerSide': true,
            searching: true,
            'sAjaxSource': '<?= site_url('traders/get_traders') ?>',
            'fnServerData': function (sSource, aoData, fnCallback) {
                aoData.push({
                    "name": "<?= $this->security->get_csrf_token_name() ?>",
                    "value": "<?= $this->security->get_csrf_hash() ?>"
                });
                $.ajax({'dataType': 'json', 'type': 'POST', 'url': sSource, 'data': aoData, 'success': fnCallback});
            },
            "aoColumns": [
                { mData: 'traderCode' } ,
                { mData: 'names' },
                { mData: 'documentNumber' },
                { mData: 'phone' },
                { mData: 'gender' },
                { mData: 'email' },
                { mData: 'action' }
            ]
        });
    });
</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="spData" class="table table-bordered table-hover table-striped">
                        <thead>
                        <tr>
                            <th><?php echo $this->lang->line("trader_code"); ?></th>
                            <th><?php echo $this->lang->line("complete_name"); ?></th>
                            <th>N. <?php echo $this->lang->line("document"); ?></th>
                            <th><?php echo $this->lang->line("phone"); ?></th>
                            <th><?php echo $this->lang->line("gender"); ?></th>
                            <th><?php echo $this->lang->line("email"); ?></th>
                            <th><?php echo $this->lang->line("action"); ?></th>
                        </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="6" class="dataTables_empty"><?= lang('loading_data_from_server') ?></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
</section>
