<div class="page-title">
    <h1><?php echo $this->user->lang("Invoice Transactions");?></h1>
</div>
<div class="cm-holder dt-info">
    <div class="head padding-bottom">
        <div class="dt-header">
            <div class="dt-header-left">
                <div class="dt-filters">
                </div>
            </div>

            <!-- RIGHT SIDE -->
            <div class="dt-header-right">
                <div class="filter-group dt-length"></div>
            </div>
        </div>
    </div>
    <div class="dt-wrapper pull-top">
        <div class="table-responsive">
            <table id="table-list" class="display" style="width:100%">
                <thead>
                    <tr>
                        <th class=""><?php echo $this->user->lang('Date'); ?></th>
                        <th class=""><?php echo $this->user->lang('Invoice'); ?></th>
                        <th class=""><?php echo $this->user->lang('Transaction Id'); ?></th>
                        <th class=""><?php echo $this->user->lang('Amount'); ?></th>
                        <th class=""><?php echo $this->user->lang('Result'); ?></th>
                        <th class=""><?php echo $this->user->lang('Action'); ?></th>
                        <th class=""><?php echo $this->user->lang('Plugin'); ?></th>
                    </tr>
                </thead>
            </table>
        </div>
        <div class="table-actions">
        </div>
    </div>
</div>

<script>
    $(document).ready(function() {
        var ajaxUrl = 'index.php?fuse=admin&action=doplugin&controller=plugin&type=snapin&plugin=cetransactions&pluginaction=getTransactions';
        var table = $('#table-list').DataTable({
            "searching": false,
            "ajax": {
                url: ajaxUrl,
                dataSrc: 'data',
                data: function(d) {
                    d.sort = 'id';
                    d.dir = 'asc';
                    d.userid = clientexec.customerId;
                    d.limit = clientexec.records_per_view;
                }
            },
            "columns": [
                {
                    "data": "transactiondate",
                },
                {
                    "data": "invoiceid",
                },
                {
                    "data": "transactionid",
                },
                {
                    "data": "amount",
                },
                {
                    "data": "response",
                },
                {
                    "data": "action",
                },
                {
                    "data": "pluginused",
                },
            ]
            ,
            "order": [[1, 'asc']]
        });
    });
</script>