📄 modiuserdata.asp
字号:
<%
'功能:修改个人资料
'参数: request.form("addedit_subed")="true"#表单提交;
%>
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
'response.buffer=false
'------------------------------------------------设置参数
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '当前用户ID
'------------------------------------------------
'------------------------------------------------修改记录
table="tbioaUser" '表名
if request.form("addedit_subed")="true" then
'表单提交后
Pwd=Request.Form("Pwd")
ConfirmPwd=Request.Form("ConfirmPwd")
OfficeTel=Request.Form("Officetel")
HomeTel=Request.Form("HomeTel")
Pager=Request.Form("Pager")
Mobiletel=Request.Form("Mobiletel")
PostCode=Request.Form("PostCode")
Email=Request.Form("Email")
Address=Request.Form("Address")
Fax=Request.Form("Fax")
birthday=Request.Form("birthday")
if Pwd="" then
'编辑时使用的字段
field1=array("OfficeTel","HomeTel","Pager","Mobiletel","PostCode","Email","Address","Fax","birthday")
value1=array(OfficeTel,HomeTel,Pager,Mobiletel,PostCode,Email,Address,Fax,birthday)
sql="UPDATE " & table & " SET "
for i=0 to ubound(field1)
sql = sql & field1(i) & "='" & replace(value1(i),"'","''") & "'"
if i <> ubound(field1) then sql=sql & "," else sql=sql & " where id=" & LoginID
next
oConn.Execute sql
word="<p>个人资料修改成功!<br>由于你没输入口令,所以保留了原口令!</p><p><img border=0 src=../images/icon_show.gif align=left width=16 height=16><a href=modiuserdata.asp>返回</a>"
elseif Pwd<>ConfirmPwd then
word="<p>个人资料修改失败!<br>口令输入不一致!</p><p><img border=0 src=../images/icon_show.gif align=left width=16 height=16><a href=""javascript:history.back(-1);"">[返回]</a>"
else
'编辑时使用的字段
field1=array("Pwd","OfficeTel","HomeTel","Pager","Mobiletel","PostCode","Email","Address","Fax")
value1=array(md5(Pwd),OfficeTel,HomeTel,Pager,Mobiletel,PostCode,Email,Address,Fax)
sql="UPDATE " & table & " SET "
for i=0 to ubound(field1)
sql = sql & field1(i) & "='" & replace(value1(i),"'","''") & "'"
if i <> ubound(field1) then sql=sql & "," else sql=sql & " where id=" & LoginID
next
oConn.Execute sql
word="<p>个人资料修改成功!</p><p><img border=0 src=../images/icon_show.gif align=left width=16 height=16><a href=modiuserdata.asp>返回</a>"
end if
else'--------------------------------------------取记录
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from " & table & " where ID="&LoginID
rs.open sql,oConn,1,1
end if
'------------------------------------------------
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
<base target="FrmMain">
<script src="../js/Popup.js"></script>
<script src="../js/front_chec.js"></script>
</head>
<body topmargin="10" leftmargin="10">
<br>
<div align="center">
<table width="400" cellspacing="1" cellpadding="2" class="tab">
<tr>
<td width="100%" class="tdTop">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="tdTop">
<p align="left"><img border="0" src="../images/icon_title.gif" align="left">修改个人资料</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="25%" class="td1">
<% if request.form("addedit_subed")="true" then %>
<table border="0" width="100%" cellspacing="10" cellpadding="0">
<tr>
<td width="36%">
<p align="right"><img border="0" src="../images/edit.gif" width="32" height="32">
</td>
<td width="64%"><p> </p>
<%=word%>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
</td>
</tr>
</table>
<% else %>
<script language="JavaScript">
function OpenWindow(url,windowname)
{
window.open(url,windowname,'left=100,top=50,height=100,width=350,toolbar=no,menubar=no,scrollbars=yes')
}
</script>
<form NAME="Rightfrm" method="post">
<input type=hidden name="addedit_subed" value="true">
<div align="center">
<center>
<table width="550" cellspacing="1" cellpadding="2" class="tab">
<tr>
<table border="0" cellspacing="1" cellpadding=3 width="100%" >
<tr>
<td height="30" width="129" valign="middle" align=right><b>登录名</b></td>
<td height="30" valign="middle">
<input class="input" TYPE="text" SIZE="17" value=<%=rs("LoginName")%> disabled>
</td>
<td height="30" rowspan="5" valign="middle" align="center">
<%
sPhoto=rs("Photo")
if sPhoto<>"" then
%>
<img src="../Photo/<%=sPhoto%>" border=1 width="130"> <br>
<input type="button" value="更改照片" class="button0" onmouseout=className="button0" onmouseover=className="button1" onclick="OpenWindow('PhotoUpfrm.asp?ID=<%=LoginID%>','PhotoWindow')">
<%else%>
<%if ID<>"0" then%>
<input type="button" value="上传照片" class="button0" onmouseout=className="button0" onmouseover=className="button1" onclick="OpenWindow('PhotoUpfrm.asp?ID=<%=LoginID%>','PhotoWindow')">
<%end if%>
<%end if%>
</td>
</tr>
<tr>
<td valign="middle" align=right width="129"><b>登录口令</b><font COLOR="RED">*</font></td>
<td valign="middle">
<input TYPE="password" SIZE="17" NAME="Pwd" maxlength="40" class="input">
</td>
</tr>
<tr>
<td valign="middle" align=right width="129"><b>检验口令</b><font COLOR="RED">*</font></td>
<td valign="middle">
<input TYPE="password" SIZE="17" NAME="ConfirmPwd" maxlength="40" class="input">
</td>
</tr>
<tr>
<td align=right width="129"><b>生日</b> </td>
<td colspan="2">
<input TYPE="TEXT" SIZE="12" MAXLENGTH="12" NAME="birthday" value="<%if rs("birthday")<>"1900-01-01" then response.write rs("birthday")%>" class="input" readonly> <a href=# title="选择日期" onClick="fPopUpDlg('../js/calendar.htm', document.Rightfrm.birthday, 'winpop', 234, 261);return false"><img src="../images/datetime.gif" border=0></a>
</td>
</tr>
<tr>
<td VALIGN="TOP" align=right width="129"><b>E-mail</b> </td>
<td colspan="2">
<input TYPE="TEXT" SIZE="30" MAXLENGTH="30" NAME="Email" value="<%=rs("eMail")%>" class="input">
</td>
</tr>
<tr>
<td VALIGN="TOP" align=right width="129"><b>电话(O)</b> </td>
<td colspan="2">
<input TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="OfficeTel" value="<%=rs("OfficeTel")%>" class="input">
</td>
</tr>
<tr>
<td VALIGN="TOP" ALIGN="right" width="129"><b>电话(H)</b> </td>
<td colspan="2">
<input TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="HomeTel" value="<%=rs("HomeTel")%>" class="input">
</td>
</tr>
<tr>
<td VALIGN="TOP" ALIGN="right" width="129"><b>传真</b> </td>
<td colspan="2">
<input TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Fax" value="<%=rs("Fax")%>" class="input">
</td>
</tr>
<tr>
<td VALIGN="TOP" ALIGN="right" width="129"><b>小灵通</b> </td>
<td colspan="2">
<input TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Pager" value="<%=rs("Pager")%>" class="input">
</td>
</tr>
<tr>
<td VALIGN="TOP" ALIGN="right" width="129"><b>手机</b> </td>
<td colspan="2">
<input TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Mobiletel" value="<%=rs("Mobiletel")%>" class="input">
</td>
</tr>
<tr>
<td VALIGN="TOP" ALIGN="right" width="129"><b>邮政编码</b> </td>
<td colspan=2>
<input TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Postcode" value="<%=rs("PostCode")%>" class="input">
</td>
</tr>
<tr>
<td VALIGN="TOP" ALIGN="right" width="129"><b>详细地址</b> </td>
<td colspan=2>
<input TYPE="TEXT" SIZE="30" MAXLENGTH="40" NAME="Address" value="<%=rs("Address")%>" class="input">
</td>
</tr>
<td VALIGN="TOP" ALIGN="right" width="129"></td>
<td VALIGN="TOP" ALIGN="LEFT" colspan=2 align="center"> <br>
<input type="submit" class="button0" value="修改信息" name="cmdUpdate" onmouseout=className="button0" onmouseover=className="button1">
</td>
</tr>
</table>
</center>
</div>
</form>
<%
rs.close
end if
%>
</td>
</tr>
<tr>
<td width="25%" class="tdBottom">
</td>
</tr>
</table>
</div>
</body>
</html>
<%'释放对象变量
oConn.close
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -