<?php include_once(mvc::$cfg['PATH_TPL'].'public/headBase.php');?>
<div class="main_auto martb10">
	<form method="post" onsubmit="return shopAccount.submit()">
		<input type="hidden" name="shopId" class="idcard" value="<?php echo $shopArr['shop_id']?>"/>
		<div class="BgMenu"><span><?php echo $shopArr['shop_name']?></span></div>
		<table class="table table-bordered" id="accountList">
			<thead>
				<tr>
					<th width="40px"><i class="icon2 icon2_add" title="添加收款人" onclick="shopAccount.add()"></i></th>
					<th width="200px">收款人（对公填公司，个人填姓名）</th>
					<th width="200px">身份证号码</th>
					<th>已绑定账号</th>
				</tr>
			</thead>
			<tbody>
				<?php if(!empty($accountBind)){?>
				<?php foreach($accountBind as $ab){?>
				<tr>
					<td>
						<i class="icon2 icon2_del" title="删除收款人" onclick="shopAccount.del(this)"></i>
						<input type="hidden" name="accb[<?php echo $ab['acb_id']?>][acb_idcard]" class="idcard" value="<?php echo $ab['acb_idcard']?>"/>
					</td>
					<td><?php echo $ab['acb_name']?></td>
					<td><?php echo $ab['acb_idcard']?></td>
					<td>
						<ul class="wxList">
						<?php if(!empty($accArr[$ab['acb_id']])){?>
						<?php foreach($accArr[$ab['acb_id']] as $acc){?>
							<?php if($acc['acc_type']==0){?>
							<li>
								<input type="hidden" name="accb[<?php echo $ab['acb_id']?>][accs][]" value="<?php echo $acc['acc_id'];?>">
								<div><img src="<?php echo $acc['acc_weixin_info']['headimgurl'];?>"/></div>
								<div class="mar5">昵称：<?php echo $acc['acc_weixin_info']['nickname'];?></div>
								<div>
									<span>微信号：<?php echo $acc['acc_weixin'];?></span>&nbsp;&nbsp;
									<a href="javascript:void(0);" onclick="shopAccount.delWx(this)" class="icon2 icon2_del"></a>
								</div>
							</li>
							<?php }else if($acc['acc_type']==1){?>
							<li>
								<input type="hidden" name="accb[<?php echo $ab['acb_id']?>][accs][]" value="<?php echo $acc['acc_id'];?>">
								<div class="mar5">类型：支付宝</div>
								<div>
									<span>账号：<?php echo $acc['acc_alipay_account'];?></span>&nbsp;&nbsp;
									<a href="javascript:void(0);" onclick="shopAccount.delWx(this)" class="icon2 icon2_del"></a>
								</div>
							</li>
							<?php }else if($acc['acc_type']==2){?>
							<li>
								<input type="hidden" name="accb[<?php echo $ab['acb_id']?>][accs][]" value="<?php echo $acc['acc_id'];?>">
								<div class="mar5">类型：<?php echo $acc['acc_bank_name'];?></div>
								<div class="mar5">支行：<?php echo $acc['acc_bank_open'];?></div>
								<div>
									<span>账号：<?php echo $acc['acc_bank_card'];?></span>&nbsp;&nbsp;
									<a href="javascript:void(0);" onclick="shopAccount.delWx(this)" class="icon2 icon2_del"></a>
								</div>
							</li>
							<?php }?>
						<?php }?>
						<?php }?>
						</ul>
					</td>
				</tr>
				<?php }?>
				<?php }?>
			</tbody>
			<tfoot class="hide">
				<tr class="new" num="#num#">
					<td><i class="icon2 icon2_del" title="删除收款人" onclick="shopAccount.del(this)"></i></td>
					<td><input type="text" class="form-control w130 realname" name="accb[#num#][acb_name]" placeholder="收款人（对公填公司，个人填姓名）"/></td>
					<td><input type="text" class="form-control w180 idcard" name="accb[#num#][acb_idcard]" placeholder="请输入收款人身份证号码"/></td>
					<td></td>
				</tr>
			</tfoot>
		</table>
		<div class="center mart10"><button type="submit" class="btn btn btn-primary w100">保存</button></div>
	</form>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>
<script type="text/javascript">
$(document).ready(function(){
	
});
</script>
