<link rel="stylesheet" href="<?php echo base_url();?>public/js/date/datedropper.min.css">
<script src="<?php echo base_url();?>public/js/date/datedropper.min.js"></script>

<!-- Select2 -->
<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/select2/select2.min.css">
<script src="<?php echo base_url();?>public/js/vendor/select2/select2.full.min.js"></script>

<div class="content_wrapper">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>同设备用户查询</header>
                    <section>
                        <div class="row">
                            <div class="col-sm-12">
                                <form class="form-inline">
                                    <span class="gap"></span>
                                    <div class="form-group">
                                        <label>玩家id：</label>
                                        <input type="text" class="form-control" placeholder="用户UID" name="userid" id="userid" value="<?php echo $uid ?? '';?>">
                                    </div>
                                    <span class="gap"></span>
                                    <div class="form-group">
                                        <label>MAC地址：</label>
                                        <input type="text" class="form-control" placeholder="MAC地址" name="mac" id="mac" value="<?php echo $mac ?? '';?>">
                                    </div>
                                    <button type="button" class="btn btn-primary" id="SubmitBtn">查询</button>
                                </form>
                            </div>
                        </div>
                        <br>
                        <!--展示-->
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="table-responsive">
                                        <table class="table table-striped table-bordered table-hover"  width="100%" style="word-break:break-all; word-wrap:break-word; ">
                                            <thead>
                                            <tr>
                                                <th>uid</th>
                                                <th>昵称</th>
                                                <th>头像</th>
                                                <th>email</th>
                                                <th>最后登录时间</th>
                                                <th>mac</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php
                                            foreach ($list as $item){
                                                echo "<tr>";
                                                echo "
                                                <td>{$item['uid']}</td>
                                                <td>{$item['nick']}</td>
                                                <td><img src='{$item['b_picture']}' alt=''></td>
                                                <td>{$item['email']}</td>
                                                <td>".date("Y-m-d H:i:s",$item['lasttime'])."</td>
                                                <td>{$item['mac']}</td>";
                                                echo "</tr>";
                                            }
                                            ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>
</div>
<script>

    $('#SubmitBtn').click(function(){
        console.log(1)
        var userId = $('#userid').val();
        var mac = $('#mac').val();
        if(!userId)userId = 0
        var url = rootPath+"#customer/souchUserAccount/"+userId+'/'+escape(mac);
        window.location.href = url
    });

</script>