📄 editchoosepre.jsp
字号:
<%@ page errorPage="error.jsp" %>
<script language=javascript>
<!--
var startTime,endTime;
var d=new Date();
startTime=d.getTime();
//-->
</script>
<html>
<%
if (session.getAttribute("admin")==null || session.getAttribute("admin")==""){
response.sendRedirect("login.jsp");
} %>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page language="java" import="java.sql.*"%>
<jsp:useBean id="sqlbean" scope="page" class="news.sql_data"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>企业内部管理信息平台-管理</title>
<link rel="stylesheet" href="m_style.css" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<div align=center>
<%
String sql,dte,title,news,id,tempclass,parentclass,author;
sql = "Select * FROM news order by id desc";
if (request.getParameter("root")!=null){
String parent=new String(request.getParameter("class").getBytes("ISO8859_1"),"GBK");
//out.println(parent);
sql = "Select * FROM news where parentclass='"+parent+"' order by id desc";
}
ResultSet RS = sqlbean.executeQuery(sql);
if(RS.wasNull()) out.print("<br><font face=Arial color=navy size=2><b>No News At This Time</b></font>");
%>
<%
int intPageSize; //一页显示的记录数
int intRowCount; //记录总数
int intPageCount; //总页数
int intPage; //待显示页码
java.lang.String strPage;
int i;
//设置一页显示的记录数
intPageSize = 15;
//取得待显示页码
strPage = request.getParameter("page");
if(strPage==null){//表明在QueryString中没有page这一个参数,此时显示第一页数据
intPage = 1;
}
else{//将字符串转换成整型
intPage = java.lang.Integer.parseInt(strPage);
if(intPage<1) intPage = 1;
}
RS.last();
intRowCount = RS.getRow();
//记算总页数
intPageCount = (intRowCount+intPageSize-1) / intPageSize;
//调整待显示的页码
if(intPage>intPageCount) intPage = intPageCount;
if(intPageCount>0){
//将记录指针定位到待显示页的第一条记录上
RS.absolute((intPage-1) * intPageSize + 1);
//显示数据
i = 0;%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
<tr align="center">
<td height="22" colspan="8" class="forumRowHighlight"><font color='red'></font> 共有记录 <font color=#FF0000><%=intRowCount%></font> 个 </td>
</tr>
<TR >
<form method=post name=form action=adm_search.jsp>
<td align="center" class=shadow width="100%" colspan="8"><input name="keyword" type="text" onblur="if (value ==''){value='请输入要查询的关键字'}" onmouseover=this.focus() onfocus=this.select() onclick="if(this.value=='请输入要查询的关键字')this.value=''" size="10" class="inputbody" value=请输入要查询的关键字>
<select name="field" size="1" class="inputbody" id="select0">
<option value="all" selected>所有</option>
<option value="title">标题</option>
<option value="content">内容</option>
</select>
<select size="1" name="kt" class="inputbody">
<option value="all" selected>全部类别</option>
<%ResultSet RS_temp=null;
RS_temp = sqlbean.executeQuery("select * from class where parentid=0");
while(RS_temp.next()){%>
<option value="<%=RS_temp.getString("class")%>"><%=RS_temp.getString("class")%></option>
<%}
RS_temp.close();%>
</select>
<input name="Submit" type="Submit" value="搜索..." class="button"></td></form>
</TR>
<tr>
<td width="3%" height="22" class="forumrow">id</td>
<td colspan="2" align="center" class="forumrow">所属分类</td>
<td width="41%" align="center" class=forumrow>标题</td>
<td width="16%" align="center" nowrap class=forumrow>加入日期</td>
<td width="9%" align="center" nowrap class=forumrow>出处</td>
<td width="10%" align="center" nowrap class=forumrow>处理</td>
</tr>
<% while((i<intPageSize && !RS.isAfterLast()))
{dte = RS.getString("d");
title = RS.getString("title");
//news = RS.getString("news");
//news= new String(news.getBytes("ISO-8859-1"),"GBK");
id = RS.getString("id");
author = RS.getString("author");
tempclass = RS.getString("class");
parentclass = RS.getString("parentclass");
%>
<tr>
<td height="22" class="forumrow"><%=id%></td>
<td height="22" colspan="2" class="forumrow"><%
out.print("<font face='Arial' color='navy' size='2'>");
out.print(parentclass);
out.print("</font> ");
out.print(tempclass);%></td>
<td class=forumrow align="center"><a href=../show.jsp?id=<%=RS.getString("id")%> target="_blank"><%out.print(title);%></a></td>
<td align="center" nowrap class=forumrow><%out.print(dte);%></td>
<td align="center" nowrap class=forumrow><%out.print(author);%></td>
<td align="center" nowrap class=forumrow><a href="editupdate.jsp?delete=del&id=<%=id%>"
onclick="{if(confirm('此操作将删除当前记录!\n \n 删除后将不能恢复,您确定执行的操作吗?')){this.document.myform.submit();return true;}return false;}">删除</a>|<a href="edit.jsp?id=<%=id%>">修改</a></td>
</tr>
<%
RS.next();
i++;}
}
RS.close();
%>
<tr align="right">
<td height="22" colspan="8" class="forumRowHighlight">第<%=intPage%>页/共<%=intPageCount%>页
<%if(intPage>1){%><a href="editchoose.jsp?page=<%=intPage-1%>">上一页</a><%}%>
<%if(intPage<intPageCount){%><a href="editchoose.jsp?page=<%=intPage+1%>">下一页</a><%}%>
请选择页码:<select name="page" onChange="MM_jumpMenu('this',this,0)">
<option value="editchoose.jsp?page=<%=intPage%>" selected><%=intPage%></option>
<%int j;
for (j=1;j<=intPageCount;j++){%>
<option value="editchoose.jsp?page=<%=j%>"><%=j%></option>
<%}%>
</select></td>
</tr>
<tr>
<td colspan="2">
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -