?? usermanager.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.publish.jxc.charpter9.*" %>
<jsp:useBean id="xmlBean" class="com.publish.jxc.charpter9.UserXMLAction" scope="request" />
<%//刷新和權限問題
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
String contextPath = request.getContextPath();
if (session.getAttribute("user") == null) {
out.print(Utility.outPrintPage("你還沒登錄,無權查看此頁面!", contextPath + "/index.jsp"));
return;
}
%>
<%
String strAct = (String)request.getParameter("act");
if (strAct==null)
strAct = "show";
String strId = request.getParameter("recordId");
if (strId == null)
strId = "";
%>
<html>
<head>
<title>個人求職管理系統</title>
<link rel="stylesheet" href="<%=contextPath%>/css/itsp.css" type="text/css">
<SCRIPT LANGUAGE=javascript>
function addUser()
{
var Checkblank = /^(\s*|(\ )|(\.))*$/;
var Checkpassword = /^[0-9a-zA-Z_-]+$/;
if (Checkblank.test(dataform2.name.value))
{
alert("用戶名稱不能為空!");
dataform2.name.focus();
return false;
}
if (Checkblank.test(dataform2.truename.value))
{
alert("用戶實名不能為空!");
dataform2.truename.focus();
return false;
}
if (Checkblank.test(dataform2.password.value))
{
alert("用戶密碼不能為空!");
dataform2.password.focus();
return false;
}
if (!Checkpassword.test(dataform2.password.value))
{
alert("用戶密碼只能有26個英文字母和0~9個數字組成!");
dataform2.password.focus();
return false;
}
if(dataform2.password.value.length < 6)
{
alert("用戶密碼不能少于6位!");
dataform2.password.focus();
return false;
}
window.dataform2.submit();
}
function updateUser()
{
var Checkblank = /^(\s*|(\ )|(\.))*$/;
if (Checkblank.test(dataform.truename.value))
{
alert("用戶實名不能為空!");
dataform.truename.focus();
return false;
}
window.dataform.actionName.value='UPDATEUSER';
window.dataform.submit();
}
function deleteUser()
{
if(confirm('您是否確定刪除本記錄,刪除后將導至記錄無法使用?'))
window.dataform.actionName.value='DELETEUSER';
window.dataform.submit();
}
}
function checkform2()
{
var Checkblank = /^(\s*|(\ )|(\.))*$/;
if (Checkblank.test(dataform2.truename.value))
{
alert("用戶實名不能為空!");
dataform2.truename.focus();
return false;
}
window.dataform2.submit();
}
</SCRIPT>
</head>
<body >
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="22">
<tr>
<td width="1"><img src="<%=contextPath%>/images/top_r1.GIF" width="62" height="22"></td>
<td width=150 align="center"> 個人求職管理系統--用戶管理</td>
<td><img src="<%=contextPath%>/images/top_r2.GIF" width="294" height="22"></td>
<td width=100 align="center"><a href="<%=contextPath%>/index.jsp">[ 退出系統 ]</a></td>
</tr>
</table>
<br>
<br>
<table bgcolor="#999999" align=center border=0 cellpadding=1 cellspacing=1
width="90%">
<tbody>
<tr bgcolor="#efefef" align="center" valign="middle">
<td class=ttTable height=30 width="20"> </td>
<td class=ttTable height=30 width="0">用戶名稱</td>
<td class=ttTable height=30 width="0">用戶密碼</td>
<td class=ttTable height=30 width="0">用戶實名</td>
<td class=ttTable height=30 width="0">
<div align="center">用戶等級</div>
</td>
<td class=ttTable height=30 width="30">
<div align="center">修改</div>
</td>
<td class=ttTable height=30 width="30">
<div align="center">刪除</div>
</td>
</tr>
<form name=dataform action="/charpter9/manager" method="post" >
<%
ArrayList userList = (ArrayList)session.getAttribute("showList");
if (userList != null){
int length = userList.size();
for(int i=0; i<length; i++) {
UserXMLModel user = (UserXMLModel)userList.get(i);
if (strAct.equals("modi") && strId.equals(user.getId())){
%>
<!--顯示修改的格式-->
<tr align="center" bgcolor="#ffffff" valign="middle">
<td class=tdsmall height=25 width="20">
<%=(i+1)%></td>
<td class=tdsmall height=25 width="0"><%=user.getName()%></td>
<!--td class=tdsmall height=25><input name="name" class=stedit style="HEIGHT: 22px; WIDTH: 150px" value="getName()" maxlength="10" ></td-->
<td class=tdsmall height=25> </td>
<td class=tdsmall height=25>
<input name="truename" class=stedit style="HEIGHT: 22px; WIDTH: 150px" value="<%=user.getTrueName()%>" maxlength="10" >
</td>
<td class=tdsmall height=25>
<select name="roles" class=stedit>
<option value="user" <% if(user.getRoles().equals("user")){out.print("selected");}%>>用戶</option>
<option value="admin" <% if(user.getRoles().equals("admin")){out.print("selected");}%>>管理員</option>
</select>
</td>
<td class=tdsmall height=25 width="25"><a href="javascript:window.dataform.recordId.value='<%=user.getId()%>';if (updateUser()==false);"><img border=0
height=15 src="<%=contextPath%>/images/editok.gif" width=15></a></td>
<td class=tdsmall height=25 width="25"> </td>
</tr>
<% }else{
//顯示正常的格式 %>
<tr align="center" bgcolor="#ffffff" valign="middle">
<td class=tdsmall height=25 width="20"><%=(i+1)%></td>
<td class=tdsmall height=25 width="0"><%=user.getName()%></td>
<td class=tdsmall height=25 width="0"><%="******"%></td>
<td class=tdsmall height=25 width="0"><%=user.getTrueName()%></td>
<td class=tdsmall height=25 width="0"> <%=user.getRoles()%></td>
<td class=tdsmall height=25 width="30"><a href="<%=request.getRequestURI()%>?act=modi&recordId=<%=user.getId()%>"><img border=0
height=15 src="<%=contextPath%>/images/edit.gif" width=15></a></td>
<td class=tdsmall height=25 width="30"><img border=0
height=15 onClick="javascript:window.dataform.recordId.value='<%=user.getId()%>';deleteUser();"
src="<%=contextPath%>/images/delete.gif" style="CURSOR: hand" width=15> </td>
</tr>
<%
}
}
}
%>
<input type="hidden" name="actionName" value="">
<input type="hidden" name="recordId" value="">
</form>
<% if (strAct.equals("addnew")){
//顯示新增的格式%>
<tr align="center" bgcolor="#ffffff" valign="middle">
<form name=dataform2 action="/charpter9/manager" method="post" onSubmit='return addUser(this);' >
<input name="actionName" type="hidden" value="ADDUSER">
<td class=tdsmall height=25 width="20"></td>
<td class=tdsmall height=25>
<input name="name" class=stedit
style="HEIGHT: 22px; WIDTH: 150px" value="" maxlength="10" >
</td>
<td class=tdsmall height=25>
<input name="password" class=stedit type="password"
style="HEIGHT: 22px; WIDTH: 100px" value="" maxlength="12" >
</td>
<td class=tdsmall height=25>
<input name="truename" class=stedit
style="HEIGHT: 22px; WIDTH: 150px" value="" maxlength="10" >
</td>
<td class=tdsmall height=25>
<select name="roles" class=stedit>
<option value="user">用戶</option>
<option value="admin">管理員</option>
</select>
</td>
<td class=tdsmall height=25 width="25"><a href="javascript:if (checkform2()==false);"><img border=0
height=15 src="<%=contextPath%>/images/editok.gif" width=15></a></td>
<td class=tdsmall height=25 width="25"> </td>
</form>
</tr>
<%
}
out.print("</tbody></table>");
out.print(Utility.getUserManagerPageSection(strAct, contextPath, request.getRequestURI()));
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -