<!--#include file="fy.Function.asp"-->
<!--#include file="../fy_inc/cls_pageview.asp"-->
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>content</title>
<link rel="stylesheet" type="text/css" href="css/base.css">
<link rel="stylesheet" type="text/css" href="css/content.css">
<script type="text/javascript" src="../fy_inc/js/jquery.js"></script>
</head>
<body>
<% 
 If Not fycms.ChkAdmin() Then '超级管理员检测
	Call fycms.fycmsErr("")
 End If 
	Dim ShowErr,Types
	IF Request.QueryString("Action") = "Del" Then
		Dim DatAllowDate ,Sqllog
		DatAllowDate = DateAdd("d", -2, Date) 
		Sqllog = "Delete From Log_fy Where Times<=#" & DatAllowDate & " 23:59:59#"
		Conn.Execute (Sqllog)		
 		Call fycms.alert("日志删除成功,注意!!!两天内的日志不会被删除","fy.Log.asp")
 		Response.end
		
	End IF
	Types= request.QueryString("Type")
	Dim strLocalUrl
	strLocalUrl = request.ServerVariables("SCRIPT_NAME")
	
	Dim intPageNow
	intPageNow = request.QueryString("page")
	
	Dim intPageSize, strPageInfo
	intPageSize = 30
	
	Dim arrinfo, i
	Dim sql, sqlCount,Sqls,pages
	pages = "Type="&Request("Type")&"&page"
	Select Case Request.QueryString("Type")
		Case "1"
			Sqls = "  where act=1  "
		Case "2"
			Sqls = "  where act=2  "
		Case "3"
			Sqls = "  where act=3  "
		Case "4"
			Sqls = "     "
		Case Else
			Sqls = ""
	End Select
	sql = "SELECT [ID], [UserName], [act], [Times], [LoginIP], [ACTError], [gethttp]" & _
		" FROM [Log_fy]" &Sqls& _
		"ORDER BY [ID] DESC"
	sqlCount = "SELECT Count([ID])" & _
			" FROM [Log_fy]"

		Dim clsRecordInfo
		Set clsRecordInfo = New Cls_PageView
			clsRecordInfo.intRecordCount = 2816
			clsRecordInfo.strSqlCount = sqlCount
			clsRecordInfo.strSql = sql
			clsRecordInfo.intPageSize = intPageSize
			clsRecordInfo.intPageNow = intPageNow
			clsRecordInfo.strPageUrl = strLocalUrl
			clsRecordInfo.strPageVar = pages
		clsRecordInfo.objConn = Conn		
		arrinfo = clsRecordInfo.arrinfo
		strPageInfo = clsRecordInfo.strPageInfo
		Set clsRecordInfo = nothing
	 %>
<div class="content"> 
	<div class="breadnav">当前位置：<a href="#">后台首页</a> >> 日志管理</div>
    <div class="opers">
	<a href="?Type=1"  class="btn<%If Types="1" Then echo " btn_primary" %>">系统登陆 </a>  <a href="?Type=2" class="btn <%If Types="2" Then echo " btn_primary" %>">系统操作 </a>  <a href="?Type=3" class="btn<%If Types="3" Then echo " btn_primary" %>">会员操作 </a> <a href="?Type=4" class="btn<%If Types="4" Then echo " btn_primary" %>"> 全部日志 </a>
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <form name="SysLog" method="post" action="?Action="> <thead>
      <tr>
      <th>操作者 </th><th>动作</th><th>时间</th><th>IP地址</th><th>提示信息</th><th>详细操作</th></tr>
    </thead>
		 <%
		Dim bgColor
		If IsArray(arrinfo) Then
			For i = 0 to UBound(arrinfo, 2)
	%>
      <tr>
        <td><%= arrinfo(1,i) %></td>
        <td><%
 		Select Case  arrinfo(2,i)
			Case "1"
				echo "登录"
			Case "2"
				echo "系统操作"
			case "3"
			    echo "会员操作"
			case else
				echo "未知错误"
		End Select 
	  %></td>
        <td><%= arrinfo(3,i) %></td>
        <td><a  href="http://www.fycms.com/ip.asp?ip=<%= arrinfo(4,i) %>"  target="_blank"><%= arrinfo(4,i) %></a></td>
        <td><span class="t_success"><%= arrinfo(5,i) %></span></td>
        <td class="look">查看</td>
      </tr>
	  <tr   style="display:none;">
      <td height="30" colspan="7">
	  <%= arrinfo(6,i) %></td>
    </tr>
	<% 
	Next
	End If
	%>
  <tr >
      <td colspan="7" > 
	  <%= strPageInfo%> <input name="Action" type="hidden" id="Action" />
	    <input type="button" class="btn btn_primary" value="删除所有日志，只能删除最近两天以前的日志"  onClick="delpost()">		</td>
    </tr>


  </form>  </table>
 
</div>
<script type="text/javascript">
<!--
$(function(){
 	$.nextshow = function(dom) {
		$(dom).click(function(){
			var $nexttr = $(this).parent("tr").next("tr");
			if($nexttr.is(":hidden")){
				$nexttr.show();
			}else{
				$nexttr.hide();
			}
		});
	};
	$.nextshow('td.look');
 });


function delpost(){
    document.SysLog.method="post";
    document.SysLog.action="?Action=Del";
{
	if(confirm('确定清空所有日志吗?注意!两天内的日志将不会被清空!')){
	this.document.SysLog.submit();
	return true;}return false;
}
	}
//-->
</script>
</body>
</html>
