118 lines
3.3 KiB
Plaintext
118 lines
3.3 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=GB18030"
|
|
pageEncoding="GB18030" import="java.sql.*"%>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<jsp:useBean id="kemu" class="com.DB" scope="page" />
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
|
|
<title>Insert title here</title>
|
|
<link href="../css/style.css" rel="stylesheet" type="text/css">
|
|
</head>
|
|
<body>
|
|
<table width="985" height="548" border="0" cellpadding="0"
|
|
cellspacing="0">
|
|
<tr>
|
|
<td valign="top" background="../image/RIGHT.jpg"><table
|
|
width="985" height="50" border="0" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td> </td>
|
|
</tr>
|
|
</table>
|
|
<table width="916" border="0" align="center" cellpadding="0"
|
|
cellspacing="0">
|
|
<tr>
|
|
<td width="70" height="30" align="center" bgcolor="#F0F0F0">公告编号</td>
|
|
<td width="182" align="center" bgcolor="#F0F0F0">公告名称</td>
|
|
<td width="401" align="center" bgcolor="#F0F0F0">公告内容</td>
|
|
<td width="161" align="center" bgcolor="#F0F0F0">时间</td>
|
|
<td width="51" align="center" bgcolor="#F0F0F0">修改</td>
|
|
<td width="51" align="center" bgcolor="#F0F0F0">删除</td>
|
|
</tr>
|
|
<%
|
|
int CountPage = 0;
|
|
int CurrPage = 1;
|
|
int PageSize = 12;
|
|
int CountRow = 0;
|
|
String StrPage = request.getParameter("Page");
|
|
if (StrPage == null)
|
|
{
|
|
CurrPage = 1;
|
|
}
|
|
else
|
|
{
|
|
CurrPage = Integer.parseInt(StrPage);
|
|
}
|
|
Connection con=kemu.getCon();
|
|
if (con != null)
|
|
{
|
|
try
|
|
{
|
|
|
|
String sqlyy = "Select * from gg ";
|
|
ResultSet rs=kemu.GetRs(sqlyy);
|
|
if(!rs.next())
|
|
{
|
|
out.println("对不起,暂时没有信息");
|
|
}
|
|
else{
|
|
rs.last();
|
|
int i = 0;
|
|
CountRow = rs.getRow();
|
|
CountPage = (CountRow/PageSize);
|
|
if (CountRow%PageSize>0)
|
|
CountPage++;
|
|
Integer n = (CurrPage-1)*5+1;
|
|
rs.first();
|
|
rs.absolute(CurrPage*PageSize-PageSize+1);
|
|
while (i<PageSize && !rs.isAfterLast())
|
|
{
|
|
%>
|
|
<tr>
|
|
<td height="25" align="center"><%=rs.getString("id")%></td>
|
|
<td align="center"><%=rs.getString("Gg_titile")%></td>
|
|
<td align="center"><%=rs.getString("Gg_neirong")%></td>
|
|
<td align="center"><%=rs.getString("shijian")%></td>
|
|
<td align="center"><a
|
|
href="zixun_up.jsp?id=<%=rs.getString("id")%>">修改</a></td>
|
|
<td align="center"><a
|
|
href="delete.jsp?id=<%=rs.getString("id")%>&j=4">删除</a></td>
|
|
</tr>
|
|
<%
|
|
rs.next();
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
|
|
catch (SQLException e)
|
|
{
|
|
out.println(e.getMessage());
|
|
}
|
|
finally
|
|
{
|
|
con.close();
|
|
}
|
|
}
|
|
%>
|
|
</table>
|
|
|
|
<table width="700" height="53" border="0" cellpadding="0"
|
|
cellspacing="0">
|
|
<tr>
|
|
<td width="205" height="53" align="center">[<%=CurrPage%>/<%=CountPage %>]
|
|
每页<%=PageSize %>条 共<%=CountRow%>条记录
|
|
</td>
|
|
<td width="495" align="left">
|
|
<div align="left">
|
|
<% for (int i = 1;i<=CountPage;i++){%>
|
|
<a href="zixun_mg.jsp?Page=<%=i%>">[<%=i%>]
|
|
</a>
|
|
<%}%>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table></td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html> |