<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase.php');?>
<div class="marauto" style="margin-top: 6px;margin-right: 5px;">
	<div class="searchParam" id="shop-index-ser-pa">
		<form method="get">
		<b>店铺名称：</b><input type="text"  class="form-control" name="shopname" value="<?php echo $Params['shopname'];?>" placeholder="店铺名称或者企业名称">&nbsp;&nbsp;&nbsp;&nbsp;
		<b>卖家昵称/手机：</b><input type="text"  class="form-control" name="username" value="<?php echo $Params['username'];?>" placeholder="店铺联系人昵称/手机">&nbsp;&nbsp;&nbsp;&nbsp;
		<b>店铺状态：</b><select  class="form-control" name="status">
			<option >--所有--</option>
			<option <?php if($Params['status']=='using'){echo 'selected';}?> value="using">正常</option>
			<option <?php if($Params['status']=='forbidden'){echo 'selected';}?> value="forbidden">禁用</option>
			<option <?php if($Params['status']=='stop'){echo 'selected';}?> value="stop">停用</option>
			<option <?php if($Params['status']=='open'){echo 'selected';}?> value="open">开通中</option>
		</select> &nbsp;&nbsp;&nbsp;&nbsp;
            <b>目录：</b>
            <select  class="form-control" name="mulu">
            <option >--所有--</option>
            <option <?php if($Params['mulu'] == 1){echo 'selected';}?> value="1">已开通</option>
            <option <?php if(is_numeric($Params['mulu']) && $Params['mulu'] == 0){echo 'selected';}?> value="0">未开通</option>
            </select>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>公众号：</b>
            <select  class="form-control" name="gongzhonghao">
                <option >--所有--</option>
                <option <?php if($Params['gongzhonghao'] == 1) { echo 'selected';} ?> value="1">已开通</option>
                <option <?php if(is_numeric($Params['gongzhonghao']) && $Params['gongzhonghao'] == 0) { echo 'selected';} ?> value="0">未开通</option>
            </select>&nbsp;&nbsp;&nbsp;&nbsp;
            <b>机器人：</b>
            <select  class="form-control" name="robot">
                <option >--所有--</option>
                <option <?php if($Params['robot'] == 1) { echo 'selected';} ?> value="1">已开通</option>
                <option <?php if(is_numeric($Params['robot']) && $Params['robot'] == 0) { echo 'selected';} ?> value="0">未开通</option>
            </select>&nbsp;&nbsp;&nbsp;&nbsp;
		<button type="submit" class="btn btn-primary"> 查 询 </button>&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>shop/openShop" class="btn btn-primary" target="_blank">开通店铺</a>
	</form>
	</div>
	<table id="shop-list-all" class="table table-bordered table-hover YpTable" style="margin-bottom: 10px;">
		<thead class="Filter Sortable">
			<tr>
				<th class="center Sort" width="60px"><span>ID</span></th>
				<th class="center Sort" width="220px"><span>店铺名称</span></th>
				<th class="center Sort"><span>企业名称</span></th>
				<th class="center Sort" width="60px"><span>状态</span></th>
				<th class="center Sort" ><span>会员名</span></th>
				<th class="center Sort" sort="float" width="60px"><span>配件数</span></th>
				<th class="center Sort" sort="float" width="60px"><span>已上架</span></th>
				<!--<th class="center Sort" width="60px"><span>合同</span></th>-->
				<th class="center Sort" width="80px"><span>负责人</span></th>
				<th class="center Sort" width="100px"><span>负责人电话</span></th>
                <th class="center Sort" width="60px"><span>机器人</span></th>
				<th class="center Sort" width="80px"><span>目录</span></th>
				<th class="center Sort" width="90px"><span>商城版目录</span></th>
				<th class="center" width="80px">操作</th>
			</tr>
		</thead>
		<tbody>
            <?php if(!empty($allShopMsg)){ ?>
                <?php foreach($allShopMsg as $k => $v ){ ?>
                    <tr>
                        <td><?php echo $v['shop_id'];?></td>
                        <td><a class="a_blue" href="<?php echo $v['shop_domain'];?>" target="_blank"><?php echo $v['shop_name'];?></a></td>
                        <td><?php echo $v['shop_com_name'];?></td>
                        <td style="<?php if($v['shop_status']!=1){echo 'color:red';}?>" ><?php echo $shopStatusDes[$v['shop_status']];?></td>
                        <td><?php echo $v['ub_username'];?></td>
                        <td class="right"><?php echo empty($shopProNums[$v['shop_id']])?0:$shopProNums[$v['shop_id']];?></td>
                        <td class="right"><?php echo empty($shopProNumsSelling[$v['shop_id']])?0:$shopProNumsSelling[$v['shop_id']];?></td>
                        <!--<td style="text-align: center;"><?php if($heTongArr[$v['shop_id']]){ echo '有';}?></td>-->
                        <td><?php echo $v['shop_main_name'];?></td>
                        <td><?php echo $v['shop_main_tel'];?></td>
                        <td class="center">
                            <?php if(in_array($v['shop_uid'], $robotArr)){?>
                                <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>shop/robot?wr_uid=<?php echo $v['shop_uid'];?>"  class="a_blue" target="_blank">浏览</a>&nbsp;&nbsp;
                            <?php }else{?>
                                <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>shop/robotSet?wr_uid=<?php echo $v['shop_uid'];?>" target="_blank">开通</a>
                            <?php } ?>
                        </td>
                        <td class="center">
                            <?php if(!empty($superArr[$v['shop_id']])){?>
                                <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>shop/superSet?ssu_id=<?php echo $superArr[$v['shop_id']];?>"  class="a_blue" target="_blank">配置</a>&nbsp;&nbsp;
                                <a href="<?php echo mvc::$cfg['HOST']['super'].$v['shop_id'];?>/index.php" class="a_blue" target="_blank">浏览</a>
                            <?php }else{?>
                                <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>shop/superSet?shop_id=<?php echo $v['shop_id'];?>" target="_blank">开通</a>
                            <?php } ?>
                        </td>
                        <td class="center">
                            <?php if(in_array($v['shop_id'], $gzhArr)){?>
                                <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>shop/gzhEdit?shopid=<?php echo $v['shop_id'];?>" class="a_blue" target="_blank">配置</a>&nbsp;&nbsp;
                                <a href="https://gzh.paojd.cn/<?php echo $v['shop_id'];?>/index.php" class="a_blue" target="_blank">浏览</a>
                            <?php }else{?>
                                <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>shop/gzhEdit?shopid=<?php echo $v['shop_id'];?>" target="_blank">开通</a>
                            <?php } ?>
                        </td>
                        <td>
                            <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>shop/detail?id=<?php echo $v['shop_id'];?>" title="编辑" class="Img Edit" target="ListFrame"></a>&nbsp;&nbsp;
                            <a href="<?php echo mvc::$cfg['ADMIN_URI'];?>product/batchAct?shopId=<?php echo $v['shop_id'];?>" target="_blank">导入</a>
                        </td>
                    </tr>
                <?php } ?>
            <?php } ?>

		</tbody>
	</table>
	<?php echo $Page;?>
</div>
<div class="modal fade" id="changeStatusModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">填写原因</h4>
            </div>
            <div class="modal-body">
				<div class="liuyan-wrap" style="display: block;">
					<textarea placeholder="需要在此填写原因！" class="form-control liuyan-textarea"></textarea>
				</div>
            </div>
            <div class="modal-footer center">
                <button type="button" id="finishStatusChange" class="btn btn-primary">提交</button>
            </div>
        </div>
    </div>
</div>
