?? title_005fmanage_jsp.java
字號(hào):
package org.apache.jsp.bbsadmin;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.*;
import java.util.Date;
import java.text.*;
public final class title_005fmanage_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
String searchcontent;
private static java.util.Vector _jspx_dependants;
static {
_jspx_dependants = new java.util.Vector(2);
_jspx_dependants.add("/bbsadmin/../admin/checkmaster.jsp");
_jspx_dependants.add("/bbsadmin/../inc/conn.jsp");
}
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write(" \r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write('\r');
out.write('\n');
String bbsadmin=null;
bbsadmin = (String)session.getAttribute("bbsadmin");
if(bbsadmin==""||bbsadmin==null)
{
out.print("<script>window.open('../admin/index.jsp');</script>");
//out.print("<script>");
//out.print("alert('你的權(quán)限太低無法進(jìn)入!');");
//out.print("window.location.href='../admin/index.jsp';");
//out.print("</script>");
}
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:db2000";
Connection conn= DriverManager.getConnection(url);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
out.write('\r');
out.write('\n');
out.write('\r');
out.write('\n');
String str2,searchkindstr;
String searchkind = request.getParameter("searchkind");
if(searchkind!=null){
searchcontent = new String(request.getParameter("searchcontent").getBytes("iso-8859-1"));
}
if(searchkind==null){
searchkindstr="";
}
else{
searchkindstr="where "+searchkind+" like '%"+searchcontent+"%'";
}
out.write("\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
out.write("<LINK href=\"../css/xmwuye.css\" rel=stylesheet type=text/css>\r\n");
out.write("<title>主題貼管理</title>\r\n");
out.write("<script language=\"javascript\">\r\n");
out.write("function check()\r\n");
out.write("return confirm(\"確定要?jiǎng)h除嗎?\");\r\n");
out.write("</script>\r\n");
out.write("</head>\r\n");
out.write("<body leftmargin=\"0\" topmargin=\"5\">\r\n");
out.write("<table width=\"95%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
out.write(" <form name=\"form1\" method=\"post\" action=\"title_manage.jsp\">\r\n");
out.write(" <tr bgcolor=\"#d6dff7\"> \r\n");
out.write(" <td height=\"30\" align=\"right\" bgcolor=\"#d6dff7\"><div align=\"center\">貼子搜索: \r\n");
out.write(" <INPUT TYPE=\"text\" NAME=\"searchcontent\" size=20>\r\n");
out.write(" <select name=\"searchkind\">\r\n");
out.write(" <option value=\"id\" selected>id</option>\r\n");
out.write(" <option value=\"title\">標(biāo)題</option>\r\n");
out.write(" <option value=\"menu\">內(nèi)容</option>\r\n");
out.write(" <option value=\"user_id\">昵稱</option>\r\n");
out.write(" </select>\r\n");
out.write(" <input type=\"submit\" name=\"Submit\" value=\" 搜 索 \">\r\n");
out.write(" </div></td>\r\n");
out.write(" </tr>\r\n");
out.write(" </form>\r\n");
out.write(" </table>\r\n");
out.write("<table width=\"95%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td width=\"100%\"> \r\n");
str2="select * from bbstitle "+searchkindstr+" order by id desc";
//out.print(str2);
ResultSet rs=stmt.executeQuery(str2);
int intPageSize; //一頁顯示的記錄數(shù)
int intRowCount; //記錄總數(shù)
int intPageCount; //總頁數(shù)
int intPage; //待顯示頁碼
String strPage;
int i;
intPageSize = 20;
strPage = request.getParameter("pages");
if(strPage==null){
intPage = 1;
}
else
{
intPage = 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;
out.write("\r\n");
out.write(" <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bordercolorlight=\"#000000\" bordercolordark=\"#FFFFFF\" bgcolor=\"#666666\">\r\n");
out.write(" <tr bgcolor=\"#d6dff7\" height=22> \r\n");
out.write(" <td width=\"3%\" height=\"20\" align=\"center\"><strong>ID號(hào)</strong></td>\r\n");
out.write(" <td width=\"6%\" align=\"center\">用戶</td>\r\n");
out.write(" <td width=\"12%\" align=\"center\">標(biāo)題</td>\r\n");
out.write(" <td width=\"10%\" align=\"center\">內(nèi)容</td>\r\n");
out.write(" <td width=\"3%\" align=\"center\">點(diǎn)擊</td>\r\n");
out.write(" <td width=\"3%\" align=\"center\">回復(fù)</td>\r\n");
out.write(" <td width=\"6%\" align=\"center\">日期</td>\r\n");
out.write(" <td width=\"5%\" align=\"center\">IP</td>\r\n");
out.write(" <td width=\"2%\" align=\"center\"><strong>推薦話題</strong></td>\r\n");
out.write(" <td width=\"2%\" align=\"center\"><strong>首頁顯示</strong></td>\r\n");
out.write(" <td width=\"2%\" align=\"center\"><strong>精彩話題</strong></td>\r\n");
out.write(" <td width=\"2%\" align=\"center\"><strong>置頂話題</strong></td>\r\n");
out.write(" <td width=\"2%\" align=\"center\"><strong>圖片轉(zhuǎn)正</strong></td>\r\n");
out.write(" <td width=\"3%\" align=\"center\"><strong>狀態(tài)</strong></td>\r\n");
out.write(" <td width=\"5%\" align=\"center\"><strong>修改</strong></td>\r\n");
out.write(" <td width=\"5%\" align=\"center\"><strong>刪除</strong></td>\r\n");
out.write(" </tr>\r\n");
out.write(" ");
while(i< intPageSize && !rs.isAfterLast()){
out.write("\r\n");
out.write(" <tr bgcolor=\"#FFFFFF\"> \r\n");
out.write(" <td height=25> <p align=\"center\">");
out.print(rs.getObject("id"));
out.write("</td>\r\n");
out.write(" <td > <p align=\"center\">");
out.print(rs.getObject("user_id"));
out.write("</p></td>\r\n");
out.write(" <td ><div align=\"center\"><a href=\"../bbs/checkasp.jsp?id=");
out.print(rs.getObject("id"));
out.write("\" target=\"_blank\">");
out.print(rs.getObject("title"));
out.write("</a></div></td>\r\n");
out.write(" <td > <p align=\"center\">");
out.print(rs.getObject("menu"));
out.write("</p></td>\r\n");
out.write(" <td ><div align=\"center\">");
out.print(rs.getObject("hit"));
out.write("</div></td>\r\n");
out.write(" <td ><div align=\"center\">");
out.print(rs.getObject("rep"));
out.write("</div></td>\r\n");
out.write(" <td > <p align=\"center\">");
out.print(rs.getObject("date1").toString().substring(0,16));
out.write("</p></td>\r\n");
out.write(" <td width=\"6%\" > <div align=\"center\">");
out.print(rs.getObject("ip"));
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -