?? modifypersonalinformation.asp
字號:
<%@ Language=VBScript %>
<%
'判斷用戶是否登錄
if isempty(Session("ID")) then
Response.Redirect "../Login.asp"
end if
%>
<%
'連接系統數據庫
set conn = server.createobject ("adodb.connection")
conn.open "ASPData", "sa", "yourpassword"
'如果用戶提交了表單
if not IsEmpty(Request.Form("Send")) then
'進行用戶身份校驗
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")
'更新用戶個人信息
conn.Execute " update PSLogins 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 = "您的個人信息已經修改成功"
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 PSLogins 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 = "您的個人信息已經修改成功"
else
TheMessage = "新密碼輸入不一致,請重試"
end if
end if
else
TheMessage = "您輸入的密碼有誤,請重試"
end if
else
TheMessage = "請在下面修改您的個人信息"
end if
%>
<HTML>
<HEAD>
<TITLE>Employee Email Blast</TITLE>
<META NAME="Generator" CONTENT="NetObjects Fusion 2.0.2 for Windows">
</HEAD>
<BODY BGCOLOR="">
<table width=800 border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#996633" bgcolor=#164DA8>
<tr bgcolor=white>
<td valign=center bgcolor="#0066CC" >
<div align="center"><font color="#CCCCCC" size="+7" face="華文隸書"><strong>公司內部辦公信息管理系統</strong></font></div></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="13"> </td>
</tr>
</table>
<br>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr><td colspan=3>
<font color=white>
<P ALIGN="CENTER"><font size="2">公司內部辦公信息管理系統->員工信息管理系統->修改我的個人信息 [當前用戶-
<% response.write Session("Name") %>
]</font> </font></td></tr>
<tr bgcolor=white >
<td><a href=".././html/home.asp"><font color="#104DAD" size="2">返回內網主頁</font></a></td>
<td align=center> <font color="#104DAD" ><% response.write TheMessage %></FONT></td>
<td align=right><a href="EmployeeInformation.asp"><font color="#104DAD" size="2">返回上一級網頁</font></a></td>
</tr>
</table>
<table width="800" border="0" bordercolor="#164DA8" 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"> </td>
</tr>
</table></td>
</tr>
</table>
<br>
<FORM ACTION="ModifyPersonalInformation.asp" METHOD=POST>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=1 bordercolor="#164DA8" WIDTH=800 align=center>
<TR VALIGN="center" ALIGN="center">
<TD WIDTH=30% bgcolor=#B5C7EF><P></td>
<td>
<br>
<table CELLPADDING=0 CELLSPACING=1 BORDER=0 align=center width=100%>
<tr>
<td width=25%><font color="#164DA8" size="2">姓名</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="#164DA8" size="2">電子郵件地址</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="#164DA8" size="2">內部分機電話</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="#164DA8" size="2">移動電話</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="#164DA8" size="2">家庭電話</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="#164DA8" size="2">QQ號</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="#164DA8" size="2">生日</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="#164DA8" size="2">家庭住址</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="#164DA8" size="2">請輸入您的密碼</font> </td>
<td><INPUT TYPE="Password" NAME="Password" VALUE="" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">請輸入您的新密碼</font></td>
<td><INPUT TYPE="Password" NAME="NewPassword" VALUE="" SIZE=51 MAXLENGTH=50 ></td>
</tr>
<tr>
<td width=25%><font color="#164DA8" size="2">請確認您的新密碼</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="修改個人信息" style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB"></TD>
</TD>
</TR>
</table>
</FORM>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -