📄 manguser.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<jsp:include flush="true" page="../../head/chinahrhead.jsp"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'MangUser.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="/ChinaHR/css/admin.css">
</head>
<script type="text/javascript">
var xmlHttp;
function createXMLHttpRequest(){
if(window.XMLHttpRequest){ // Mozilla 浏览器
xmlHttp = new XMLHttpRequest();
}else if (window.ActiveXObject){ // IE 浏览器
try{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){}
}
}
}
function bao(){
var adminName=document.getElementById("admin.adminName").value;
var adminAddr=document.getElementById("admin.adminAddr").value;
var adminCode=document.getElementById("admin.adminCode").value;
var adminDate=document.getElementById("admin.adminDate").value;
var adminEmail=document.getElementById("admin.adminEmail").value;
var adminPass=document.getElementById("admin.adminPass").value;
var adminQq=document.getElementById("admin.adminQq").value;
var adminSex=document.getElementById("admin.adminSex").value;
var adminTel=document.getElementById("admin.adminTel").value;
var adminTime=document.getElementById("admin.adminTime").value;
var realName=document.getElementById("admin.realName").value;
var adminPass=document.getElementById("admin.adminPass").value;
var adminId=document.getElementById("admin.adminId").value;
if(adminName.length<6){alert("请输入大于5位的登录名"); return;}
if(adminEmail.length<3){alert("请输入电子邮箱"); return;}
if(adminTel.length<8){alert("请输入联系电话"); return;}
var where="admin.adminName="+adminName+"&admin.adminAddr="+adminAddr+
"&admin.adminCode="+adminCode+"&admin.adminDate="+adminDate+
"&admin.adminEmail="+adminEmail+"&admin.adminPass="+adminPass+
"&admin.adminQq="+adminQq+"&admin.adminSex="+adminSex+
"&admin.adminTel="+adminTel+"&admin.adminTime="+adminTime+
"&admin.realName="+realName+"&admin.adminId="+adminId+"&method=updathis";
createXMLHttpRequest();
xmlHttp.onreadystatechange=chu;
xmlHttp.open("Post","adminInfo.do");
xmlHttp.setRequestHeader("content-length",where.length);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(where);
}
function chu(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
var res=xmlHttp.responseText;
if(res=="addno"){
alert("修改失败!");
return;
}
document.all.magadmin.innerHTML="";
document.all.oldInfo.innerHTML=res;
}
}
}
function clean(vl,bl){
document.getElementById(vl).style.display=bl?"none":"block";
}
function uppass(){
var pw1=document.all.pwd1.value;
var pw2=document.all.pwd2.value;
var pw3=document.all.pwd3.value;
if(pw1.length<3||pw2.length<3||pw3.length<3){
alert("必须输入大于2位的密码!");
return;
}
if(pw2!=pw3){
alert("俩次密码输入不相同");
return;
}
var where ="pw1="+pw1+"&pw2="+pw2+"&method=upPass";
createXMLHttpRequest();
xmlHttp.onreadystatechange=upass;
xmlHttp.open("Post","adminInfo.do");
xmlHttp.setRequestHeader("content-length",where.length);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(where);
}
function upass(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
var res=xmlHttp.responseText;
document.all.setpas.style.display="none";
alert(res);
}
}
}
function uptu(){
createXMLHttpRequest();
xmlHttp.onreadystatechange=loadadm;
xmlHttp.open("Get","adminInfo.do?method=loadAdmin&date="+new Date());
xmlHttp.send(null);
}
function loadadm(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
document.all.magadmin.innerHTML=xmlHttp.responseText;
}
}
}
</script>
<body>
<div class="level2Bg">
<a href="/ChinaHR/adminInfo.do?method=viwList">新增管理员</a><a class="level2SelTab" href="/ChinaHR/adminInfo.do?method=mangUser">修改个人信息</a><a href="#">管理员管理</a>
</div>
<div align="center"><table width="700px"><tr><td></td><td align="right"><input type="button" value="修改个人信息" onclick="uptu()"/><input type="button" value="修改密码" onclick="clean('setpas',false)"/></td></tr></table></div>
<div align="center" id="oldInfo">
<jsp:include page="MyInfo.jsp" flush="true"></jsp:include>
</div>
<div align="center" id="magadmin">
</div>
<div id="setpas" align="center" style="display:none;">
<table width="400px" class="table">
<tr><th>原密码:</th><td><input type="password" id="pwd1" name="pwd1"/></td></tr>
<tr><th>新密码:</th><td><input type="password" id="pwd2" name="pwd2"/></td></tr>
<tr><th>核实密码:</th><td><input type="password" id="pwd3" name="pwd3"/></td></tr>
<tr><td colspan="2" align="center"><input type="button" onclick="uppass()" value="修改密码"/>
<input type="button" onclick="clean('setpas',true)" value="取消"/></td></tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -