<?php include_once(mvc::$cfg['PATH_TPL'] . 'seller/publicHead.php'); ?>
<style type="text/css">
    .lay-inline {display: inline;width: auto;}
    .main_middle{width: 88%;}
    #searchTable .layui-form-item .layui-inline{margin-top: 10px;}
</style>
<div class="maintb">
    <div id="memberList-main-middle" class="main_middle">
        <div class="layui-tab layui-tab-card">
            <ul class="layui-tab-title">
                <li>
                    <a href="<?php echo mvc::$cfg['SELF_URL']; ?>seller/memberList" style="color:#000">店铺会员</a>
                </li>
                <li>
                    <a href="<?php echo mvc::$cfg['SELF_URL']; ?>seller/member" style="color:#000">会员等级</a>
                </li>
                <li>
                    <a href="<?php echo mvc::$cfg['SELF_URL']; ?>seller/memberColl" style="color:#000">店铺收藏</a>
                </li>
                <li class="layui-this">
                    <a href="<?php echo mvc::$cfg['SELF_URL']; ?>seller/memberBlack">黑名单</a>
                </li>
            </ul>
            <div class="layui-tab-conten" style="padding:10px">
                <div id="searchTable">
                    <form class="form-inline layui-form" action="<?php echo mvc::$cfg['SELF_URL']; ?>seller/memberBlack" method="get" id="searchForm">
                        <div style="display:flex">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">手机号</label>
                                    <div class="layui-input-block">
                                        <textarea name="userMobile" style="width:180px;height:70px;" onchange="strToNumRow(this)" placeholder="多个手机号用,分割或者换行隔开" class="layui-textarea"><?php echo $_GET['userMobile']; ?></textarea>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">用户名</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input lay-inline" name="userName" placeholder="用户名" value="<?php echo $_GET['userName']; ?>">
                                    </div>
                                </div>
                                <div class="layui-inline" style="margin-left:20px">
                                    <button type="button" class="layui-btn" onclick="return submit();">搜索</button>
                                    <button type="button" class="layui-btn layui-btn-primary" onclick="window.location.href='<?php echo mvc::$cfg['SELF_URL']; ?>seller/memberBlack'">清空</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div style="margin-top:10px;" class="inner_container">
                    <table style="border: 1px solid #ccc;" class="layui-table">
                        <thead>
                            <tr>
                                <th width="20px"><input type="checkbox" onclick="checkallcheckbox(this)" name="checkall" /></th>
                                <th width="100px">用户名</th>
                                <th width="100px">手机号</th>
                                <th width="80px">姓名</th>
                                <th width="200px">公司名称</th>
                                <th width="140px">地区</th>
                                <th>备注</th>
                                <th width="120px">拉黑时间</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php if (!empty($data)) { ?>
                                <?php foreach ($data as $key => $value) { ?>
                                    <tr>
                                        <td><input type="checkbox" name="memluid[]" class="memluids" value="<?php echo $value['meb_uid']; ?>" /></td>
                                        <td><?php echo $value['u_name']; ?></td>
                                        <td><?php echo $value['u_mobile']; ?></td>
                                        <td><?php echo $value['meml_realname'] ? $value['meml_realname'] : $value['u_real_name']; ?></td>
                                        <td><?php echo $value['meml_comname'] ? $value['meml_comname'] : $value['ui_company']; ?></td>
                                        <td><?php echo $value['address']; ?></td>
                                        <td><?php echo $value['meb_remark']; ?></td>
                                        <td><?php echo date('Y-m-d H:i:s', $value['meb_atime']); ?></td>
                                    </tr>
                                <?php } ?>
                            <?php } else { ?>
                                <tr>
                                    <td colspan="8" class="center orange">非常抱歉，未找到对应条件的黑名单会员</td>
                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                    <div class="padtb5"></div>
                    <div style="float: left;">
                        <button class="layui-btn layui-btn-danger" onclick="delBlackList()">取消黑名单</button>
                    </div>
                    <?php echo $Page; ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'] . 'public/footBase.php'); ?>
<script type="text/javascript">
    function strToNumRow(obj){
        var rowArr = $(obj).val().replace(/[\s,;，；]/g, '\n');
        $(obj).val(rowArr);
    }
    function submit() {
        $('#searchForm').submit();
    }
</script>
