view_user.jsp~98~
来自「一个完整的门户网站,基于JSP环境下开发的,使用SQL数据库.」· JSP~98~ 代码 · 共 72 行
JSP~98~
72 行
<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="com.bwm.model.User" %>
<%@ page import="com.bwm.core.*" %>
<%@ page import="java.util.*" %>
<html>
<head>
<title>view_user</title>
</head>
<%
User u=(User)session.getAttribute("user");
if(u.getUid()==null||"".equals(u.getUid())||u.getStatus()!=FinalConstants.STATUS_ADMIN){
return;
}
%>
<link href="../css/css.css" rel="stylesheet" type="text/css">
<body>
<table border="1" align="center" cellpadding="0" cellspacing="0" class="tableBorder2">
<tr align="center">
<td height="27" colspan="4" >管理用户</td>
</tr>
<tr align="center">
<td height="27">用户ID</td>
<td>注册时间</td>
<td>用户权根</td>
<td>用户状态</td>
</tr>
<%
BasetableFactory bf=BasetableFactory.getInstance();
int submit_page=ParamUtils.getIntParameter(request,"page");
Collection coll=bf.ListUser(submit_page,"");
if(coll==null||coll.size()<=0){
%>
<tr align="center">
<td height="27" colspan="4">当前用户记录为空</td>
</tr>
<%
}else{
Iterator it=coll.iterator();
while(it.hasNext()){
User user=(User)it.next();
%>
<tr align="center">
<td height="27"><%=user.getUid()%> </td>
<td><%=user.getRegtime()%></td>
<form method="post" action="modify_user.jsp">
<td> <input type="radio" name="status" value="1" <%=user.getStatus()==FinalConstants.STATUS_ADMIN?"checked":""%> onClick="Jscript:submit();" >
管理员
<input type="radio" name="status" value="0" <%=user.getStatus()==FinalConstants.STATUS_USER?"checked":""%> onClick="Jscript:submit();" >
普通用户
<input type="hidden" name="uid" value="<%=user.getUid()%>"></td>
</form>
<form method="post" action="modify_user.jsp">
<td> <input type="radio" name="state" value="0" <%=user.getState()==FinalConstants.STATE_FREE?"checked":""%> onClick="Jscript:submit();" >
正常
<input type="radio" name="state" value="1" <%=user.getState()==FinalConstants.STATE_FREEZE?"checked":""%> onClick="Jscript:submit();" >
冻结
<input type="hidden" name="uid" value="<%=user.getUid()%>"></td>
</form>
</tr>
<%
}
%>
<tr align="right">
<td height="27" colspan="4"><%=HtmlUtils.table(bf.getRow("user"),submit_page,"view_user.jsp")%></td>
</tr>
<%
}
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?