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

数据库编程

开发平台:

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. Dim Conn,User_Conn
  7. MF_Default_Conn
  8. MF_User_Conn
  9. MF_Session_TF
  10. If  Request.Form("action") = "add" then
  11.     Dim P_UserAdd_Obj,P_UserAdd_Sql,P_ChooseME_NameObj,P_MeName_Str
  12. If NoSqlHack(Request.Form("UserName"))="" or isnull(Request.Form("UserName")) then
  13. Response.Write("<script>alert(""请填写会员登录名"");</script>")
  14. Response.End
  15. Else
  16. End If
  17. If len(Request.Form("UserName"))>10 then
  18. Response.Write("<script>alert(""会员登录名不可以超过10个字符"");</script>")
  19. Response.End
  20. Else
  21. end if
  22. 'by xq
  23. P_MeName_Str = Replace(Replace(Request.Form("Name"),"""",""),"'","")
  24. Set P_ChooseME_NameObj = User_Conn.Execute("Select UserID from FS_Me_Users where UserName='"&P_MeName_Str&"'")
  25. If Not P_ChooseME_NameObj.eof then
  26. Response.Write("<script>alert(""此会员登录名已经存在,请修改"");</script>")
  27. Response.End
  28. End If
  29. P_ChooseME_NameObj.Close
  30. Set P_ChooseME_NameObj = Nothing
  31. If Request.Form("Password")="" or isnull("Password") then
  32. Response.Write("<script>alert(""请输入会员登录密码"");</script>")
  33. Response.End
  34. End If
  35. If Len(Request.Form("Password")) < 6 then
  36. Response.Write("<script>alert(""会员登录密码不能少于六位"");</script>")
  37. Response.End
  38. End If
  39. If Cstr(Request.Form("Password"))<>Cstr(Request.Form("PasswordTF")) then
  40. Response.Write("<script>alert(""密码与确认密码不同"");</script>")
  41. Response.End
  42. End If
  43. If Request.Form("Name")="" or isnull(Request.Form("Name")) then
  44. Response.Write("<script>alert(""请填写会员真实姓名"");</script>")
  45. Response.End
  46. End If
  47. '-------------------
  48. Dim Fs_User,NumShopPoint
  49. Set Fs_User = New Cls_User
  50. NumShopPoint = Fs_User.getUserConfig(6)
  51. Randomize 
  52. Dim RandomFigure
  53. RandomFigure = CStr(Int((9999 * Rnd) + 1))
  54. '----------------------------------
  55. Set P_UserAdd_Obj = Server.CreateObject(G_FS_RS)
  56. P_UserAdd_Sql = "Select * from FS_Me_Users where 1=0"
  57. P_UserAdd_Obj.Open P_UserAdd_Sql,User_Conn,3,3
  58. P_UserAdd_Obj.AddNew
  59. P_UserAdd_Obj("UserName") = Replace(Replace(Request.Form("UserName"),"""",""),"'","")
  60. P_UserAdd_Obj("Password") = md5(Request.Form("Password"),16)
  61. P_UserAdd_Obj("GroupID") = Request.Form("GroupID")
  62. P_UserAdd_Obj("Name") = Replace(Replace(Request.Form("Name"),"""",""),"'","")
  63. If Request.Form("Lock") = "0" then
  64. P_UserAdd_Obj("IsLock") = "0"
  65. Else
  66. P_UserAdd_Obj("IsLock") = "1"
  67. End If
  68. If Request.Form("Sex") = "0" then
  69. P_UserAdd_Obj("Sex") = "0"
  70. Else
  71. P_UserAdd_Obj("Sex") = "1"
  72. End If
  73. P_UserAdd_Obj("RegTime") = Now()
  74. P_UserAdd_Obj("Email")="Foosun@foosun.cn"
  75. P_UserAdd_Obj("LastLoginIP") = Request.ServerVariables("REMOTE_ADDR")
  76. P_UserAdd_Obj("LastLoginTime") = Now()
  77. P_UserAdd_Obj("LoginNum") = 0
  78. P_UserAdd_Obj("Integral") = 100 '会员积分 
  79. P_UserAdd_Obj("UserNumber") = year(now)&month(now)&day(now)&hour(now)&RandomFigure '会员编号
  80. P_UserAdd_Obj.Update
  81. P_UserAdd_Obj.Close
  82. Set P_UserAdd_Obj = Nothing
  83. Response.Redirect("Usermanage.asp")
  84. Response.End
  85. End If
  86. %>
  87. <html>
  88. <HEAD>
  89. <TITLE>添加会员</TITLE>
  90. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  91. </HEAD>
  92. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  93. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  94. <body leftmargin="2" topmargin="2">
  95. <form action="" method="post" name="UserAddSForm">
  96. <table width="100%" border="0" cellpadding="3" cellspacing="1" class="table">
  97.   <tr> 
  98.     <td height="26" colspan="5" valign="middle">
  99.       <table width="100%" height="20" border="0" cellpadding="3" cellspacing="1">
  100.         <tr class="hback">
  101.           <td width=35 align="center" alt="保存" onClick="document.UserAddSForm.submit();" >保存</td>
  102.   <td width=2 >|</td>
  103.   <td width=35 align="center" alt="后退" onClick="top.GetEkMainObject().history.back();" >后退</td>
  104.           <td>&nbsp;<input name="action" type="hidden" id="action" value="add"></td>
  105.         </tr>
  106.       </table>
  107.   </td>
  108.   </tr>
  109. </table>
  110.   <table width="100%"  border="0" cellpadding="3" cellspacing="1" class="table">
  111.     <tr> 
  112.       <td width="100"> 
  113.         <div align="right">会 员 名</div></td>
  114.       <td colspan="3" > 
  115.         <input name="Name" type="text"  id="Name" style="width:100%" value="<%=Request("UserName")%>"></td>
  116.     </tr>
  117.     <tr > 
  118.       <td > 
  119.         <div align="right">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</div></td>
  120.       <td colspan="3"> 
  121.         <input name="Password" type="password" id="Password" style="width:1090%"></td>
  122.     </tr>
  123.     <tr> 
  124.       <td> 
  125.         <div align="right">确认密码</div></td>
  126.       <td colspan="3"> 
  127.         <input name="PasswordTF" type="password" id="PasswordTF" style="width:100%"></td>
  128.     </tr>
  129.     <tr> 
  130.       <td> 
  131.         <div align="right">会 员 组</div></td>
  132.       <td colspan="3"> 
  133.         <select name="GroupID" id="GroupID" style="width:100%">
  134.           <option value="0" <%If Request("GroupID") = "" or  Request("GroupID") = "0" then Response.Write("selected") end if%>> 
  135.           </option>
  136.           <%
  137. Dim P_Set_GroupObj
  138. Set P_Set_GroupObj = User_Conn.Execute("Select GroupID,GroupName from FS_ME_Grouporder by GroupNamedesc")
  139. do while not P_Set_GroupObj.eof 
  140. %>
  141.           <option value="<%=P_Set_GroupObj("GroupID")%>" <%If Cstr(Request("GroupID"))=Cstr(P_Set_GroupObj("GroupID")) then Response.Write("selected") end if%>><%=P_Set_GroupObj("GroupName")%></option>
  142.           <%
  143. P_Set_GroupObj.MoveNext
  144. Loop
  145. P_Set_GroupObj.Close
  146. Set P_Set_GroupObj = Nothing
  147. %>
  148.         </select></td>
  149.     </tr>
  150.     <tr> 
  151.       <td> 
  152.         <div align="right">真实姓名</div></td>
  153.       <td colspan="3"> 
  154.         <input name="Name" type="text" id="Name" size="20" style="width:100%" value="<%=Request("Name")%>"></td>
  155.     </tr>
  156.     <tr valign="middle"> 
  157.       <td> 
  158.         <div align="right">锁&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;定</div></td>
  159.       <td> 
  160.         <input type="radio" name="Lock" value="1" <%If Request("IsLock") = "1" then Response.Write("checked") end if%>>
  161.         是 
  162.         <input name="Lock" type="radio" value="0" <%If Request("IsLock") = "0" or Request("Lock") = "" then Response.Write("checked") end if%>>
  163.         否</td>
  164.     </tr>
  165.     <tr> 
  166.       <td> 
  167.         <div align="right">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</div></td>
  168.       <td> 
  169.         <input name="Sex" type="radio" value="0" <%If Request("Sex") = "0" or Request("Sex") = "" then Response.Write("checked") end if%>>
  170.         男 
  171.         <input type="radio" name="Sex" value="1" <%If Request("Sex") = "1" then Response.Write("checked") end if%>>
  172.         女</td>
  173.     </tr>
  174. </table>
  175. </form>
  176. </body>
  177. </html>