📄 managesms_jsp.java
字号:
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 managesms_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('你的权限太低无法进入!');");
//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');
//java.sql.Connection conn;
//java.sql.Statement stmt;
//java.sql.ResultSet rs;
//Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
//String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=bbs";
//String user="sa";
//String password="";
//conn=DriverManager.getConnection(url,user,password);
//stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
//Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
//String url="jdbc:jtds:sqlserver://localhost:1433/bbs;USER=sa;PASSWORD=";
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);
//Statement stmt=conn.createStatement();
/*String sql="select BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID from BBS_Cate where BBS_Cate_PID='0' and BBS_Cate_ID<>'A_3' and deleted=0 order by totop asc";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next())
out.print(rs.getString("BBS_Cate_Name"));*/
/*String BoardID_1="1",BoardID_2="2",user_id="123",name="3",title="4",menu="5",IP="6",date1="20:00:10",redate="20:00:10",zhiye="123",bbs_img_display="123",bbs_img_text="123",img_url_display="123",deleted="123",picture="123";
String sql="insert into bbstitle(BoardID_1,BoardID_2,user_id,name,title,menu,ip,date1,redate,zhiye,bbs_img_display,bbs_img_text,img_url_display,deleted,picture)";
sql=sql=sql+" values('"+BoardID_1+"','"+BoardID_2+"','"+user_id+"','"+name+"','"+title+"','"+menu+"','"+IP+"','"+date1+"','"+redate+"',"+zhiye+",1,'"+bbs_img_text+"',0,0,'"+picture+"')";
stmt.executeUpdate(sql);*/
/*while(rs.next())
{
out.print(rs.getObject("id"));
}*/
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("</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=\"managesms.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=\"title\">标题</option>\r\n");
out.write(" <option value=\"content\">内容</option>\r\n");
out.write(" </select>\r\n");
out.write(" <input type=\"submit\" name=\"Submit\" value=\" 搜 索 \">\r\n");
out.write(" <A HREF=\"adminpostsms.jsp?ope=add\">[发送系统短信]</A></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 sms "+searchkindstr+" order by id desc";
//out.print(str2);
ResultSet rs=stmt.executeQuery(str2);
int intPageSize; //一页显示的记录数
int intRowCount; //记录总数
int intPageCount; //总页数
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=\"5%\" align=\"center\" height=\"20\"><strong>ID号</strong></td>\r\n");
out.write(" <td width=\"14%\" align=\"center\">标题</td>\r\n");
out.write(" <td width=\"36%\" align=\"center\">内容</td>\r\n");
out.write(" <td width=\"30%\" align=\"center\">日期</td>\r\n");
out.write(" <td width=\"7%\" align=\"center\"><strong>修改</strong></td>\r\n");
out.write(" <td width=\"8%\" 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.getString("id"));
out.write("</td>\r\n");
out.write(" <td > <p align=\"center\">");
out.print(rs.getString("title"));
out.write("</p></td>\r\n");
out.write(" <td > <p align=\"center\">");
out.print(rs.getString("content"));
out.write("</p></td>\r\n");
out.write(" <td > <p align=\"center\">");
out.print(rs.getString("indate").substring(0,16));
out.write("</p></td>\r\n");
out.write(" <td > <p align=\"center\"><a href=\"adminpostsms.jsp?ope=mod&id=");
out.print(rs.getString("id"));
out.write("\">修改</a></p></td>\r\n");
out.write(" <td > <p align=\"center\"><a href=\"delarrest.jsp?id=");
out.print(rs.getString("id"));
out.write("&tb=sms\">删除</a></p></td>\r\n");
out.write(" </tr>\r\n");
out.write(" ");
rs.next();
i++;
}
}
rs.close();
out.write("\r\n");
out.write(" </table>\r\n");
out.write(" <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\r\n");
out.write(" <tr> \r\n");
out.write(" <td width=\"49%\" height=\"25\" class=td005> <div align=\"left\"> \r\n");
out.write(" ");
out.print("共<font color=red>"+intRowCount+"</font>条回复 <font color=red>"+intPageSize+"</font>/页 共<font color=red>"+intPageCount+"</font>页");
out.write("\r\n");
out.write(" 当前第<font color=red>");
out.print(intPage);
out.write("</font>页 </div></td>\r\n");
out.write(" <td width=\"51%\" class=td005> <div align=\"right\"> \r\n");
out.write("\t\t ");
if(intPage<=1){
out.write("\r\n");
out.write("\t\t 首页\r\n");
out.write("\t\t ");
}else{
out.write("\r\n");
out.write(" <a href=\"managesms.jsp?pages=1\">首页</a>\r\n");
out.write("\t\t ");
}
out.write("\r\n");
out.write(" ");
if(intPage>1){
out.write("\r\n");
out.write(" <a href=\"managesms.jsp?pages=");
out.print(intPage-1);
out.write("\">上一页</a> \r\n");
out.write(" ");
}else{
out.write("\r\n");
out.write(" 上一页 \r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" ");
if(intPage<intPageCount){
out.write("\r\n");
out.write(" <a href=\"managesms.jsp?pages=");
out.print(intPage+1);
out.write("\">下一页</a> \r\n");
out.write(" ");
}else{
out.write("\r\n");
out.write(" 下一页 \r\n");
out.write(" ");
}
out.write("\r\n");
out.write("\t\t ");
if(intPageCount<=1||intPage==intPageCount){
out.write("\r\n");
out.write("\t\t 尾页\r\n");
out.write("\t\t ");
}else{
out.write("\r\n");
out.write(" <a href=\"managesms.jsp?pages=");
out.print(intPageCount);
out.write("\">尾页</a> \r\n");
out.write("\t\t ");
}
out.write("\r\n");
out.write("\t\t </div></td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
out.write("</td>\r\n");
out.write(" </tr>\r\n");
out.write("</table>\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -