<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/smalot_bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
<script src="<?php echo base_url();?>public/js/vendor/smalot_bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="<?php echo base_url();?>public/js/vendor/smalot_bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<div class="content_wrapper">

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline" role="form" method="POST" action="#user/moneylog?stime=<?php echo $stime?>&etime=<?php echo $etime?>">
                                        <input type="hidden" name="frommoneylog_user" value="1">
                                        <div class="form-group">
                                            <label>用户UID:</label>
                                            <input type="text" class="form-control" value="<?php if($uid) echo $uid;?>" placeholder="用户UID" name="userid">
                                        </div>
                                        <span class="gap"></span>
                                        <div class="form-group">
                                                <label>开始时间</label>
                                                <input type="text" class="form-control datetimepicker" value="<?php if($stime) echo $stime;?>" placeholder="开始时间" name="moneylog_stime" />
                                        </div>
                                        <span class="gap"></span>
                                        <div class="form-group">
                                                <label>结束时间</label>
                                                <input type="text" class="form-control datetimepicker" value="<?php if($etime) echo $etime;?>" placeholder="结束时间" name="moneylog_etime" />
                                        </div>
                                        <button type="button" class="btn btn-primary">查询</button>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>用户金币流水</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="table-responsive">
                                        <table id="example" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>用户ID</th>
                                                <th>sid</th>
                                                <th>gameid</th>
                                                <th>输赢变化</th>
                                                <th>当前金币</th>
                                                <th>操作类型</th>
                                                <th>时间</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php
                                            if(is_array($list)){
                                                foreach ($list as $key => $val) {
                                                    ?>
                                                    <tr>
                                                        <td><?php echo '<a target = "_blank" href="#user/index/'.$val['uid'].'">'.$val['uid'].'</a>';?></td>
                                                        <td><?php echo $val['sid'];?></td>
                                                        <td><?php echo $val['gameid'];?></td>
                                                        <td><?php echo $val['changeMoney'];?></td>
                                                        <td><?php echo $val['afterChangeMoney'];?></td>
                                                        <td><?php echo $actionIdType[$val['actID']] ?? $val['actID'];?></td>
                                                        <td><?php echo date('Y-m-d H:i:s', $val['actiontime']);?></td>
                                                    </tr>
                                                <?php } } else{?>
                                                <tr>
                                                    <td colspan="10">暂无数据</td>
                                                </tr>
                                            <?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                    <nav>
                                        <ul class="pagination">
                                            <li class="disabled"><a href="#">共<span class="pagetotal"><?php echo $total;?></span>条</a></li>
                                            <?php echo $pageurl;?>
                                        </ul>
                                    </nav>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>

</div>

<script>
    $('.datetimepicker').datetimepicker({
        format: 'yyyy-mm-dd hh:ii:ss',
        locale: 'zh-cn'
    });
</script>