?? modifypersonalinformation.asp
字號(hào):
<%@ Language=VBScript %>
<!--#include file="../conn.asp"-->
<%
'判斷用戶是否登錄
if isempty(Session("ID")) then
Response.Redirect "../Login.asp"
end if
%>
<%
'連接系統(tǒng)數(shù)據(jù)庫
'set conn = server.createobject ("adodb.connection")
'conn.open "ASPData", "sa", ""
'如果用戶提交了表單
if not IsEmpty(Request.Form("Send")) then
'進(jìn)行用戶身份校驗(yàn)
if Request.Form("Password") = Session("Password") then
if len(Request.Form("NewPassword"))=0 then
Session("EmailAddress")=Request.Form("EmailAddress")
Session("InternalPhone")=Request.Form("InternalPhone")
Session("HomePhone")=Request.Form("HomePhone")
Session("MobilePhone")=Request.Form("MobilePhone")
Session("QQ")=Request.Form("QQ")
Session("HomeAddress")=Request.Form("HomeAddress")
Session("Birthday")=Request.Form("BirthdayYear") & "-" & Request.Form("BirthdayMonth") & "-" & Request.Form("BirthdayDay")
'更新用戶個(gè)人信息
conn.Execute " update UserInfo set " _
& "EmailAddress='" & Request.Form("EmailAddress") & "', " _
& "InternalPhone='" & Request.Form("InternalPhone") & "', " _
& "HomePhone='" & Request.Form("HomePhone") & "', " _
& "MobilePhone='" & Request.Form("MobilePhone") & "', " _
& "QQ='" & Request.Form("QQ") & "', " _
& "HomeAddress='" & Request.Form("HomeAddress") & "', " _
& "Birthday='" & Request.Form("BirthdayYear") & "-" _
& Request.Form("BirthdayMonth") & "-" _
& Request.Form("BirthdayDay") & "' " _
& " Where Name='" & Request.Form("Name") &"'"
TheMessage = "您的個(gè)人信息已經(jīng)修改成功"
else
'如果用戶輸入了新密碼
if Request.Form("NewPassword") = Request.Form("ConfirmNewPassword") then
Session("Name") = Request.Form("Name")
Session("Password") = Request.Form("NewPassword")
Session("EmailAddress")=Request.Form("EmailAddress")
Session("InternalPhone")=Request.Form("InternalPhone")
Session("HomePhone")=Request.Form("HomePhone")
Session("MobilePhone")=Request.Form("MobilePhone")
Session("HomeAddress")=Request.Form("HomeAddress")
Session("Birthday")=Request.Form("BirthdayYear") & "-" & Request.Form("BirthdayMonth") & "-" & Request.Form("BirthdayDay")
Session("QQ")=Request.Form("QQ")
Session("HomeAddress")=Request.Form("HomeAddress")
conn.Execute " update UserInfo set " _
& "Password='" & Request.Form("NewPassword") & "', " _
& "EmailAddress='" & Request.Form("EmailAddress") & "', " _
& "InternalPhone='" & Request.Form("InternalPhone") & "', " _
& "HomePhone='" & Request.Form("HomePhone") & "', " _
& "MobilePhone='" & Request.Form("MobilePhone") & "', " _
& "QQ='" & Request.Form("QQ") & "', " _
& "HomeAddress='" & Request.Form("HomeAddress") & "', " _
& "Birthday='" & Request.Form("BirthdayYear") & "-" _
& Request.Form("BirthdayMonth") & "-" _
& Request.Form("BirthdayDay") & "' " _
& " Where Name='" & Request.Form("Name") &"'"
TheMessage = "您的個(gè)人信息已經(jīng)修改成功"
else
TheMessage = "新密碼輸入不一致,請重試"
end if
end if
else
TheMessage = "您輸入的密碼有誤,請重試"
end if
else
TheMessage = "請?jiān)谙旅嫘薷哪膫€(gè)人信息"
end if
%>
<HTML>
<HEAD>
<TITLE>修改個(gè)人信息</TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">
</HEAD>
<BODY BGCOLOR="">
<table width=800 border=0 bgcolor=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr bgcolor=white><td valign=center ><img src="../ASPLogo3.jpg" width=796 height=100></td></tr>
</table>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td></tr>
</table>
<br>
<table width=800 border=0 bgcolor=#16A84D cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3>
<font color=white>
<P ALIGN="CENTER">公司內(nèi)部辦公信息管理系統(tǒng)->員工信息管理系統(tǒng)->修改我的個(gè)人信息 [當(dāng)前用戶-<% response.write Session("Name") %>]
</font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#10AD4D">返回內(nèi)網(wǎng)主頁</font></a></td>
<td align=center> <font color="#10AD4D" ><% response.write TheMessage %></FONT></td>
<td align=right><a href="EmployeeInformation.asp"><font color="#10AD4D">返回上一級網(wǎng)頁</font></a></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#16A84D" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10" colspan="4" valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0" height="13" cellspacing="0" cellpadding="0" mm_noconvert="TRUE">
<tr>
<td height="13"><img src=".././image/banner2.jpg" width="800" height="12"></td>
</tr>
</table></td>
</tr>
</table>
<br>
<FORM ACTION="ModifyPersonalInformation.asp" METHOD=POST>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=1 bordercolor="#16A84D" WIDTH=800 align=center>
<TR VALIGN="center" ALIGN="center">
<TD WIDTH=30% bgcolor=#B5EFC7><P><img src="../image/employee1.jpg"></td>
<td>
<br>
<table CELLPADDING=0 CELLSPACING=1 BORDER=0 align=center width=100%>
<tr><td width=25%><font color="#16A84D">姓名</font></td><td><INPUT TYPE="text" NAME="Name" VALUE="<% response.write Session("Name") %>" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">電子郵件地址</font></td><td><INPUT TYPE="text" NAME="EmailAddress" VALUE="<% response.write Session("EmailAddress") %>" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">內(nèi)部分機(jī)電話</font></td><td><INPUT TYPE="text" NAME="InternalPhone" VALUE="<% response.write Session("InternalPhone") %>" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">移動(dòng)電話</font></td><td><INPUT TYPE="text" NAME="MobilePhone" VALUE="<% response.write Session("MobilePhone") %>" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">家庭電話</font></td><td><INPUT TYPE="text" NAME="HomePhone" VALUE="<% response.write Session("HomePhone") %>" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">QQ號(hào)</font></td><td><INPUT TYPE="text" NAME="QQ" VALUE="<% response.write Session("QQ") %>" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">生日</font></td><td>
<select name="BirthdayYear" size=1>
<%
YearCounter= Year(Session("Birthday"))
%>
<option value="<% Response.Write YearCounter %>">  <% Response.Write YearCounter %>  </option>
<%
YearCounter = 2000
Do until YearCounter <=1900
%>
<OPTION VALUE="<% Response.Write YearCounter %>">  <% Response.Write YearCounter %>  </OPTION>
<%
YearCounter = YearCounter-1
loop
%>
</select> 年  
<select name="BirthdayMonth" size=1>
<%
MonthCounter= Month(Session("Birthday"))
%>
<option value="<% Response.Write MonthCounter %>">  <% Response.Write MonthCounter %>  </option>
<%
MonthCounter = 1
Do until MonthCounter >12
%>
<OPTION VALUE="<% Response.Write MonthCounter %>">  <% Response.Write MonthCounter %>  </OPTION>
<%
MonthCounter = MonthCounter+1
loop
%>
</select> 月  
<select name="BirthdayDay" size=1>
<%
DayCounter= Day(Session("Birthday"))
%>
<option value="<% Response.Write DayCounter %>">  <% Response.Write DayCounter %>  </option>
<%
DayCounter = 1
Do until DayCounter >31
%>
<OPTION VALUE="<% Response.Write DayCounter %>">  <% Response.Write DayCounter %>  </OPTION>
<%
DayCounter = DayCounter+1
loop
%>
</select> 日  
</td></tr>
<tr><td width=25%><font color="#16A84D">家庭住址</font></td><td><INPUT TYPE="text" NAME="HomeAddress" VALUE="<% response.write Session("HomeAddress") %>" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">請輸入您的密碼</font> </td><td><INPUT TYPE="Password" NAME="Password" VALUE="" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">請輸入您的新密碼</font></td><td><INPUT TYPE="Password" NAME="NewPassword" VALUE="" SIZE=51 MAXLENGTH=50 ></td></tr>
<tr><td width=25%><font color="#16A84D">請確認(rèn)您的新密碼</font></td><td><INPUT TYPE="Password" NAME="ConfirmNewPassword" VALUE="" SIZE=51 MAXLENGTH=50 ></td></tr>
</table>
<br>
</td>
</TR>
</table>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=1 WIDTH=800 align=center>
<TR VALIGN="top" ALIGN="center">
<TD WIDTH=100% align=center >
<INPUT TYPE="submit" NAME="Send" VALUE="修改個(gè)人信息" style="border: 1px solid #34BB66; background-color: #B6EBCA; color: #34BB66"></TD>
</TD>
</TR>
</table>
</FORM>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -