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

📄 usermanager.jsp

📁 BBS系统
💻 JSP
📖 第 1 页 / 共 3 页
字号:
  }
  else if(action.equals("querynopost")) {
%>
    <tr>
     <td bgcolor="#333333" colspan=6>
      <font face=宋体 color=#FFFFFF><b>用户管理中心</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor="#EEEEEE" colspan=6>
      <font face=宋体 color=#333333 colspan=6><b>用户查询结果</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF colspan=6>
      <font color=#333333><b>符合条件的用户查询结果(共有 <%=count%> 条记录)</b><BR></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#FFFFFF align=center>用户名</td>
     <td bgcolor=#FFFFFF align=center>电子邮件</td>
     <td bgcolor=#FFFFFF align=center>最后一次访问时间</td>
     <td bgcolor=#FFFFFF align=center>发帖数</td>
     <td bgcolor=#FFFFFF align=center>访问次数</td>
     <td bgcolor=#FFFFFF align=center>操作</td>
    </tr>
<%
   rs=connect.executeQuery(query+" limit "+p+","+e);
   while(rs.next()) {
     username=rs.getString(1);
     email=rs.getString(2);
     lastactivetime=rs.getString(3);
     nposts=rs.getInt(4);
     visittimes=rs.getInt(5);
%>
    <tr>
     <td bgcolor=#FFFFFF align=center><%=username%></td>
     <td bgcolor=#FFFFFF align=center><%=email%></td>
     <td bgcolor=#FFFFFF align=center><%=lastactivetime%></td>
     <td bgcolor=#FFFFFF align=center><%=nposts%></td>
     <td bgcolor=#FFFFFF align=center><%=visittimes%></td>
     <td bgcolor=#FFFFFF align=center><input type=button value='编' onClick="location.href='usermanager.jsp?action=edit&username=<%=username%>'" class=delbutton><input type=button value='删' onClick="location.href='usermanager.jsp?action=delete&username=<%=username%>'" class=delbutton><input type=button value='禁' onClick="location.href='usermanager.jsp?action=ban&username=<%=username%>'" class=delbutton></td>
    </tr>
<%
   }
%>
    <tr>
     <td bgcolor=#FFFFFF colspan=6>
      <form name=changepages>
      <font color=#333333>
            共<b><%=totalpage%></b>页
            <b><%=count%></b>个用户
            当前第<b><%out.print(from+"-"+to);%></b>个
            第<b><%=pages%></b>页
      </font>
           <A href=usermanager.jsp?action=querynopost&deltime=<%=deltime%>&delposts=<%=delposts%>&dellast=<%=dellast%>&pages=1><IMG alt=首页 border=0 height=19 src=../images/no.1.gif width=19></A>&nbsp;
           <A href=usermanager.jsp?action=querynopost&deltime=<%=deltime%>&delposts=<%=delposts%>&dellast=<%=dellast%>&pages=<%=(pages<2)?pages:(pages-1)%>><IMG alt=上一页 border=0 height=19 src=../images/up.gif width=19></A>&nbsp;
           <A href=usermanager.jsp?action=querynopost&deltime=<%=deltime%>&delposts=<%=delposts%>&dellast=<%=dellast%>&pages=<%=(pages>totalpage-1)?totalpage:(pages+1)%>><IMG alt=下一页 border=0 height=19 src=../images/dn.gif width=19></A>&nbsp;
           <A href=usermanager.jsp?action=querynopost&deltime=<%=deltime%>&delposts=<%=delposts%>&dellast=<%=dellast%>&pages=<%=totalpage%>><IMG alt=末页 border=0 height=19 src=../images/no.0.gif width=19></A>&nbsp;
           转到: 
      <SELECT name=pages size=1 onchange="changePages()">
<%
        for(int i=1;i<=totalpage;i++) {
           if(i==pages) {
              out.println("<OPTION value='usermanager.jsp?action=querynopost&deltime="+deltime+"&delposts="+delposts+"&dellast="+dellast+"&pages="+i+"' selected>第"+i+"页</OPTION>");
           }
           else
              out.println("<OPTION value='usermanager.jsp?action=querynopost&deltime="+deltime+"&delposts="+delposts+"&dellast="+dellast+"&pages="+i+"'>第"+i+"页</OPTION>");
        }
%>
      </SELECT>
      </form>
     </td>
    </tr>
<%
  }
  else if(action.equals("edit")) {
    int nreply=0,ndelete=0,mark=0,timedifference=0,usermode=0,addmoney=0,addcharm=0,addexperience=0;
    String checkaction="",newmembertitle="",homepage="",qq="",icq="",country="",province="",city="",newsocialpart="",signature="",sex="",education="",marry="",work="",birthday="",astro="",usersx="",registertime="",ipfrom="";
    tempSTR=request.getParameter("checkaction");
    if(tempSTR!=null && !tempSTR.equals(""))
      checkaction=tempSTR;
    tempSTR=request.getParameter("username");
    if(tempSTR!=null && !tempSTR.equals(""))
      username=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
    if(checkaction.equals("yes")) {
      tempSTR=request.getParameter("nposts");
      if(tempSTR!=null && !tempSTR.equals(""))
        nposts=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("nreply");
      if(tempSTR!=null && !tempSTR.equals(""))
        nreply=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("ndelete");
      if(tempSTR!=null && !tempSTR.equals(""))
        ndelete=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("mark");
      if(tempSTR!=null && !tempSTR.equals(""))
        mark=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("timedifference");
      if(tempSTR!=null && !tempSTR.equals(""))
        timedifference=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("visittimes");
      if(tempSTR!=null && !tempSTR.equals(""))
        visittimes=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("addmoney");
      if(tempSTR!=null && !tempSTR.equals(""))
        addmoney=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("addcharm");
      if(tempSTR!=null && !tempSTR.equals(""))
        addcharm=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("addexperience");
      if(tempSTR!=null && !tempSTR.equals(""))
        addexperience=Integer.parseInt(tempSTR);
      tempSTR=request.getParameter("newmembertitle");
      if(tempSTR!=null && !tempSTR.equals(""))
        newmembertitle=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("email");
      if(tempSTR!=null && !tempSTR.equals(""))
        email=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("homepage");
      if(tempSTR!=null && !tempSTR.equals(""))
        homepage=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("qq");
      if(tempSTR!=null && !tempSTR.equals(""))
        qq=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("icq");
      if(tempSTR!=null && !tempSTR.equals(""))
        icq=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("country");
      if(tempSTR!=null && !tempSTR.equals(""))
        country=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("province");
      if(tempSTR!=null && !tempSTR.equals(""))
        province=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("city");
      if(tempSTR!=null && !tempSTR.equals(""))
        city=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("newsocialpart");
      if(tempSTR!=null && !tempSTR.equals(""))
        newsocialpart=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("signature");
      if(tempSTR!=null && !tempSTR.equals(""))
        signature=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      if(!signature.equals(""))
        signature=connect.toBr(signature);//转化html字符
      tempSTR=request.getParameter("sex");
      if(tempSTR!=null && !tempSTR.equals(""))
        sex=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("education");
      if(tempSTR!=null && !tempSTR.equals(""))
        education=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("marry");
      if(tempSTR!=null && !tempSTR.equals(""))
        marry=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("work");
      if(tempSTR!=null && !tempSTR.equals(""))
        work=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("birthday");
      if(tempSTR!=null && !tempSTR.equals(""))
        birthday=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      tempSTR=request.getParameter("astro");
      if(tempSTR!=null && !tempSTR.equals(""))
        astro=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      if(astro.equals("blank"))
         astro="保密";
      tempSTR=request.getParameter("usersx");
      if(tempSTR!=null && !tempSTR.equals(""))
        usersx=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
      if(usersx.equals("blank"))
         usersx="保密";
      tempSTR=request.getParameter("usermode");
      if(tempSTR!=null && !tempSTR.equals("")) {
        if(tempSTR.equals("ban"))
          status="1";
        else {
          status="0";
          usermode=Integer.parseInt(tempSTR);
        }
      }
      number=connect.getRowNum("author where username='"+username+"' and usermode=4");
      if(number>0) {
%>
    <tr>
     <td bgcolor="#333333">
      <font face=宋体 color=#FFFFFF><b>用户管理中心</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE><font color=#333333><b>超级用户的资料,您无权修改!</font></b></td>
    </tr>
<%
      }
      else {
        postok=connect.executeUpdate("update author set money=money+"+addmoney+",charm=charm+"+addcharm+",experience="+addexperience+",newmembertitle=\""+newmembertitle+"\",nposts="+nposts+",nreply="+nreply+",ndelete="+ndelete+",email=\""+email+"\",homepage=\""+homepage+"\",qq=\""+qq+"\",icq=\""+icq+"\",country=\""+country+"\",province=\""+province+"\",city=\""+city+"\",newsocialpart=\""+newsocialpart+"\",mark="+mark+",signature=\""+signature+"\",sex=\""+sex+"\",education=\""+education+"\",marry=\""+marry+"\",work=\""+work+"\",birthday=\""+birthday+"\",astro=\""+astro+"\",usersx=\""+usersx+"\",visittimes="+visittimes+",timedifference="+timedifference+",usermode="+usermode+",status=\""+status+"\" where username='"+username+"'");
        if(postok) {
%>
    <tr>
     <td bgcolor="#333333">
      <font face=宋体 color=#FFFFFF><b>用户管理中心</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE><font color=#333333><b>修改用户的资料已成功!</font></b></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b><%=username%> 的资料修改已成功!</b></font></td>
    </tr>
<%
        }
        else {
%>
    <tr>
     <td bgcolor="#333333">
      <font face=宋体 color=#FFFFFF><b>用户管理中心</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE><font color=#333333><b>修改用户的资料失败!</font></b></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>出现错误!用户<%=username%>的资料修改失败 !</b></font></td>
    </tr>
<%
        }
      }
    }
    else {
      number=connect.getRowNum("author where username='"+username+"' and usermode!=1");
      if(number==0) {
%>
    <tr>
     <td bgcolor="#333333">
      <font face=宋体 color=#FFFFFF><b>用户管理中心</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE><font color=#333333><b>对不起!没有找到您要查询的用户资料</b><%=username%></font></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>您输入的用户名:<%=username%> 没有找到此用户资料!</b></font></td>
    </tr>
<%
      }
      else {
        rs=connect.executeQuery("select newmembertitle,nposts,nreply,ndelete,email,homepage,qq,icq,country,province,city,newsocialpart,mark,signature,sex,education,marry,work,birthday,astro,usersx,visittimes,timedifference,usermode,status,date_format(registertime,'%Y年%m月%d日 %H:%i') as registertime,ipfrom,date_format(lastactivetime,'%Y年%m月%d日 %H:%i') as lastactivetime from author where username='"+username+"'");
        if(rs.next()) {
          newmembertitle=rs.getString(1);
          nposts=rs.getInt(2);
          nreply=rs.getInt(3);
          ndelete=rs.getInt(4);
          email=rs.getString(5);
          homepage=rs.getString(6);
          qq=rs.getString(7);
          icq=rs.getString(8);
          country=rs.getString(9);
          province=rs.getString(10);
          city=rs.getString(11);
          newsocialpart=rs.getString(12);
          mark=rs.getInt(13);
          signature=rs.getString(14);
          sex=rs.getString(15);
          education=rs.getString(16);
          marry=rs.getString(17);
          work=rs.getString(18);
          birthday=rs.getString(19);
          astro=rs.getString(20);
          usersx=rs.getString(21);
          visittimes=rs.getInt(22);
          timedifference=rs.getInt(23);
          usermode=rs.getInt(24);
          status=rs.getString(25);
          registertime=rs.getString(26);
          ipfrom=rs.getString(27);
          lastactivetime=rs.getString(28);
        }
%>
    <form action="usermanager.jsp" method=post name="creator">
    <input type=hidden name="action" value="<%=action%>">
    <input type=hidden name="checkaction" value="yes">
    <input type=hidden name="username" value="<%=username%>">
    <tr>
     <td bgcolor="#333333" colspan=2>
      <font face=宋体 color=#FFFFFF><b>用户管理中心</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=#EEEEEE colspan=2><font color=#333333><b>要编辑的用户名称: </b><%=username%> <%if(usermode==4) out.println("<br>此用户是超级用户,您无法修改他的资料!如果要修改自己的资料,请到论坛的资料中心修改!");%></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>用户头衔:</b><br>您可以自定义一个头衔</font></td>
      <td bgcolor=#FFFFFF><input type=text name="newmembertitle" value="<%=newmembertitle%>" maxlength=20></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>发表总数:</b></font></td>
      <td bgcolor=#FFFFFF><input type=text name="nposts" value="<%=nposts%>"></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>回复总数:</b></font></td>
      <td bgcolor=#FFFFFF><input type=text name="nreply" value="<%=nreply%>"></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>贴子被删除数:</b></font></td>
      <td bgcolor=#FFFFFF><input type=text name="ndelete" value="<%=ndelete%>"></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>邮件地址:</b></font></td>
      <td bgcolor=#FFFFFF><input type=text name="email" value="<%=email%>"></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>主页地址:</b></font></td>
      <td bgcolor=#FFFFFF><input type=text name="homepage" value="<%=homepage%>"></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>OICQ 号:</b></font></td>
      <td bgcolor=#FFFFFF><input type=text name="qq" value="<%=qq%>"></td>
    </tr>
    <tr>
      <td bgcolor=#FFFFFF><font color=#333333><b>ICQ 号:</b></font></td>
      <td bgcolor=#FFFFFF><input type=text name="icq" value="<%=icq%>"></td>
    </tr>
    <tr>

⌨️ 快捷键说明

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