<?php include_once(mvc::$cfg['PATH_TPL'].'public/topSeller.php');?>
<div class="maintb">
	<?php include_once(mvc::$cfg['PATH_TPL'].'seller/leftMenu.php');?>
	<div class="main_middle">
		<div class="mod-main ">
			<div class="mod-main-nav-box " id="my_mod-main-nav-box">
				<button type="button" class="btn btn-default " onclick="ADDRLAYER.show('seller','set_addr_form', 0)">新增发货地址</button>
			</div>			
			<table class="table table-bordered martb10" id="my_list">
				<thead>
					<tr>
						<th>别名</th>
						<th>联系人</th>
						<th>所在地区</th>
						<th>详细地址</th>
						<th>联系电话</th>
						<th width="85px">操作</th>
						<th width="85px">默认发货地址</th>
						<th width="85px">默认退货地址</th>
					</tr>
				</thead>
				<tbody>
				<?php if ($Mylist){?>
					<?php foreach ($Mylist as $k=>$v){?>
					<tr >
						<td><?php echo $v['addr_alias'];?></td>
						<td><?php echo $v['addr_name'];?></td>
						<td><?php echo $v['pathname'];?></td>
						<td><?php echo $v['addr_address'];?></td>
						<td><?php echo $v['addr_tel'];?></td>
						<td>
							<a class="a_blue marr5" href="javascript:void(0);" onclick="ADDRLAYER.show('seller','set_addr_form',<?php echo $v['addr_id'];?>);return false;">编辑</a>
							<a class="a_blue mar5 delAddr" addid="<?php echo $v['addr_id'];?>" href="javascript:">删除</a>
						</td>
						<td class="center">
							<input onchange="setAddr(<?php echo $v['addr_id'];?>,'default','seller');return false;" type="radio" name="default" value="1" <?php if ($v[ 'addr_send_default']==1){?> checked <?php }?>>
						</td>
						<td class="center">
							<input onchange="setAddr(<?php echo $v['addr_id'];?>,'refund','seller');return false;" type="radio" name="refund" value="1" <?php if ($v[ 'addr_refund_default']==1){?> checked <?php }?>>
						</td>
					</tr>
					<?php }?>
				<?php }else{?>
					<tr>
						<td colspan="8" class="center orange">非常抱歉，未找到对应条件的地址记录</td>
					</tr>
				<?php }?>
				</tbody>
			</table>
			
		</div>
		<div class="clear"></div>
	</div>
</div>
<!-- Modal -->
<div class="modal" id="layer_box" tabindex="-1" role="dialog" aria-labelledby="layer_box">
	<div class="modal-dialog modal-lg" role="document">
		<div class="modal-content"></div>
	</div>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footAll.php');?>
<script type="text/javascript" src="/static/js/addr.js?ver=<?php echo mvc::$cfg['VER']['js'];?>"></script>
<script>
$(document).ready(function() {
	ADDR.init('province_box', '<?php echo $AddrDetail["addr_pct_ids"];?>', 'province');
	ADDR.usuallAddr('ubtn');
	$('.delAddr').click(function(){
		MESSAGE.confirm('确定要删除此发货地址吗？', 'TOURL.go("/seller/addressDelete?addid='+$(this).attr('addid')+'")');
		return false;
	});
})
</script>
