<{import file="index/header.html"}> 
<div class="nav"><span>优惠券</span></div>
<div class="filter"> 
	<input type="button" name="del_checked" class="del_ck button" value="删除选项"/> 
	<a href="<{$__ADMIN__}>promote/coupon" class="option <{if $smarty.get.type == ''}>option_ch<{/if}>">全部</a>
	<a href="<{$__ADMIN__}>promote/coupon?type=1" class="option <{if $smarty.get.type == '1'}>option_ch<{/if}>">未开始</a> 
	<a href="<{$__ADMIN__}>promote/coupon?type=2" class="option <{if $smarty.get.type == '2'}>option_ch<{/if}>">进行中</a> 
	<a href="<{$__ADMIN__}>promote/coupon?type=3" class="option <{if $smarty.get.type == '3'}>option_ch<{/if}>">已结束</a> 
</div>
<div class="main"> 
	<table class="ltable">
	  	<thead>
		  	<tr> 
				<th width="30"><input type="checkbox" class="checked_all"/></th> 
				<th width="100">店铺</td> 
				<th>名称</th>
				<th width="250">满减</th> 
				<th width="120">开始时间</th> 
				<th width="120">结束时间</th>
				<th width="65">状态</th>
				<th width="50">操作</th>
				<th width="120">时间</th>  
		  	</tr>
	  	</thead>
		<tbody>
			<{if $data.list}>
				<{foreach item=i from=$data.list}>
					<tr> 
						<td><input name="key_id[]" type="checkbox" value="<{$i.id}>" class="checked_list"/></td> 
						<td><{$i.shop_name}></td> 
						<td><{$i.name}></td>
						<td>满<{$i.full_price}>减<{$i.price}></td>
						
						<td><{$i.start_time}></td> 
						<td><{$i.end_time}></td> 
						<td><input type="checkbox" name="status" class="type2 offline" data-id="<{$i.id}>" <{if $i.status == '1'}>checked="checked"<{/if}>/> </td> 
						<td><a href="javascript:;" data-id="<{$i.id}>" class="del">删除</a></td>
						<td><{$i.addtime}></td>
					</tr>
				<{/foreach}>
			<{else}>
				<tr><td colspan="8">还没有数据，赶快添加吧！</td></tr>
			<{/if}>
		</tbody>
	</table> 
	<{if $data.page}><div class="tpage"><{$data.page}></div><{/if}>
</div>
<{import file="index/footer.html"}> 
<script type="text/javascript">
_delete("<{$__ADMIN__}>promote/coupon_del", '.del_ck'); 
$(function(){
	$("input.offline").click(function(){
		id = $(this).attr('data-id'); 
		$.post('<{$__ADMIN__}>promote/coupon_status?id='+id, function(result){
			data = jQuery.parseJSON(result);
			if(data.error == '0'){
				$.alert('操作成功'); 
			}else{
				alert(data.msg);
			}
		}); 
	});
});
</script>