admin_user.jsp
上传用户:toby834
上传日期:2013-10-21
资源大小:2613k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK"%>
  2. <%@ include file="INC/const.jsp"%>
  3. <%@ page import = "java.util.Vector,
  4. net.acai.forum.admin.*"%>
  5. <title><%=forumName%>--管理页面</title>
  6. <link rel="stylesheet" type="text/css" href="forum.css">
  7. <BODY bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin="20">
  8. <%
  9. try{
  10. if(session.getAttribute("adminFlag")==null)
  11. throw new Exception("本页面为管理员专用,请<a href=elogin.jsp>登陆管理</a>后进入。");
  12. %>
  13. <table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=<%=aTableBackColor%> align=center>
  14.   <tr>
  15.     <td>
  16.       <table cellpadding=3 cellspacing=1 border=0 width=100%>
  17.         <tr bgcolor='<%=aTableTitleColor%>'>
  18.         <td align=center colspan="2">欢迎<b>
  19. <%=session.getAttribute("adminName")%></b>进入管理页面
  20.         </td>
  21.         </tr>
  22.             <tr bgcolor=<%=tableBodyColor%>>
  23.               <td width="20%" valign=top>
  24. <%@include file="admin_left.jsp"%>
  25.       </td>
  26.               <td width="80%" valign=top>
  27. <%
  28. String userID=ParamUtil.getString(request,"userID");
  29. if(userID!=null&&!("".equals(userID))){
  30. //out.println(userID);
  31. UserManager.delUser(request);
  32. out.println("操作成功!");
  33. }
  34. else{
  35. String txtitle=ParamUtil.getString(request,"txtitle");
  36. Vector users;
  37. if(!(txtitle==null||"".equals(txtitle.trim())))
  38. users=UserManager.findUsers(txtitle);
  39. else
  40. users=SkinUtil.getTopList(request);
  41. int orders=ParamUtil.getInt(request,"orders",7);
  42. int usersNum=users.size();
  43.     int Page;
  44. Page=ParamUtil.getInt(request,"Page",1);
  45. %>
  46. <div align="center"><center>
  47. <form name="searchuser" method="POST" action="admin_user.jsp">
  48. <font color=red>点击用户名进行相应操作</font>,  查找用户:  <input type="text" name="txtitle" size="13"><input type="submit" value="查询" name="title">
  49. </form>
  50. <form method=Post action="admin_user.jsp">
  51.     <div align="center">
  52.       <div align="center"><center>
  53. <table border="0" cellspacing="0" width="100%"  cellpadding="0">
  54.         <tr>
  55.           <td width="46" align="center" bgcolor="<%=aTableTitleColor%>" height="20"><strong>ID号</strong></td>
  56.           <td width="400" align="center" bgcolor="<%=aTableTitleColor%>"><strong>用户名</strong></td>
  57.           <td width="68" align="center" bgcolor="<%=aTableTitleColor%>"><input type='submit'  value='删除'></td>
  58.         </tr>
  59. <%
  60. for (i=(Page-1)*20;i<Page*20;i++){
  61. if (i>=usersNum) break;
  62. User theUser=(User)users.get(i);
  63. %>
  64.         <tr>
  65.           <td height="23" width="46"><p align="center"><%=theUser.getUserID()%></td>
  66.           <td width="400"><p align="center"><a href="dispuser.jsp?name=<%=java.net.URLEncoder.encode(theUser.getUserName())%>"><%=theUser.getUserName()%></a></td>
  67.           <td width="68"><p align="center"><input type='checkbox' name='userID' value='<%=theUser.getUserID()%>'></td>
  68.         </tr>
  69. <% 
  70. }
  71. %>
  72.       </table>
  73.       </center></div>
  74.   <%
  75. int totalPages=usersNum/20+1; 
  76. if (Page==0)  Page=1;
  77. out.println("共 "+totalPages+" 页 第 "+Page+" 页 ");
  78. if (Page==1|| totalPages==1 )
  79. out.println("<font color=gray>首页 前页</font>");
  80. else
  81. out.println("<a href=?Page=1&orders="+orders+"&txtitle="+ParamUtil.getString(request,"txtitle","")+">首页</a> <a href=?Page="+(Page-1)+"&orders="+orders+"&txtitle="+ParamUtil.getString(request,"txtitle","")+">前页</a>");
  82. if (Page==totalPages|| totalPages==1)
  83. out.println(" <font color=gray>后页 尾页</font>");
  84. else
  85. out.println(" <a href=?Page="+(Page+1)+"&orders="+orders+"&txtitle="+ParamUtil.getString(request,"txtitle","")+">后页</a> <a href=?Page="+totalPages+"&orders="+orders+"&txtitle="+ParamUtil.getString(request,"txtitle","")+">尾页</a>");
  86. %>
  87.  
  88.       </td>
  89.             </tr>
  90.         </table>
  91.         </td>
  92.     </tr>
  93. </table>
  94. <%}%>
  95. <%
  96. }
  97. catch(Exception e){
  98. e.printStackTrace();
  99. String errMsg=e.getMessage();
  100. %>
  101. <%@include file="INC/error.jsp"%>
  102. <%
  103. }%>
  104. <%@ include file="foot.jsp"%>