<?php
/* @var $this \yii\web\View */
use yii\helpers\Url;

$this->title = '名下账户出金报表';
?>
<?php $this->beginBlock('header_script'); ?>
<link href="<?= STATIC_URL ?>/ui/css/plugins/dataTables/datatables.min.css" rel="stylesheet">
<div class="row">
    <div class="col-md-3">
        <?= $this->render('/common/_inner_left_menu.php', ['login' => $login]) ?>
    </div>
    <div class="col-md-9">
        <div class="ibox">
            <div class="ibox-title">
                <h2>出金报表</h2>
            </div>
            <form>
                <input type="hidden" name="type" value="withdraw">
                <input type="hidden" name="login" value="<?= $login ?>" />
                <div class="ibox-content m-b-sm border-bottom">
                    <div class="row">
                        <div class="col-sm-4">
                            <div class="form-group">
                                <label class="control-label" for="price">开始时间</label>
                                <input readonly="readonly" type="text" id="sTime" name="sTime" value="" placeholder="开始时间" class="data form-control">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group">
                                <label class="control-label" for="quantity">结束时间</label>
                                <input readonly="readonly" type="text" id="eTime" name="eTime" value="" placeholder="结束时间" class="data form-control">
                            </div>
                        </div>
                        <div class="col-sm-4">
                            <div class="form-group">
                                <label class="control-label" for="quantity">操作</label>
                                <input type="submit" class="btn btn-primary form-control" value="搜索">
                            </div>
                        </div>
                    </div>
                </div>
            </form>
            <div class="ibox-content">
                <div class="table-responsive">
                    <table id="datatables" class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>订单号</th>
                            <th>金额</th>
                            <th>时间</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->beginBlock('footer_script'); ?>
<script src="<?= STATIC_URL ?>/ui/js/plugins/dataTables/datatables.min.js"></script>
<script>
    var table;
    $(document).ready(function () {
        table = $('#datatables').DataTable({
            <?php if (isset($isHaveAdmin) && $isHaveAdmin == true) : ?>
            "aLengthMenu": [[20,50,100,500,999999999], [20,50,100,500,"ALL"]],
            <?php else : ?>
            "aLengthMenu": [[20,50,100,500], [20,50,100,500]],
            <?php endif; ?>
            language: {
                "sProcessing": "处理中...",
                "sLengthMenu": "显示 _MENU_ 项结果",
                "sZeroRecords": "没有匹配结果",
                "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
                "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                "sInfoPostFix": "",
                "sSearch": "搜索:",
                "sUrl": "",
                "sEmptyTable": "表中数据为空",
                "sLoadingRecords": "载入中...",
                "sInfoThousands": ",",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上页",
                    "sNext": "下页",
                    "sLast": "末页"
                },
                "oAria": {
                    "sSortAscending": ": 以升序排列此列",
                    "sSortDescending": ": 以降序排列此列"
                }
            },
            "processing": true,
            "serverSide": true,
            "ajax": '<?= Url::to(['strades/index', 'type' => 'withdraw', 'login' => Yii::$app->getRequest()->get('login'), 'sTime' => Yii::$app->getRequest()->get('sTime'), 'eTime' => Yii::$app->getRequest()->get('eTime')]) ?>',
            "order": [[0, "desc"]],
            "columns": [{
                "data": "TICKET"
            },
                {
                    "data": "PROFIT"
                },
                {
                    "data": "OPEN_TIME"
                }],
            "sPaginationType": "full_numbers",
            dom: '<"html5buttons"B>lTfgitp',
            buttons: [{
                extend: 'copy'
            },
                {
                    extend: 'csv'
                },
                {
                    extend: 'excel'
                },
                {
                    extend: 'pdf'
                },
                {
                    extend: 'print',
                    customize: function (win) {
                        $(win.document.body).addClass('white-bg');
                        $(win.document.body).css('font-size', '10px');
                        $(win.document.body).find('table').addClass('compact').css('font-size', 'inherit');
                    }
                }]
        });
        $('#datatables tbody').on('click', 'tr',
            function () {
                if ($(this).hasClass('selected')) {
                    $(this).removeClass('selected');
                } else {
                    table.$('tr.selected').removeClass('selected');
                    $(this).addClass('selected');
                }
            });
    });
</script>
<?php $this->endBlock(); ?>




