<{import file="index/header.html"}> 
<div class="nav">
	<a href="<{$__ADMIN__}>promote/seckill">限时秒杀</a> 
	<a href="<{$__ADMIN__}>promote/seckill_time" class="ch">时间设置</a>  
</div>
<div class="filter">
	<a href="javascript:;" onClick="skt_edit('添加时间段', '<{$__ADMIN__}>promote/seckill_time_edit')" class="add">添加时间段</a>
</div>
<div class="explain">
	<div class="name"><span>操作提示</span></div>
	<div class="con">
		<p>某天的一个开始时间，开始时间一设定，即可从这个时间段开始。</p> 
		<p>目前的活动的时长为:<{$UQCMS.order_seckill_time}>, 超出则恢复原价。</p>
	</div> 
</div> 
<div class="main"> 
	<table class="ltable">
	  	<thead>
		  	<tr> 
				<th width="30"><input type="checkbox" class="checked_all"/></th> 
				<th width="100">操作</th> 
				<th width="300">活动时间</th> 
				<th width="120">状态</th>
				<th></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>
							<a href="javascript:;" data-id="<{$i.id}>" class="del">删除</a>
							<a href="javascript:;" onClick="skt_edit('编辑时间段', '<{$__ADMIN__}>promote/seckill_time_edit?id=<{$i.id}>')" class="edit">编辑</a>
						</td>
						<td><{$i.start_time}>点</td> 
						<td><input type="checkbox" name="status" class="type2 offline" data-id="<{$i.id}>" <{if $i.status == '1'}>checked="checked"<{/if}>/></td> 
						<td></td>
					</tr>
				<{/foreach}>
			<{else}>
				<tr><td colspan="6">还没有数据，赶快添加吧！</td></tr>
			<{/if}>
		</tbody>
	</table>
	<{if $data.page}>
		<div class="operate"><div class="tpage"><{$data.page}></div></div>
	<{/if}>
</div>
<{import file="index/footer.html"}> 
<script type="text/javascript">
function skt_edit(name, url){  
	parent.dialog(name, url); 
}
_delete("<{$__ADMIN__}>promote/seckill_time_del", '.del_ck');
$(function(){
	 $("input.offline").click(function(){
		id = $(this).attr('data-id'); 
		$.post('<{$__ADMIN__}>promote/seckill_time_status?id='+id, function(result){
			data = jQuery.parseJSON(result); 
			if(data.error == '0'){
				$.alert('操作成功'); 
			}else{
				$.alert(data.msg);
			}
		}); 
	});
});
</script>