?? edit_user.asp
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--#include file="connsf.asp" -->
<!--#include file="md5.inc" -->
<!--#include file="checkstr.asp" -->
<!--#include file="config.asp" -->
<%'檢驗用戶
user=checkstr(session("user"))
pass1=ucase(md5(session("pass")))
str="select 姓名,能否發送 from user_teacher where 用戶名='"&user&"' and 密碼='"&pass1&"'"
set rs=conn.execute(str)
if rs.eof then
response.redirect("user_login.asp")
else
user_name=rs("姓名")
sendyesno=rs("能否發送")
end if
rs.close
%>
<%doing=Trim(Request.QueryString("doing"))%>
<%'修改基本資料
if doing="edit_basic" then
sex=Trim(Request.Form("sex"))
address=Trim(Request.Form("address"))
address=checkstr(address)
if address="" then address=" "
postadd=Trim(Request.Form("postadd"))
postadd=checkstr(postadd)
if postadd="" then postadd=" "
photno=Trim(Request.Form("photno"))
photno=checkstr(photno)
if photno="" then photno=" "
sql="select * from user_teacher where 用戶名='"&user&"' and 密碼='"&pass1&"'"
rs.open sql,conn,2,3
rs("性別")=sex
rs("家庭地址")=address
rs("郵政編碼")=postadd
rs("電話")=photno
rs.update
rs.close
end if
%>
<%'修改用戶密碼
if doing="edit_pass" then
old_pass=Trim(Request.Form("old_pass"))
if old_pass<>session("pass") then
msg="輸入原密碼錯!"
else
new_pass=Trim(Request.Form("new_pass1"))
new_pass1=ucase(md5(new_pass))
sql="select * from user_teacher where 用戶名='"&user&"' and 密碼='"&pass1&"'"
rs.open sql,conn,2,3
rs("密碼")=new_pass1
rs.update
rs.close
session("pass")=new_pass
pass1=ucase(md5(session("pass")))
end if
end if
%>
<%'修改用戶所處職務部門
if doing="edit_zwbm" then
new_bumen=Trim(Request.Form("new_bumen"))
new_zhiwu=Trim(Request.Form("new_zhiwu"))
new_zhiwu=replace(new_zhiwu," ","")
new_zhiwu=replace(new_zhiwu,",","|")
new_zhiwu="|"&new_zhiwu&"|"
sql="select * from user_teacher where 用戶名='"&user&"' and 密碼='"&pass1&"'"
rs.open sql,conn,2,3
rs("職務")=new_zhiwu
rs("部門")=new_bumen
rs.update
rs.close
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改個人資料</title>
<!--#include file="css.css" -->
<script LANGUAGE="javascript">
<!--
function editpass_onsubmit() {
var i, n;
if (document.editpass.new_pass1.value=="")
{
alert("對不起,請輸入新密碼!")
document.editpass.new_pass1.focus()
return false
}
else if (document.editpass.new_pass1.value.length < 5)
{
alert("對不起,新密碼須不少于6位!")
document.editpass.new_pass2.focus()
return false
}
else if (document.editpass.new_pass1.value.length > 20)
{
alert("對不起,新密碼須不多于20位!")
document.editpass.new_pass1.focus()
return false
}
else if (document.editpass.new_pass1.value != document.editpass.new_pass2.value)
{
alert("對不起,二次密碼不一致!")
document.editpass.new_pass2.focus()
return false
}
}
//Function to open pop up window
function openWin(theURL,winName,features) {
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body topmargin="1" oncontextmenu="return false">
<div align="center">
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tabletblg">
<tr>
<td><!--#include file="top.asp" --></td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td height="30" bgcolor="#6699FF">
<!--#include file="menu.asp" -->
</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#6699FF" class="tablelrb">
<tr>
<td height="30" class="fontsize14"> <%=user_name%>,你好!歡迎使用留溪網上傳文系統。 現在可以修改你的個人資料。</td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelrb">
<tr>
<td bgcolor="#6699FF"><table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table>
<%str="select * from user_teacher where 用戶名='"&user&"'"
set rs=conn.execute(str)%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form1" method="post" action="edit_user.asp?doing=edit_basic">
<table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff" bgcolor="#99CCFF">
<tr>
<td width="60" rowspan="7" class="fontsize14"><div align="center" class="fontsize14h20">修<br>
改<br>
用<br>
戶<br>
基<br>
本<br>
資<br>
料</div></td>
<td width="260" height="26" class="fontsize14">
<div align="center">用 戶 名:</div></td>
<td width="420" class="fontsize12wu"><%=user%></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">用戶姓名:</div></td>
<td width="420" class="fontsize12wu"><%=user_name%></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">用戶性別:</div></td>
<td width="420" class="fontsize14"><select name="sex" class="inputtext" id="sex">
<option value="男" <%if rs("性別")="男" then%>selected<%end if%>>男</option>
<option value="女" <%if rs("性別")="女" then%>selected<%end if%>>女</option>
</select></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">用戶地址:</div></td>
<td width="420" class="fontsize12wu"><input name="address" type="text" class="inputtext" id="address" value="<%=rs("家庭地址")%>" size="50"></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">郵政編碼:</div></td>
<td width="420" class="fontsize12wu"><input name="postadd" type="text" class="inputtext" id="postadd" value="<%=rs("郵政編碼")%>"></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14">
<div align="center">電話號碼:</div></td>
<td width="420" class="fontsize12wu"><input name="photno" type="text" class="inputtext" id="photno" value="<%=rs("電話")%>"></td>
</tr>
<tr>
<td height="34" colspan="2" class="fontsize14">
<div align="center">
<input name="Submit" type="submit" class="inputbox" value=" 修 改 ">
<input name="Submit2" type="reset" class="inputbox" value=" 重 置 ">
</div></td>
</tr>
</table>
</td></form>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<form name="editpass" LANGUAGE="javascript" onsubmit="return editpass_onsubmit()" method="post" action="edit_user.asp?doing=edit_pass">
<table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff" bgcolor="#99CCFF">
<tr>
<td width="60" rowspan="4" class="fontsize14"><div align="center" class="fontsize14h20">修<br>
改<br>
密<br>
碼</div></td>
<td width="260" height="26" class="fontsize14"> <div align="center">原來密碼:</div></td>
<td width="420" class="fontsize12wu"><input name="old_pass" type="password" class="inputtext" id="old_pass"></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14"> <div align="center">新設密碼:</div></td>
<td width="420" class="fontsize12wu"><input name="new_pass1" type="password" class="inputtext" id="new_pass1"></td>
</tr>
<tr>
<td width="260" height="26" class="fontsize14"> <div align="center">驗證密碼:</div></td>
<td width="420" class="fontsize12wu"><input name="new_pass2" type="password" class="inputtext" id="new_pass2"></td>
</tr>
<tr>
<td height="34" colspan="2" class="fontsize14"> <div align="center">
<input name="Submit3" type="submit" class="inputbox" value=" 修 改 ">
<input name="Submit22" type="reset" class="inputbox" value=" 重 置 ">
</div></td>
</tr>
<%if msg<>"" then%>
<tr>
<td height="24" colspan="3" class="fontsize14"><div align="center"><strong><font color="#FF0000"><%=msg%></font></strong></div></td>
</tr>
<%end if%>
</table>
</td></form>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form2" method="post" action="edit_user.asp?doing=edit_zwbm">
<table width="740" border="1" align="center" cellpadding="2" cellspacing="0" borderColorLight="#000000" borderColorDark="#ffffff" bgcolor="#99CCFF">
<tr>
<td width="60" rowspan="3" class="fontsize14"><div align="center" class="fontsize14h20">修改<br>
職務<br>
部門 </div></td>
<td width="180" height="26" class="fontsize14"> <div align="center">選擇部門:</div></td>
<td width="500" class="fontsize12wu"><select name="new_bumen" class="inputtext" id="new_bumen">
<%str="select * from woa_bumeng"
set rs1=conn.execute(str)
if not rs1.eof then
do while not rs1.eof%>
<option value="<%=rs1("部門")%>" <%if rs("部門")=rs1("部門") then%>selected<%end if%>><%=rs1("部門")%></option>
<%rs1.movenext
loop
end if
rs1.close%>
</select></td>
</tr>
<tr>
<td width="180" height="26" valign="top" class="fontsize14">
<div align="center">
<p class="fontsize14h20">選擇職務:</p>
</div></td>
<td width="500" class="fontsize12wu"><table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<%str="select * from woa_zhuwu"
set rs1=conn.execute(str)
if not rs1.eof then
m=0
do while not rs1.eof%>
<td width="25%"><input name="new_zhiwu" type="checkbox" id="new_zhiwu" value="<%=rs1("職務")%>" <%if instr(rs("職務"),"|"&rs1("職務")&"|")>0 then%>checked<%end if%>>
<span class="fontsize12"><%=rs1("職務")%></span></td>
<%rs1.movenext
m=m+1
if m mod 4=0 then response.write "</tr><tr>"
loop
end if
rs1.close%>
</tr>
</table></td>
</tr>
<tr>
<td height="34" colspan="2" class="fontsize14"> <div align="center">
<input name="Submit32" type="submit" class="inputbox" value=" 修 改 ">
<input name="Submit222" type="reset" class="inputbox" value=" 重 置 ">
</div></td>
</tr>
</table>
</td></form>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="fontsize10"> </td>
</tr>
</table> </td>
</tr>
</table>
<table width="760" border="0" cellpadding="0" cellspacing="0" class="tablelr">
<tr>
<td class="fontsize04"> </td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<%rs.close%>
<td><!--#include file="bottom.asp" --></td>
</tr>
</table>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -