<div class="resp-tabs-container tab_identifier_parent no-padding">
    <div>
        <div class="client-contact-wrapper" id="profile-fields">
            <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>
        </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({
            processing: true,
            serverSide: true,
            "searching": false,
            "ajax": {
                url: ajaxUrl,
                dataSrc: 'data',
                data: function(d) {
                    d.userid = clientexec.customerId;
                }
            },
            "columns": [
                {
                    "data": "transactiondate",
                },
                {
                    "data": "invoiceid",
                    render: function (data, type, row) {
                        console.log(row);
                        if (type === 'display') {
                            desc = "<a href='index.php?controller=invoice&fuse=billing&frmClientID="+row.userid+"&view=invoice&invoiceid="+row.invoiceid+"'>#"+data+"</a>";

                            return desc + "  <span class='invoicepdflink'><a href='index.php?sessionHash="+clientexec.sessionHash+"&fuse=billing&controller=invoice&action=generatepdfinvoice&invoiceid=" + row.invoiceid + "' target='_blank'><img class='pdfimage' src='../templates/admin/images/document-pdf-text.png' border='0' data-toggle='tooltip' title='"+ clientexec.lang('View PDF Invoice') +"' /></a></span>";
                        }

                        return data;
                    }
                },
                {
                    "data": "transactionid",
                },
                {
                    "data": "amount",
                },
                {
                    "data": "response",
                },
                {
                    "data": "action",
                },
                {
                    "data": "pluginused",
                },
            ]
            ,
            "order": [[1, 'asc']]
        });
    });
</script>