📄 userinf.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ include file="JSP/OPENDB.jsp"%>
<%!
String replacenull(String a){
if(a==null){
return " ";
}else{
return a;
}
}
%>
<%
String oabusyname = (String) session.getValue("oabusyname");
String oabusyusername = (String) session.getValue("oabusyusername");
String oabusyuserdept = (String) session.getValue("oabusyuserdept");
String oabusyuserlevel = (String) session.getValue("oabusyuserlevel");
if((oabusyusername==null)|(oabusyusername=="")){
response.sendRedirect("default.jsp");
}%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="css/css.css">
<script language="javascript1.2" src="js/openwin.js"></script>
<title>人事管理系统</title>
</head>
<body bgcolor="#eeeeee" topmargin="5" leftmargin="5">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td height=68>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="68">
<tr>
<center>
<b>用户资料维护</b>
</center>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign=top>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign=top height=280>
<center>
<%request.setCharacterEncoding("GB2312");
password=request.getParameter("password");
String name=request.getParameter("name");
String submit1="更改";
if(submit1.equals(request.getParameter("submit")))
{
stmt.executeUpdate("update scott.userinf set password='"+password+"',name='"+name+"' where username='"+oabusyusername+"'");
%>
<br><br>
<font color=red>用户资料维护成功!</font>
<%
}else{
%>
<script Language="JavaScript">
function maxlength(str,minl,maxl) {
if(str.length <= maxl && str.length >= minl){return true;}else{return false;}
}
function form_check(){
var l2=maxlength(document.form2.password.value,1,20);
if(!l2){window.alert("密码的长度大于1位小于20位");document.form2.password.focus();return (false);}
var a1=document.form2.password.value;
var a2=document.form2.repassword.value;
if(a1!=a2){window.alert("两次输入的密码应相同");document.form2.repassword.focus();return (false);}
var l3=maxlength(document.form2.name.value,1,20);
if(!l3){window.alert("姓名的长度大于1位小于20位");document.form2.name.focus();return (false);}
}
</script>
<%
String sql1="select * from scott.userinf where username='"+oabusyusername+"' ";
ResultSet rs=stmt.executeQuery(sql1);
if(rs.next()){
%>
<br><br>
<form action="userinf.jsp" method=post name="form2" onsubmit="return form_check();">
<table border=2>
<tr>
<td>
用 户 名:<%=oabusyusername%>
</td>
</tr>
<tr>
<td>
密 码:<input type="password" name="password" size=20 value="<%=rs.getString("password")%>">
</td>
</tr>
<tr>
<td>
密码确认:<input type="password" name="repassword" size=20 value="<%=rs.getString("password")%>">
</td>
</tr>
<tr>
<td>
姓 名:<input type="text" name="name" size=20 value="<%=rs.getString("name")%>">
</td>
</tr>
<tr>
<td>
性 别:<input type="text" name="sex" size=20 value="<%=rs.getString("name")%>">
</td>
</tr>
<tr>
<td>
部 门:<%=oabusyuserdept%>
</td>
</tr>
<tr>
<td>
职 位:<%=oabusyuserlevel%>
</td>
</tr>
<tr>
<td align=center>
<input type="submit" name="submit" value="更改">
</td>
</tr>
</table>
</form>
<%
}
}
%>
</center>
</td>
</tr>
</table>
</tr>
<tr>
<td height=19>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="19">
<tr>
</tr>
</table>
</td>
</tr>
</table>
<%@ include file="foot.jsp"%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -