<?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">
				<a href="/seller/addSellerTemplate" class="btn btn-default" role="button">新增运费模板</a>
			</div>
			<div>
				<?php if(count($list)){?>
				<?php foreach ($list as $k => $v){?>
				<table class="table table-bordered template_table">
					<thead>
						<tr class='info'>
							<th class="red3"><?php echo $v['frt_name'];?></th>
							<th colspan="5">
								<label id="default_template" class="marr10"><input type="radio" <?php if ($v['frt_default']=='Y'){?> checked <?php }?> onchange="setTemplateDefault(<?php echo $v['frt_id'];?>);" name="default_template"><b>默认模板</b></label>
								<a class="a_blue marr5" href="/seller/addSellerTemplate?frt_tid=<?php echo $v['frt_id'];?>">修改</a>
								<a class="a_blue deleteTemplate" href="javascript:;" addid="<?php echo $v['frt_id'];?>">删除</a>
								<span class="floatr gray2 marr10">最后编辑<?php echo date('Y-m-d H:i:s',$v['frt_last_time'])?></span>
							</th>
						</tr>
						<tr>
							<th width="100px">运送方式</th>
							<th>运送到</th>
							<th width="65px">首<?php if ($v['frt_valuation_method']==0){echo '件(件)';}else if ($v['frt_valuation_method']==1){echo '重(kg)';}?></th>
							<th width="65px">运费(元)</th>
							<th width="65px">续<?php if ($v['frt_valuation_method']==0){echo '件(件)';}else if ($v['frt_valuation_method']==1){echo '重(kg)';}?></th>
							<th width="65px">运费(元)</th>
						</tr>
					</thead>
					<tbody>
						<?php $index=1;?>
						<?php foreach ($v['link'] as $i => $j){?>
							<tr>
							<?php if($index==1||$index==$v['total'][0]+1){?>
								<td rowspan="<?php echo $v['total'][$j['ftl_shipping_method']];?>"><?php if ($j['ftl_shipping_method']==0){?> 快递 <?php }else if ($j['ftl_shipping_method']==1){?> EMS <?php }?></td>
							<?php }?>
								<td><?php if ($j['path']==''){?>默认 <?php }else{echo $j['path'];}?></td>
								<td><?php echo $j['ftl_begin_count'];?></td>
								<td><?php echo sprintf('%.2f',$j['ftl_begin_money']);?></td>
								<td><?php echo $j['ftl_next_count'];?></td>
								<td><?php echo sprintf('%.2f',$j['ftl_next_money']);?></td>
							</tr>
						<?php $index++;}?>
					</tbody>
				</table>
				<div class="padtb5"></div>
				<?php }?>
				<?php }else{?>
				<div class="red2" align="center">未找到符合条件的运费模板</div>
				<?php }?>
			</div>
		</div>
		<div class="clear"></div>
	</div>
</div>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footAll.php');?>
<script type="text/javascript" src="/static/js/collhop.js?ver=<?php echo mvc::$cfg['VER']['js'];?>"></script>
<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', 0, 'province');
	$('.deleteTemplate').click(function(){
		MESSAGE.confirm('确定要删除此模板吗？', 'TOURL.go("/seller/deleteSellerTemplate?frt_id='+$(this).attr('addid')+'")');
		return false;
	});
})
</script>
