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

📄 usermanage.jsp

📁 一个小型的BBS系统
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"    pageEncoding="gb2312"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Insert title here</title>
<%@page import="java.util.*" %></head><body>

<table width="921" height="600" border="2" align="center">
  <tr>
    <th height="51" colspan="2" scope="col">&nbsp;</th>
    <th width="298" rowspan="2" scope="col"><div align="center"><span class="STYLE2">软件工程交流论坛</span></div></th>
    <th colspan="2" scope="col">&nbsp;</th>
  </tr>
<%
String tid;
String tcontrol;
String author;

tid = (String)session.getAttribute("name");
author = (String)session.getAttribute("author");
tcontrol = (String)session.getAttribute("control");

if(tid!=null){
	%>
	   <tr>
	    <td width="150"><div align="center">用户ID:<%=tid %></div></td>
	    <td width="154" height="17"> <div align="center">昵称: <%=author %></div></td>
	    <td width="170"><div align="center"><a href="/bbs_design/ReqServlet?action=login">用户登陆</a> </div></td>
	    <td width="115"><div align="center"><a href="/bbs_design/ReqServlet?action=register">新用户注册</a></div></td>
	  </tr>
	 
	 
		 
	   <%	
	}
	else{
		tid ="visitor";
		tcontrol="0";
		session.setAttribute("name","visitor");
		session.setAttribute("author","游客");
		session.setAttribute("tcontrol","0");
	%>
	  <tr>
	    <td width="150"><div align="center">用户ID:<%=tid %></div></td>
	    <td width="154" height="17"> <div align="center">昵称: 游客</div></td>
	    <td width="170"><div align="center"><a href="/bbs_design/ReqServlet?action=login">用户登陆</a> </div></td>
	    <td width="115"><div align="center"><a href="/bbs_design/ReqServlet?action=register">新用户注册</a></div></td>
	  </tr>
	  <tr>
	    <td height="23">&nbsp;</td>
	    <td height="23">&nbsp;</td>
	    <td width="298" height="23">&nbsp;</td>
	    <td height="23">&nbsp;</td>
	    <td height="23">&nbsp;</td>
	  </tr>
	   <%} %> 
	   
	   <%
	if(!tid.equals("visitor")){%>
		
		<%
		if(tcontrol.equals("2")){%>
		<tr>
	    <td height="23"><a href="/bbs_design/ReqServlet?action=usermanage">用户管理</a></td>
	    <td height="23"><a href="/bbs_design/ReqServlet?action=statemanage">版块管理</a></td>
	    
	  
	  <% }
		else { %>
	     <tr>
	    <td height="23">&nbsp;</td>
	    <td height="23">&nbsp;</td>
	  
	<% 	}%>
	     <td width="298" height="23">
	     <jsp:useBean id="cm" scope="session" class="bean.check.CheckMessage" />
	     <a href="/bbs_design/ReqServlet?action=message&userid=<%=tid %>">短消息</a>&nbsp未读<%=cm.CheckUnReadMessage(tid) %>个</td>
	     <td height="23"><a href="/bbs_design/ReqServlet?action=usercontrolform&userid=<%=tid %>">控制面板</a> </td>
	     <td height="23"><a href="/bbs_design/ReqServlet?action=quit">安全退出</a></td>
	     </tr>

	<%}
	%>
	    
	  <tr>
	    <td height="155" colspan="5"><div align="center">
<br>
<a href="/bbs_design/index.jsp">论坛主页</a> >> 用户管理<br><br>



<%
String id="";
String control="";
String master ="";
String state="";
String post="";
String score="";
String name="";

String temp = (String)request.getAttribute("temp");
String isempty = (String)request.getAttribute("isempty");
if(isempty.equals("0")){%>
	<%=temp %>

<% 	
}
else{
	Vector user;
	user = (Vector)request.getAttribute("user");
	int size = user.size();
	Vector states;
	states = (Vector)request.getAttribute("state");
	int size_s = states.size()/2;
	%>
<table>
<tr>
	<th>ID</th>	
	<th>权限</th>
	<th>所属版</th>
	<th>总共发帖</th>
	<th>积分</th>
	<th>昵称</th>
	<th>是否删除</th>
	<th colspan=3>提升/移动</th>	
	<th>撤销版主</th>		
			
<%
	for(int i=0; i<size/6; i++){
		id =(String)user.elementAt(i*6);		
		control =(String)user.elementAt(i*6+1);
		if(control.equals("0"))
			master = "普通";
		else if(control.equals("1"))
			master = "版主";
		else master = "管理员";
		state = (String)user.elementAt(i*6+2);
		post = (String)user.elementAt(i*6+3);
		score = (String)user.elementAt(i*6+4);
		name = (String)user.elementAt(i*6+5);%>
		<tr>
			<th><%=id %></th>
			<th><%=master %></th>
			<jsp:useBean id="dbsw" scope="session" class="bean.dbwrite.DBStateWrite" />	
			<th><%=state %></th>
			<th><%=post %></th>
			<th><%=score %></th>		
			<th><%=name %></th>
			<th><form action="/bbs_design/ReqManage" method="get">
				<input type="hidden" name="action" value="del">
				<input type="hidden" name="delnum" value="<%=id %>">
				<input type="hidden" name="control" value="<%=control %>">
				<input type="hidden" name="state" value="<%=state %>">
				<input type="hidden" name="delname" value="<%=name %>">
				<input type="submit" value="删除" >
			</form>
			</th>
			<th colspan=3>
			<form action="/bbs_design/ReqManage" method="get">
			<select name="formstate" id="1">
			<%
			for(int j=0; j<size_s; j++){
			%>
 				<option value="<%=states.elementAt(j*2) %>"><%=states.elementAt(j*2+1) %></option>
 			<%} %>
			</select>
			
				<input type="hidden" name="action" value="promote">
				<input type="hidden" name="promotename" value="<%=name %>">
				<input type="submit" value="提升/移动" >
			</form>
			</th>
			<th>
			<form action="/bbs_design/ReqManage" method="get">
				<input type="hidden" name="action" value="undo">
				<input type="hidden" name="undonum" value="<%=id %>">
				<input type="hidden" name="state" value="<%=state %>">
				<input type="hidden" name="control" value="<%=control %>">
				<input type="hidden" name="undoname" value="<%=name %>">
				<input type="submit" value="撤销" >
			</form>
			</th>
<% 		
	}
}
%>
	
</table>

</div>   
</td>
  </tr>
</table></body></html>

⌨️ 快捷键说明

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