📄 user.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
%><%@ include file="/WEB-INF/incs/lib.txt"
%><%@ include file="header.txt" %>
<%
Object obj = request.getAttribute("page");
if (obj == null) {
this.replace("../../Index");
return;
}
PageInfo pInfo = (PageInfo)obj;
obj = request.getAttribute("us");
if (obj == null) {
this.replace("../../Index");
return;
}
ArrayList<User> us = (ArrayList<User>)obj;
obj = request.getAttribute("fs");
if (obj == null) {
this.replace("../../Index");
return;
}
ArrayList<Forum> fs = (ArrayList<Forum>)obj;
Iterator<User> iterator = us.iterator();
Iterator<Forum> fi = fs.iterator();
%>
<table align="center" border="0" cellspacing="1" cellpadding="2" >
<tr><th colspan="15">版块设置</th></tr>
<tr class="titleRow">
<td>自动编号</td>
<td>用户名</td>
<td>用户昵称</td>
<td>注册日期</td>
<td>版主</td>
<td>操作</td>
</tr>
<%
while (iterator.hasNext()) {
User u = iterator.next();
%>
<tr>
<td><%=u.getId()%></td>
<td><%=u.getUsn()%></td>
<td><%=u.getName()%></td>
<td><%=cn.ialvin.bbs.common.Tools.DFormat.format(u.getReg())%></td>
<td><%=(u.isModerators()?"<font color='green'>√</font>":"<font color='red'>×</font>")%></td>
<td>
<input onclick='JavaScript:del("<%=cn.ialvin.web.Encoder.escape(u.getUsn())%>");' type="button" value="删除"/>
<input onclick='JavaScript:rz("<%=cn.ialvin.web.Encoder.escape(u.getUsn())%>")' type="button" value="任责"/>
</td>
</tr>
<%
}
%>
<tr>
<td colspan="10" class="pageInfo">
<%=cn.ialvin.bbs.common.Tools.showPage(pInfo)%>
</td>
</tr>
<tr id="rzRow" style="display:none;">
<td colspan="10">
<form name='rzForm' onsubmit='this.ref.value=window.location.href' action="Index?action=setManager" method="post">
<label>用户名:</label>
<input type="text" maclength="16" name="usn" readonly="readonly" />
<label>版块:</label>
<select name="forum">
<%
while (fi.hasNext()) {
Forum forum = fi.next();
%>
<option value="<%=forum.getId()%>"><%=encodeHTML(forum.getName())%></option>
<%
}
%>
</select>
<input type="hidden" name='ref' />
<input type="submit" value='设置版主'/>
<input onclick="$('rzRow').style.display='none';" type="button" value='取消'/>
</form>
</td>
</tr>
</table>
<script type="text/javascript">//<![CDATA[
function rz(usn) {
$("rzRow").style.display = '';
document.rzForm.usn.value = unescape(usn);
}
function del(usn) {
if (!confirm("确认删除吗?")) return;
var ref = encodeURIComponent(window.location.href);
window.location.href = "Index?action=delUser&usn=" + encodeURIComponent(unescape(usn)) + "&ref=" + ref;
}
//]]></script>
<%@ include file="footer.txt" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -