<!--
whilvydy 新闻发布系统
-->

<%@ page contentType="text/html; charset=GB2312" language="java" import="java.sql.*" %>
<%@ include file = "func/parameter.jsp" %>
<%@ page import="java.io.*" %> 
<%@ page import="java.util.*" %>
<jsp:useBean id="UserBean" scope="page" class="net.jspcn.db.DbConnect" />
<jsp:useBean id='StrTool' scope='page' class='net.jspcn.tool.StringProcess'/>

<%

if (Integer.parseInt((String) session.getValue("user_power"))<10000)
response.sendRedirect("login.jsp");


	//表格颜色
int logrecord_id,color;
color=0;
String sql;
ResultSet rs;
int intPageCount,intPageSize,intCurrentPage,intRowCount,i;
intPageSize = param[4];
i=0;



if(request.getParameter("logrecord_id")==null)
	logrecord_id = 1;
else
	logrecord_id = Integer.parseInt(request.getParameter("logrecord_id").trim());

    
UserBean.openConnection();

%>


<%@ include file = "func/header.jsp" %>

<body>
<div align=center>
日志管理
<br>
<table width="90%"  border="1" cellspacing="0" cellpadding="0"  bordercolor="#00CC66"  borderColorDark="#FFFFFF" borderColorLight="#00CC66">
      <tr> 
    <td width="10%"> 
      <div align="center">日志编号</div>
    </td>
    <td width="10%"> 
      <div align="center">执行人</div>
    </td>
    <td width="25%"> 
      <div align="center">执行时间</div>
    </td>
    <td width="55%"> 
      <div align="center">执行操作</div>
    </td>
   </tr>
<%
	if(request.getParameter("page")==null)
		intCurrentPage = 1;
	else
	{
		intCurrentPage = Integer.parseInt(request.getParameter("page"));
		if(intCurrentPage<1) intCurrentPage = 1;
	}									//得到当前页数
	
	sql = "select * from "+logrecord_table+" order by logrecord_id desc";
	rs = UserBean.executeQuery(sql);
	rs.last();
	intRowCount = rs.getRow();
	intPageCount = (intRowCount+intPageSize-1)/intPageSize;
	if(intCurrentPage>intPageCount) intCurrentPage=intPageCount;		//对当前页数的控制
		
	if(intPageCount>0)
	{	
	rs.absolute((intCurrentPage-1)*intPageSize+1);	
	//for(color=0,i=0;i<intPageSize&&!rs.isAfterLast();color++,i++)

	do {
%>
  <tr> 
    <td width="10%"> 
      <div align="center"><%=rs.getString("logrecord_id")%></div>
    </td>
    <td width="10%"> 
      <div align="center"><%=rs.getString("user_name")%></div>
    </td>
    <td width="25%"> 
      <div align="center"><%=rs.getString("operation_time")%></div>
    </td>
    <td width="55%"> 
      <div align="left"><%=rs.getString("logrecord_operation")%></div>
    </td>
   </tr>
<%	
	color++;
	i++;
	}
	while(rs.next()&&i<intPageSize);
	}
%>
</table>
<br>
<%
	if(intCurrentPage == 1) { 
		%> 首页 前页 <% }
	else
		out.println("<a href='log_man.jsp?page=1'>首页</a> <a href='log_man.jsp?page="+(intCurrentPage-1)+"'>前页</a> ");
	
	if(intCurrentPage==intPageCount) {
		%>后页 末页<% }
	else
		out.println("<a href='log_man.jsp?page="+(intCurrentPage+1)+"'>后页</a> <a href='log_man.jsp?page="+intPageCount+"'>末页</a> ");

%>
<%@ include file = "func/footer.jsp" %>