⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 helplist.jsp

📁 在线教育平台: 从小学
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"
	pageEncoding="GB2312"%>
<%@page import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<jsp:useBean id="help" scope="page" class="edu.HelpBean" />
<title>帮助列表</title>
<link rel="stylesheet" href="style.css" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
.STYLE2 {color: #FF0000}
-->
</style>
</head>
<body>
<%
int id;
String title="",time="";
int allrow=0,pagesize=10, intpage=1;
try{
	intpage=Integer.valueOf(request.getParameter("intpage")).intValue();
	}catch(NumberFormatException e){}


	ResultSet rs=help.getCount();
	if(rs.next())
	allrow=rs.getInt(1);
	int allpage = (allrow+pagesize-1) / pagesize; 
//	调整待显示的页码 
	if(intpage>allpage) intpage = allpage;
	if(intpage<1) intpage = 1;
	int startrow=(intpage-1)*pagesize;

	help.setStartpage(startrow);
	help.setPagesize(pagesize);
%>
<div align="center">
<table width="750" height="25" border="0" cellpadding="0"
	cellspacing="0">
	<tr>
		<td width="770" height="160"><iframe name="top" height="160"
			width="770" scrolling="no" src="top.jsp" frameborder="0"></iframe></td>
	</tr>
</table>
</div>
<table width="750" border="0" align="center" cellspacing="1">
	<tr bgcolor="#333366">
		<td width="73%" bgcolor="#336699">
		<div align="center" class="STYLE1">帮助</div>
		</td>
		<td width="27%" bgcolor="#336699">
		<div align="center" class="STYLE1">日期</div>
		</td>
	</tr>
	<%
  rs = help.getHelp();
  while(rs.next())
  {
	id=rs.getInt("id");
  	title=rs.getString("title");
	time=rs.getString("time");
	String strtitle="";
	 if(title.length()>30)
		 strtitle=title.substring(0,30)+"...";
	 else strtitle=title;
  %>
	<tr>
		<td bgcolor="#FFFFFF"><a href=shownh.jsp?sort=help&id=<%=id%>
			title="<%=title %>"><%=strtitle %></a></td>
		<td bgcolor="#FFFFFF"><%=time %></td>
	</tr>
	<%
  }rs.close();
  %></table>
    <div align="center">
<table width="750" border="0">
	<tr>
	<td width="30%" height="30" >
		<div align="center">共<span class="STYLE2"><%=allrow %></span>条记录 当前第<span class="STYLE2"><%=intpage %></span>页/共<span class="STYLE2"><%=allpage %></span>页</div></td>
		<td width"70%">
		<div align="center"><a href="helplist.jsp">首页 </a>&nbsp;&nbsp;
		<%int tenpage=((int)(intpage/10))*10;
		if(intpage-10>0) {%> <a
			href="helplist.jsp?intpage=<%=intpage-10%>">上十页</a>&nbsp;&nbsp;<%} %><a
			href="helplist.jsp?intpage=<%=intpage-1%>">上一页</a>&nbsp;&nbsp; 
			
	  <%if(tenpage+10<=allpage){
		  for(int i=1;i<=10;i++){%><a href="helplist.jsp?intpage=<%=tenpage+i %>"><%=tenpage+i %></a>
		  <%}}if(tenpage+10>allpage){
			  for(int i=1;i+tenpage<=allpage;i++){%><a href="helplist.jsp?intpage=<%=tenpage+i %>"><%=tenpage+i %></a>&nbsp;&nbsp;
			  <%}} %>
			<a
			href="helplist.jsp?intpage=<%=intpage+1%>">下一页</a> &nbsp;&nbsp; 
			<%if(intpage+10<=allpage) {%><a
			href="helplist.jsp?intpage=<%=intpage+10%>">下十页</a> &nbsp;&nbsp; <%} %><a
			href="helplist.jsp?intpage=<%=allpage%>">尾页</a></div>
		</td>
	</tr>
</table></div>
<div align="center">
<table height="155" width="750" border="0" cellspacing="1"
	align="center">
	<tr>
		<td><iframe name="bottom" height="155" width="750" scrolling="no"
			src="bottom.jsp" frameborder="0"></iframe></td>
	</tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -