<{include file="index/header.html"}> 
<div class="nav">
	<a href="?m=goods_act&a=group">拼团团购</a> 
	<a href="?m=goods_act&a=group_order" class="ch">拼团订单</a> 
</div>  
<div class="filter"> 
	<a href="?m=goods_act&a=group_order" class="<{if $smarty.get.status == ''}>option_ch<{else}>option<{/if}>">全部</a>
	<a href="?m=goods_act&a=group_order&status=0" class="<{if $smarty.get.status == '0'}>option_ch<{else}>option<{/if}>">发起</a>  
	<a href="?m=goods_act&a=group_order&status=1" class="<{if $smarty.get.status == '1'}>option_ch<{else}>option<{/if}>">成功</a>
	<a href="?m=goods_act&a=group_order&status=4" class="<{if $smarty.get.status == '4'}>option_ch<{else}>option<{/if}>">失败</a> 
	<form action="#" method="get">
		<input type="hidden" name="m" value="goods"/>	
		<input type="hidden" name="a" value="index"/>
		<div class="sch">
			<input type="text" name="key" class="text" value="" placeholder="请输入产品关键字"/>
			<input type="submit" class="submit" value="确定"/>
		</div>
	</form> 
</div>
<div class="main"> 
	<table class="ltable">
	  	<thead>
		  	<tr> 
				<th width="40">图片</th>
				<th width="380">标题</td> 
				<th width="60">人数</th>
				<th width="120">开始时间</th>
				<th width="120">结束时间</th> 
				<th width="60" class="center">通过</th>
				<th width="160">操作</th>
				<th width="120"></th>
				<th></th>
		  	</tr>
	  	</thead>
		<tbody>
		<{if $data.list}>
			<{foreach item=i from=$data.list}>
				<tr> 
					<td><a href="index.php?m=goods&a=detail&id=<{$i.gid}>" target="_blank"><img src="<{$__IMG__}><{$i.goods.images|img_size:50x50}>" width="35" height="35"/></a></td> 
					<td valign="top">
						<a href="index.php?m=goods&a=detail&id=<{$i.gid}>" target="_blank" style="width:320px; float:left;"><{$i.goods.title}></a>
					</td> 
					<td><{$i.num}></td>
					<td><{$i.start_time}></td>
					<td><{$i.end_time}></td>  
					<td class="center">
						<{if $i.status == '0'}>
							<span style="color:#f00; font-weight:bold;">发起</span>
						<{elseif $i.status == '1'}>
							成功
						<{elseif $i.status == '4'}>	
							<span style="color:#999;">失败</span>
						<{/if}>
					</td> 
					<td>
						<a href="?m=goods_act&a=group_detail&id=<{$i.id}>" class="view">查看拼团</a> 
						<a href="javascript:;" data-id="<{$i.id}>" class="del">删除</a> 
					</td>
					<td></td>
					<td></td>
				</tr>
			<{/foreach}>
		<{else}>
				<tr><td colspan="13">还没有数据，赶快添加吧！</td></tr>
		<{/if}>
		</tbody>
	</table>
	<{if $data.page}>
		<div class="operate">
			<div class="tpage"><{$data.page}></div>
		</div>
	<{/if}>
</div>
<{include file="index/footer.html"}> 
<script type="text/javascript">
_delete("?m=goods_act&a=group_order_del", '.del_ck');
function status(id,type){
	$.post("?m=goods_act&a=group_status",{id:id, type:type},function(data){
 		if(data == '0' || data == '1'){
			$("#"+type+"_"+id+" img").attr('src','<{$__APP__}>public/images/status_'+data+'.png');
		}else{ alert('更新失败'); } 
	});	
} 
</script>