UserModify.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:14k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <%
  6. MF_Session_TF
  7. Dim P_UserID,P_UserModify_Obj,P_Temp_UserName
  8. P_UserID = Request("ID")
  9. Set P_UserModify_Obj = User_Conn.Execute("Select * from FS_Members where ID="&Clng(P_UserID)&"")
  10. If P_UserModify_Obj.eof then
  11. Response.Write("<script>alert(""参数传递错误"");window.close();</script>")
  12. Response.End
  13. End If
  14. P_Temp_UserName = P_UserModify_Obj("UserName")
  15. %>
  16. <%
  17. If  Request.Form("action") = "mod" then
  18.     Dim P_UserAdd_Obj,P_UserAdd_Sql,P_Choose_UserName_Obj,P_UserName_Str
  19. If NoCSSHackAdmin(Request.Form("UserName"),"会员名")="" or isnull(Request.Form("UserName")) then
  20. Response.Write("<script>alert(""请填写会员登录名"");</script>")
  21. Response.End
  22. Else
  23. P_UserName_Str = Replace(Replace(Request.Form("UserName"),"""",""),"'","")
  24. End If
  25. Set P_Choose_UserName_Obj = User_Conn.Execute("Select count(ID) from FS_Members where MemName='"&P_UserName_Str&"'")
  26. If Cstr(P_UserModify_Obj("UserName"))=Cstr(P_UserName_Str) and P_Choose_UserName_Obj(0)>1 then
  27. Response.Write("<script>alert(""此会员登录名已经存在,请修改"");</script>")
  28. Response.End
  29. Elseif Cstr(P_UserModify_Obj("UserName"))<>Cstr(P_UserName_Str) and P_Choose_UserName_Obj(0)<>0 then
  30. Response.Write("<script>alert(""此会员登录名已经存在,请修改"");</script>")
  31. Response.End
  32. End If
  33. P_Choose_UserName_Obj.Close
  34. Set P_Choose_UserName_Obj = Nothing
  35. If Request.Form("Password")<>"" and Cstr(Request.Form("Password"))<>Cstr(Request.Form("PasswordTF")) then
  36. Response.Write("<script>alert(""密码与确认密码不同"");</script>")
  37. Response.End
  38. End If
  39. If Request.Form("Name")="" or isnull(Request.Form("Name")) then
  40. Response.Write("<script>alert(""请填写会员真实姓名"");</script>")
  41. Response.End
  42. End If
  43. '===========================================
  44. '判断输入的生日格式,正确才保存
  45. If Request.Form("Birthday")<>"" then
  46. If Not Isdate(Request.Form("Birthday")) then 
  47. Response.Write("<script>alert(""请输入正确的生日格式,例:1976-1-1"");</script>")
  48. Response.End
  49. end if
  50. End If
  51. '==========================================
  52. Set P_UserAdd_Obj = Server.CreateObject(G_FS_RS)
  53. P_UserAdd_Sql = "Select * from FS_Members where ID="&P_UserID&""
  54. P_UserAdd_Obj.Open P_UserAdd_Sql,User_Conn,3,3
  55. P_UserAdd_Obj("UserName") = Replace(Replace(Request.Form("UserName"),"""",""),"'","")
  56. If Request.Form("Password")<>"" then
  57. P_UserAdd_Obj("UserPassword") = md5(Request.Form("Password"),16)
  58. End If
  59. P_UserAdd_Obj("GroupID") = Request.Form("GroupID")
  60. P_UserAdd_Obj("RealName") = Replace(Replace(Request.Form("Name"),"""",""),"'","")
  61. P_UserAdd_Obj("Email") = Request.Form("Email")
  62. P_UserAdd_Obj("Telephone") = Request.Form("Telephone")
  63. P_UserAdd_Obj("QQ") = Request.Form("QQ")
  64. P_UserAdd_Obj("HomePage") = Request.Form("HomePage")
  65. P_UserAdd_Obj("LoginNum") = Request.Form("LoginNum")
  66. P_UserAdd_Obj("Address") = Request.Form("Address")
  67. P_UserAdd_Obj("SelfIntro") = Request.Form("SelfIntro")
  68. P_UserAdd_Obj("AddUser") = Request.Form("AddUser")
  69. if Request.Form("Integral") <> "" then
  70. P_UserAdd_Obj("Integral") = Request.Form("Integral")
  71. end if
  72. P_UserAdd_Obj("FaceFile") = Request.Form("FaceFile")
  73. If Request.Form("Birthday")<>"" then
  74. P_UserAdd_Obj("BothYear") = Request.Form("Birthday")
  75. End If
  76. P_UserAdd_Obj("MSN") = Request.Form("MSN")
  77. P_UserAdd_Obj("Corner") = Request.Form("Corner")
  78. P_UserAdd_Obj("Province") = Request.Form("Province")
  79. P_UserAdd_Obj("City") = Request.Form("City")
  80. P_UserAdd_Obj("Vocation") = Request.Form("Vocation")
  81. P_UserAdd_Obj("EduLevel") = Request.Form("EduLevel")
  82. If Request.Form("IsOpen") = "0" then
  83. P_UserAdd_Obj("IsOpen") = "0"
  84. Else
  85. P_UserAdd_Obj("IsOpen") = "1"
  86. End If
  87. If Request.Form("SubInfTF") = "0" then
  88. P_UserAdd_Obj("SubInfTF") = "0"
  89. Else
  90. P_UserAdd_Obj("SubInfTF") = "1"
  91. End If
  92. P_UserAdd_Obj("PassQuestion") = Request.Form("PassQuestion")
  93. P_UserAdd_Obj("PassAnswer") = Request.Form("PassAnswer")
  94. P_UserAdd_Obj("UnderWrite") = Request.Form("UnderWrite")
  95. If Request.Form("Lock") = "0" then
  96. P_UserAdd_Obj("Lock") = "0"
  97. Else
  98. P_UserAdd_Obj("Lock") = "1"
  99. End If
  100. If Request.Form("Sex") = "0" then
  101. P_UserAdd_Obj("Sex") = "0"
  102. Else
  103. P_UserAdd_Obj("Sex") = "1"
  104. End If
  105. P_UserAdd_Obj.Update
  106. P_UserAdd_Obj.Close
  107. Set P_UserAdd_Obj = Nothing
  108. If Cstr(P_Temp_UserName) <> Cstr(Replace(Replace(Request.Form("UserName"),"""",""),"'","")) then
  109. User_Conn.Execute("Update FS_Message set MeRead='"&Replace(Replace(Request.Form("UserName"),"""",""),"'","")&"' where MeRead='"&P_Temp_UserName&"'")
  110. End If
  111. Response.Redirect("SysUserList.asp")
  112. Response.End
  113. End If
  114. %>
  115. <TITLE>修改会员信息</TITLE>
  116. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  117. </HEAD>
  118. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  119. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  120. <body leftmargin="2" topmargin="2">
  121. <form action="" method="post" name="UserAddSForm">
  122. <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#999999">
  123.   <tr class="hback"> 
  124.     <td height="26" colspan="5" valign="middle">
  125.       <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
  126.         <tr>
  127.           <td width=35 align="center" alt="保存" onClick="document.UserAddSForm.submit();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">保存</td>
  128.   <td width=2 class="Gray">|</td>
  129.   <td width=35 align="center" alt="后退" onClick="top.GetEkMainObject().history.back();" onMouseMove="BtnMouseOver(this);" onMouseOut="BtnMouseOver(this);" class="BtnMouseOut">后退</td>
  130.           <td>&nbsp; <input name="action" type="hidden" id="action" value="mod"></td>
  131.         </tr>
  132.       </table>
  133.   </td>
  134.   </tr>
  135. </table>
  136.   <table width="100%"  border="0" cellpadding="3" cellspacing="1">
  137.     <tr> 
  138.       <td width="9%" bgcolor="#EAEAEA">
  139. <div align="right">会&nbsp;员&nbsp;名</div></td>
  140.       <td width="37%" >
  141. <input name="UserName" readonly type="text" id="UserName" style="width:90%" value="<%=P_UserModify_Obj("UserName")%>"></td>
  142.       <td width="12%" bgcolor="#EAEAEA">
  143. <div align="right">会&nbsp;员&nbsp;组</div></td>
  144.       <td width="39%" >
  145. <select name="GroupID" id="GroupID" style="width:90%">
  146.           <option value="0" <%If P_UserModify_Obj("GroupID") = "" or  P_UserModify_Obj("GroupID") = "0" Or IsNull(P_UserModify_Obj("GroupID")) then Response.Write("selected") end if%>> </option>
  147. <%
  148. Dim SelGroupObj
  149. Set SelGroupObj = User_Conn.Execute("Select GroupID,Name from FS_MemGroup order by PopLevel desc")
  150. do while not SelGroupObj.eof 
  151. If P_UserModify_Obj("GroupID") <> "" And  P_UserModify_Obj("GroupID") <> "0" And (Not IsNull(P_UserModify_Obj("GroupID"))) Then
  152. %>
  153. <option value="<%=SelGroupObj("GroupID")%>" <%If Cstr(P_UserModify_Obj("GroupID"))=Cstr(SelGroupObj("GroupID")) then Response.Write("selected") end if%>><%=SelGroupObj("Name")%></option>
  154. <%
  155. Else
  156. %>
  157. <option value="<%=SelGroupObj("GroupID")%>" selected><%=SelGroupObj("Name")%></option>
  158. <%
  159. End If
  160. SelGroupObj.MoveNext
  161. Loop
  162. SelGroupObj.Close
  163. Set SelGroupObj = Nothing
  164. %>
  165.         </select></td>
  166.     </tr>
  167.     <tr> 
  168.       <td bgcolor="#EAEAEA">
  169. <div align="right">密&nbsp;&nbsp;&nbsp;&nbsp;码</div></td>
  170.       <td >
  171. <input name="Password" type="password" id="Password" style="width:90%"></td>
  172.       <td bgcolor="#EAEAEA">
  173. <div align="right">确认密码</div></td>
  174.       <td >
  175. <input name="PasswordTF" type="password" id="PasswordTF2" style="width:90%"></td>
  176.     </tr>
  177.     <tr> 
  178.       <td bgcolor="#EAEAEA">
  179. <div align="right">真实姓名</div></td>
  180.       <td >
  181. <input name="Name" type="text" id="Name2" style="width:90%" value="<%=P_UserModify_Obj("RealName")%>"></td>
  182.       <td bgcolor="#EAEAEA">
  183. <div align="right">电话号码</div></td>
  184.       <td >
  185. <input name="Telephone" type="text" id="Telephone2" style="width:90%" value="<%=P_UserModify_Obj("Tel")%>"></td>
  186.     </tr>
  187.     <tr> 
  188.       <td bgcolor="#EAEAEA">
  189. <div align="right">E_Mail</div></td>
  190.       <td >
  191. <input name="Email" type="text" id="Email2" style="width:90%" value="<%=P_UserModify_Obj("Email")%>"></td>
  192.       <td bgcolor="#EAEAEA">
  193. <div align="right">QQ号:&nbsp;&nbsp;</div></td>
  194.       <td ><input name="QQ" type="text" id="Oicq2" style="width:90%" value="<%=P_UserModify_Obj("QQ")%>"></td>
  195.     </tr>
  196.     <tr> 
  197.       <td bgcolor="#EAEAEA">
  198. <div align="right">MSN</div></td>
  199.       <td >
  200. <input name="MSN" type="text" id="MSN2" style="width:90%" value="<%=P_UserModify_Obj("MSN")%>"></td>
  201.       <td bgcolor="#EAEAEA">
  202. <div align="right">会员主页</div></td>
  203.       <td >
  204. <input name="HomePage" type="text" id="HomePage2" style="width:90%" value="<%=P_UserModify_Obj("HomePage")%>"></td>
  205.     </tr>
  206.     <tr> 
  207.       <td bgcolor="#EAEAEA">
  208. <div align="right">联系地址</div></td>
  209.       <td >
  210. <input name="Address" type="text" id="Address2" style="width:90%" value="<%=P_UserModify_Obj("Address")%>"></td>
  211.       <td bgcolor="#EAEAEA">
  212. <div align="right">国家及区域</div></td>
  213.       <td >
  214. <input name="Corner" type="text" id="Corner2" style="width:90%" value="<%=P_UserModify_Obj("Corner")%>"></td>
  215.     </tr>
  216.     <tr> 
  217.       <td bgcolor="#EAEAEA">
  218. <div align="right">省&nbsp;&nbsp;&nbsp;&nbsp;份</div></td>
  219.       <td >
  220. <input name="Province" type="text" id="Province2" style="width:90%" value="<%=P_UserModify_Obj("Province")%>"></td>
  221.       <td bgcolor="#EAEAEA">
  222. <div align="right">城&nbsp;&nbsp;&nbsp;&nbsp;市</div></td>
  223.       <td >
  224. <input name="City" type="text" id="City2" style="width:90%" value="<%=P_UserModify_Obj("City")%>"></td>
  225.     </tr>
  226.     <tr> 
  227.       <td bgcolor="#EAEAEA">
  228. <div align="right">职&nbsp;&nbsp;&nbsp;&nbsp;业</div></td>
  229.       <td >
  230. <input name="Vocation" type="text" id="Vocation2" style="width:90%" value="<%=P_UserModify_Obj("Vocation")%>"></td>
  231.       <td bgcolor="#EAEAEA">
  232. <div align="right">证&nbsp;&nbsp;&nbsp;&nbsp;件</div></td>
  233.       <td >
  234. <input name="EduLevel" type="text" id="EduLevel2" style="width:90%" value="<%=P_UserModify_Obj("EduLevel")%>"></td>
  235.     </tr>
  236.     <tr> 
  237.       <td bgcolor="#EAEAEA">
  238. <div align="right">登录次数</div></td>
  239.       <td >
  240. <input name="LoginNum" type="text" id="LoginNum2" style="width:90%" value="<%=P_UserModify_Obj("LoginNum")%>"></td>
  241.       <td bgcolor="#EAEAEA">
  242. <div align="right">积&nbsp;&nbsp;&nbsp;&nbsp;分</div></td>
  243.       <td >
  244. <input name="Integral" type="text" id="Integral" style="width:90%" value="<%=P_UserModify_Obj("Integral")%>"></td>
  245.     </tr>
  246.     <tr> 
  247.       <td bgcolor="#EAEAEA">
  248. <div align="right">密码提示</div></td>
  249.       <td >
  250. <input name="PassQuestion" type="text" id="PassQuestion2" style="width:90%" value="<%=P_UserModify_Obj("PassQuestion")%>"></td>
  251.       <td bgcolor="#EAEAEA">
  252. <div align="right">问题答案</div></td>
  253.       <td >
  254. <input name="PassAnswer" type="text" id="PassAnswer2" style="width:90%" value="<%=P_UserModify_Obj("PassAnswer")%>"></td>
  255.     </tr>
  256.     <tr> 
  257.       <td bgcolor="#EAEAEA">
  258. <div align="right">介 绍 人</div></td>
  259.       <td >
  260. <input name="AddUser" type="text" id="AddUser2" style="width:90%" value="<%=P_UserModify_Obj("AddUser")%>"></td>
  261.       <td bgcolor="#EAEAEA">
  262. <div align="right">头像图片</div></td>
  263.       <td >
  264. <input name="FaceFile" type="text" id="FaceFile2" style="width:90%" value="<%=P_UserModify_Obj("FaceFile")%>"></td>
  265.     </tr>
  266.     <tr> 
  267.       <td bgcolor="#EAEAEA">
  268. <div align="right">签&nbsp;&nbsp;&nbsp;&nbsp;名</div></td>
  269.       <td >
  270. <input name="UnderWrite" type="text" id="UnderWrite2" style="width:90%" value="<%=P_UserModify_Obj("UnderWrite")%>"></td>
  271.       <td bgcolor="#EAEAEA">
  272. <div align="right">出身年月</div></td>
  273.       <td >
  274. <input name="Birthday" type="text" id="Birthday2" style="width:90%" value="<%=P_UserModify_Obj("BothYear")%>"></td>
  275.     </tr>
  276.     <tr> 
  277.       <td bgcolor="#EAEAEA">
  278. <div align="right">最后登录</div></td>
  279.       <td >
  280. <input name="LastLoginIP" type="text" id="LastLoginIP2" style="width:90%" value="<%=P_UserModify_Obj("LastLoginIP")%>" readonly></td>
  281.       <td bgcolor="#EAEAEA">
  282. <div align="right">登录时间</div></td>
  283.       <td >
  284. <input name="LastLoginTime" type="text" id="LastLoginTime2" style="width:90%" value="<%=P_UserModify_Obj("LastLoginTime")%>" readonly></td>
  285.     </tr>
  286.     <tr> 
  287.       <td bgcolor="#EAEAEA">
  288. <div align="right">锁&nbsp;&nbsp;&nbsp;&nbsp;定</div></td>
  289.       <td >
  290. <input type="radio" name="Lock" value="1" <%If P_UserModify_Obj("Lock") = "1" then Response.Write("checked") end if%>>
  291.         是 
  292.         <input name="Lock" type="radio" value="0" <%If P_UserModify_Obj("Lock") = "0" or P_UserModify_Obj("Lock") = "" then Response.Write("checked") end if%>>
  293.         否</td>
  294.       <td bgcolor="#EAEAEA">
  295. <div align="right">性&nbsp;&nbsp;&nbsp;&nbsp;别</div></td>
  296.       <td >
  297. <input name="Sex" type="radio" value="0" <%If P_UserModify_Obj("Sex") = "0" or P_UserModify_Obj("Sex") = "" then Response.Write("checked") end if%>>
  298.         男 
  299.         <input type="radio" name="Sex" value="1" <%If P_UserModify_Obj("Sex") = "1" then Response.Write("checked") end if%>>
  300.         女</td>
  301.     </tr>
  302.     <tr> 
  303.       <td bgcolor="#EAEAEA">
  304. <div align="right">开放资料</div></td>
  305.       <td >
  306. <input name="IsOpen" type="radio" value="1" <% if P_UserModify_Obj("IsOpen")="1" then Response.Write("checked") end if%>>
  307.         是 
  308.         <input type="radio" name="IsOpen" value="0" <% if P_UserModify_Obj("IsOpen")="0" then Response.Write("checked") end if%>>
  309.         否</td>
  310.       <td bgcolor="#EAEAEA">
  311. <div align="right">订阅信息</div></td>
  312.       <td >
  313. <input name="SubInfTF" type="radio" value="1" <% if P_UserModify_Obj("SubInfTF")="1" then Response.Write("checked") end if%>>
  314.         是 
  315.         <input type="radio" name="SubInfTF" value="0" <% if P_UserModify_Obj("SubInfTF")="0" then Response.Write("checked") end if%>>
  316.         否</td>
  317.     </tr>
  318.     <tr> 
  319.       <td bgcolor="#EAEAEA">
  320. <div align="right">个人介绍</div></td>
  321.       <td colspan="3" >
  322. <textarea name="SelfIntro" rows="6" id="SelfIntro" style="width:90%"><%=P_UserModify_Obj("SelfIntro")%></textarea>      </td>
  323.     </tr>
  324. </table>
  325. </form>
  326. </body>
  327. </html>