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

📄 user_005fmanage_jsp.java

📁 做的非常好的论坛
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package org.apache.jsp.user;

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 user_005fmanage_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(2);
    _jspx_dependants.add("/user/../admin/checkmaster.jsp");
    _jspx_dependants.add("/user/../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');


  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');

String str2,searchkindstr;
String seachkind = request.getParameter("seachkind");
String seachstr = request.getParameter("seachstr");

if(seachkind==null){
searchkindstr="";
}
else{
searchkindstr="where " +seachkind+ " like '%"+seachstr+"%'";
}

      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=\"user_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 name=\"seachstr\" type=\"text\" id=\"seachstr\" size=\"20\">\r\n");
      out.write("            <select name=\"seachkind\">\r\n");
      out.write("              <option value=\"clubuser_id\" selected>用户ID号</option>\r\n");
      out.write("              <option value=\"clubuser_name\" >用户名</option>\r\n");
      out.write("              <option value=\"clubuser_nickname\">昵称</option>\r\n");
      out.write("              <option value=\"clubuser_phone\">电话</option>\r\n");
      out.write("              <option value=\"clubuser_ip\">IP地址</option>\r\n");
      out.write("              <option value=\"clubuser_email\">E-mail</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 clubuser_id,clubuser_name,clubuser_nickname,clubuser_password,clubuser_phone,clubuser_fax,clubuser_url,clubuser_email,clubuser_enter_count,clubuser_reg_date,clubuser_lasttime,clubuser_ip,payuser,bbsmanager,bbsadmin from clubuser "+searchkindstr+" order by clubuser_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=\"8%\" align=\"center\"><strong>姓名</strong></td>\r\n");
      out.write("          <td width=\"8%\" align=\"center\"><strong>称呼</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("          <td align=\"center\"><strong>email</strong></td>\r\n");
      out.write("          <td width=\"8%\" align=\"center\"><strong>次数</strong></td>\r\n");
      out.write("          <td width=\"4%\" align=\"center\"><strong>IP</strong></td>\r\n");
      out.write("          <td width=\"15%\" align=\"center\"><strong>登记时间</strong></td>\r\n");
      out.write("          <td width=\"13%\" align=\"center\"><strong>最后登录</strong></td>\r\n");
      out.write("          <td width=\"5%\" align=\"center\" bgcolor=\"#d6dff7\"><strong>版主</strong></td>\r\n");
      out.write("          <td width=\"2%\" align=\"center\" bgcolor=\"#d6dff7\"><strong>封锁</strong></td>\r\n");
      out.write("          <td width=\"3%\" align=\"center\" bgcolor=\"#d6dff7\"><strong>上传权限</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> \r\n");
      out.write("            <p align=\"center\">");
      out.print(rs.getObject("clubuser_id"));
      out.write("</td>\r\n");
      out.write("          <td > <p align=\"center\">");
      out.print(rs.getObject("clubuser_name"));
      out.write("</p></td>\r\n");

⌨️ 快捷键说明

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