<{include 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="?m=goods" class="<{if $smarty.get.status == ''}>option_ch<{else}>option<{/if}>">全部</a>
	<a href="?m=goods&status=1" class="<{if $smarty.get.status == '1'}>option_ch<{else}>option<{/if}>">已通过</a>
	<a href="?m=goods&status=2" class="<{if $smarty.get.status == '2'}>option_ch<{else}>option<{/if}>">已失效</a>
	<a href="?m=goods&status=0" class="<{if $smarty.get.status == '0'}>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 width="100%" class="ltable">
	  	<thead>
		  	<tr>
				<th width="30"><input type="checkbox" class="checked_all"/></th>
				<th width="80">分类</th>
				<th width="40">图片</th>
				<th>标题</td> 
				<th width="120">店铺</th>
				<th width="40" class="center">主页</th>
				<th width="40" class="center">热卖</th>
				<th width="40" class="center">推荐</th>
				<th width="50">销量</th>
				<th width="50">库存</th>
				<th width="50">状态</th> 
				<th width="140">操作</th>
				<th width="80">时间</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.cats_cn}></td>
					<td><a href="index.php?m=goods&a=detail&id=<{$i.id}>" target="_blank"><img src="<{$__IMG__}><{$i.images|img_size:50x50}>" width="35" height="35"/></a></td> 
					<td valign="top"><a href="index.php?m=goods&a=detail&id=<{$i.id}>" target="_blank"><{$i.title}></a></td> 
					<td><{$i.shop_name}></td>
					<td class="center"><a href="javascript:status('<{$i.id}>','px_index')" id="px_index_<{$i.id}>"><img src="<{$__APP__}>public/images/status_<{$i.px_index}>.png"></a></td>
					<td class="center"><a href="javascript:status('<{$i.id}>','px_hot')" id="px_hot_<{$i.id}>"><img src="<{$__APP__}>public/images/status_<{$i.px_hot}>.png"></a></td>
					<td class="center"><a href="javascript:status('<{$i.id}>','px_recommend')" id="px_recommend_<{$i.id}>"><img src="<{$__APP__}>public/images/status_<{$i.px_recommend}>.png"></a></td>
					<td><{$i.volume}></td>
					<td><{$i.stock}></td>
					<td>
						<{if $i.status == '1'}>
							<a href="?m=goods&a=status&id=<{$i.id}>">下线</a>
						<{else}>
							<a href="?m=goods&a=status&id=<{$i.id}>"><span style="color:#FF0000; font-weight:bold;">上线</span></a>
						<{/if}> 
					</td> 
					<td>
						<a href="?m=shop&a=enter_shop&id=<{$i.shop_id}>&url=<{'member.php?m=goods&a=edit&id='|cat:$i.id|escape:'url'}>" class="edit" target="_blank">进店编辑</a>
						<a href="javascript:;" data-id="<{$i.id}>" class="del">删除</a>
					</td>
					<td><{$i.addtime}></td>
				</tr>
			<{/foreach}>
		<{else}>
	  			<tr><td colspan="13">还没有数据，赶快添加吧！</td></tr>
		<{/if}>
		</tbody>
	</table>
	<div class="operate">
		<{if $data.page}><div class="tpage"><{$data.page}></div><{/if}>
	</div>
</div>
<{include file="index/footer.html"}> 
<script type="text/javascript">
_delete("?m=goods&a=del", '.del_ck');
function status(id,type){
	$.post("?m=goods&a=px_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>