?? 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 + -