<{include file="index/header.html"}>  
<div class="nav"><span>产品关键字</span></div> 
<div class="filter"> 
	<a href="javascript:;" onClick="edit_key('编辑关键字','?m=goods&a=key_hot_edit');" class="add">添加关键字</a>
	<input type="button" name="del_checked" class="del_ck button" value="删除选项"/> 
	<form action="#" method="get">
		<input type="hidden" name="m" value="goods"/>	
		<input type="hidden" name="a" value="key_hot"/>
		<div class="sch">
			<input type="text" name="key" class="text" placeholder="请输入产品关键字"/>
			<input type="submit" class="submit" value="确定"/>
		</div>
	</form> 
</div> 
<div class="main">
	<table class="ltable">
	  	<thead>
		  	<tr>
				<th width="30"><input type="checkbox" class="checked_all"/></th> 
				<th width="300">关键字</th> 
				<th width="70">搜索量</th> 
				<th width="60">热词</th>
				<th width="60">排序</th> 
				<th width="130">操作</th>
				<th width="150">时间</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><{$i.keyword}></td>
					<td><{$i.view}></td> 
					<td><a href="javascript:status('<{$i.id}>','hot')" id="hot_<{$i.id}>"><img src="<{$__APP__}>public/images/status_<{$i.hot}>.png"></a></td>  
					<td><div id="px_<{$i.id}>" class="pxdo" pxid="<{$i.id}>"><{$i.px}></div></td>
					<td>
						<a href="javascript:;" onClick="edit_key('编辑关键字','?m=goods&a=key_hot_edit&id=<{$i.id}>');" class="edit">编辑</a>
						<a href="javascript:;" class="del" data-id="<{$i.id}>">删除</a>
					</td>
					<td><{$i.addtime}></td>
					<td></td>
				</tr>
			<{/foreach}> 
		<{else}>
			<tr><td colspan="8">还没有数据，赶快添加吧！</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&a=key_del', '.del_ck');
ajaxEdit(".pxdo","pxid",'?m=goods&a=key_px_update', 'id', 'px'); 
function edit_key(name,url){  
	parent.dialog(name,url,400); 
}  
function status(id,type){
	$.post("?m=goods&a=key_hot_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>