{include "header.inc.html"}
<div class="content_box">
	<div class="toolbar_box">
		<div class="toolbar"> <span> <strong>日志记录</strong><br />
		<span class="english">Log</span> </span>
		<div class="toolbar_menu">
		</div>
		</div>
	</div>
	<div class="tool">
<div class="left"><form action="{$adminUrl}log/" method="get" class="form">
		搜：<select name="keyTypeId"><option value="1"{if $smarty.get.keyTypeId==1} selected{/if}>关键字</option><option value="2"{if $smarty.get.keyTypeId==2} selected{/if}>会员名</option></select>
		<input type="text" name="key" value="{$smarty.get.key}" /><input class="btn_sub" type="submit" value="搜索">
		</form>

</div><div class="right">
		{if $smarty.get.act!="add" || $smarty.get.act!="edit"}
<a id="deleteChecked">删除所选</a>
{/if}
</div>
		<div class="clr"></div>
	</div><!--.tool-->
<div class="brandForm">
</div>
 <table class="table-ca table_1" id="tInfo">
 <tr>
<th class="w30"><input type="checkbox" value="1" name="allid" id="checkall" /></th><th class="w50">用户</th><th class="w100">IP</th><th class="">内容</th><th class="">备注</th><th class="w130">提交时间</th><th class="w50">删除</th>
 </tr>
{log limit=13 pager="true"}
<tr>
<td><input type="checkbox" name="id[]" value="{$item.id}" title="{$item.id}" /></td><td>{$item.userId}</td><td>{$item.ip}</td><td class="tleft"><div class="w800 wrap">{$item.content|escape:'html'}</div></td><td>{$item.remark}</td><td>{$item.posttime|date_format:"Y-m-d H:i:s"}</td><td><a href="javascript:void(0)" class="delBtn" sid="{$item.id}" title="{$lang.del}">删除</a></td>
</tr>
{/log}
</table>
<div class="page">
	<div class="pagin fr">{pager allCount=$allCount url='/qkadmin/log/page/' number="false"}</div>
</div>
</div><!--.content_box-->
<script type="text/javascript">
$(function(){
	$("a#deleteChecked").button().click(function(){
		if(!confirm(lang[4])){ return false; }		
		var id = [];
		$("input[name='id[]']:checkbox:checked").each(function(index){
			id[index] = $(this).val();
			var sid = $(this).val();
			if(sid){
				var tr = $(this).parent("td").parent("tr");
				var sdata = "inajax=1&act=del&id="+sid;
				$.ajax({
					type:"POST",
					url:"{$adminUrl}log",
					data:sdata,
					dataType:"json",
					success:function(data){
						if(data.success){
							tr.fadeOut("slow").remove();
						}else{
							alert(data.message);
						}
					}
				});			
			}
		});
	});
	$(".delBtn").click(function(){
		if(!confirm(lang[4])){ return false; }
		var id = $(this).attr("sid");
		var tr = $(this).parent("td").parent("tr");
		if(!id || !parseInt(id)){ return false; }
		$.ajax({
			type:"POST",
			url:"{$adminUrl}log",
			data:"inajax=1&act=del&id="+id,
			dataType:"json",
			success:function(json){
				if(json.success){
					tr.slideUp().remove();
				}else{
					qlib.tips(json.message);
				}
			}
		})
	});
});
</script>
{include "footer.inc.html"}