<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>礼品盘库</h5>
            <div class="ibox-tools">
                <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
                    <i class="fa fa-refresh"></i> 刷新
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <div class="row">
                <div class="col-md-12">
                    <table id="listTable">
                        <thead>
                        <tr>
                            <th width="50" data-field="id">ID</th>
                            <th data-field="name">名称</th>
                            <th data-field="total">总数量</th>
                            <th data-field="out_total">已出库</th>
                            <th data-field="use_total">已使用</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>


<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
    function refreshList() {
        $('#listTable').bootstrapTable('refresh');
    }

    function search() {
        $('#listTable').bootstrapTable('destroy');
        $('#listTable').bootstrapTable({
            url: "/gift/stastics-json",
            pagination: true,
            sidePagination: 'server',
            queryParams: function(params) {
                return params;
            }
        });
        return false;
    }

    $(function() {
        search();
    });
</script>
<?php $this->endBlock(); ?>