<!--#include file="../Inc/Cls_DB.asp" -->
<!--#include file="../Inc/Const.asp" -->
<!--#include file="../Inc/Md5.asp" -->
<!--#include file="../Inc/Function.asp" -->
<%
  dim DBC,conn
  set DBC = new databaseclass
  set conn = DBC.openconnection()
  set DBC = nothing

	Dim I,RsConfigObj
	Set RsConfigObj = Conn.Execute("Select UserConfer,Copyright from Config")
%>
<HTML>
<HEAD>
<link href="../CSS/css.css" rel="stylesheet" type="text/css">
<TITLE>会员注册</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<form action="" method="post" name="UserAddForm">
  <table width="60%" height="27" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="e6e6e6" bgcolor="e6e6e6">
    <tr>
	  <td height="25"> 
        <div align="center"><font color=blue>会员注册</font></div>
	  </td>
	</tr>
  </table>
  <br>
  <table width="60%" border="0" align="center" cellpadding="6" cellspacing="1" bordercolor="e6e6e6" bgcolor="e6e6e6">
    <tr>
      <td bgcolor="#FFFFFF">
      <% = RsConfigObj("UserConfer") %>
        <div align="center"> 
		  <input name="tongguo" type="radio" id=radio4  onClick="Checkchannel();" value="0" checked>
		 不同意
		  <input id=channela type="radio" name="tongguo" value="1" onclick="Checkchannel();">
          同意 <br>
          <br>
        </div></td>
    </tr>
  </table>
  <br>
  <table width="60%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#DDDDDD" id=channel style="DISPLAY:  ">
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="28%"> 
        <div align="center">用 户 名</div></td>
	  <td width="72%"> 
        <input name="MemName" type="text" id="MemName" style="width:60%">
        <font color="#FF6600">*</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</div></td>
      <td> 
        <input name="Password" type="password" id="Password" style="width:60%">
        <font color="#FF6600">*</font> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">确认密码</div></td>
      <td> 
        <input name="Password1" type="password" id="Password1" style="width:60%">
        <font color="#FF6600">*</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">密码问题</div></td>
      <td> 
        <input name="PassQuestion" type="text" id="PassQuestion" style="width:60%">
        <font color="#FF6600">*</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">密码答案</div></td>
      <td> 
        <input name="PassAnswer" type="text" id="PassAnswer" style="width:60%">
        <font color="#FF6600">*</font></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">真实姓名</div></td>
      <td> 
        <input name="Name" type="text" id="Name" style="width:60%"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</div></td>
      <td> 
        <input name="Sex" type="radio" value="1">
        女 
        <input name="Sex" type="radio" value="0" checked>
        男</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">头像地址</div></td>
      <td> 
        <input name="HeadPic" type="text" id="HeadPic" style="width:60%"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">出生日期</div></td>
      <td> 
        <select name="yyear" id="yyear" style="width:11%">
	  <%
	  For I=1949 to Year(Now)
	  %>
          <option value="<%=i%>"><%=i%></option>
	  <%
	  Next
	  %>
        </select> 
        年
		<select name="mmonth" id="mmonth" style="width:11%">
		<%
		For I=1 to 12
		%>
          <option value="<%=i%>"><%=i%></option>
		<%
		Next
		%>
        </select> 
		月
		<select name="dday" id="dday" style="width:11%">
		<%
		For I=1 to 31
		%>
          <option value="<%=i%>"><%=i%></option>
		 <%
		 Next
		 %>
        </select> 
		日</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">电子邮件</div></td>
      <td> 
        <input name="Email" type="text" id="Email" style="width:60%">
        <font color="#FF6600">*</font> </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">电&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;话</div></td>
      <td> 
        <input name="Telephone" type="text" id="Telephone" style="width:60%"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">OICQ</div></td>
      <td> 
        <input name="Oicq" type="text" id="Oicq" style="width:60%"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">MSN</div></td>
      <td> 
        <input name="MSN" type="text" id="MSN" style="width:60%"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">主&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;页</div></td>
      <td> 
        <input name="HomePage" type="text" id="HomePage" style="width:60%" value="http://">        </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;业</div></td>
      <td> 
        <select name=Vocation id="Vocation" style="width:60%">
          <option value="保秘" selected>请选择</option>
          <option value="财会/金融">财会/金融</option>
          <option value="工程师">工程师</option>
          <option value="顾问">顾问</option>
          <option value="计算机相关行业">计算机相关行业</option>
          <option value="家庭主妇">家庭主妇</option>
          <option value="教育/培训">教育/培训</option>
          <option value="客户服务/支持">客户服务/支持</option>
          <option value="零售商/手工工人">零售商/手工工人</option>
          <option value="退休">退休</option>
          <option value="无职业">无职业</option>
          <option value="销售/市场/广告">销售/市场/广告</option>
          <option value="学生">学生</option>
          <option value="研究和开发">研究和开发</option>
          <option value="一般管理/监督">一般管理/监督</option>
          <option value="政府/军队">政府/军队</option>
          <option value="执行官/高级管理">执行官/高级管理</option>
          <option value="制造/生产/操作">制造/生产/操作</option>
          <option value="专业人员">专业人员</option>
          <option value="自雇/业主">自雇/业主</option>
          <option value="其他">其他</option>
        </select></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;历</div></td>
      <td> 
        <select name="EduLevel" id="EduLevel" style="width:60%">
          <option value="保秘" selected>保秘</option>
          <option value="小学">小学以下</option>
          <option value="初中">初中</option>
          <option value="中专/职业高中/高中">中专/职业高中/高中</option>
          <option value="大学">大学</option>
          <option value="研究生">研究生</option>
          <option value="硕士">硕士</option>
          <option value="博士">博士</option>
          <option value="更高学历">更高</option>
        </select></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区</div></td>
      <td> 
        <select name="Corner" id="Corner" style="width:60%">
          <option value="中国" selected>中华人民共和国</option>
          <option value="香港">中国香港</option>
          <option value="澳门">中国澳门</option>
          <option value="台湾">中国台湾</option>
          <option value="国外">国外</option>
        </select></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">省&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;份</div></td>
      <td> 
        <select name="Province" id="Province" style="width:60%">
          <option value="四川" selected>四川</option>
          <option value="广西" > 广西 </option>
          <option value="北京" > 北京 </option>
          <option value="海南" > 海南 </option>
          <option value="福建" > 福建 </option>
          <option value="天津" > 天津 </option>
          <option value="湖南" > 湖南 </option>
          <option value="湖北" > 湖北 </option>
          <option value="河南" > 河南 </option>
          <option value="河北" > 河北 </option>
          <option value="山东" > 山东 </option>
          <option value="山西" > 山西 </option>
          <option value="黑龙江" > 黑龙江 </option>
          <option value="辽宁" > 辽宁 </option>
          <option value="上海" > 上海 </option>
          <option value="甘肃" > 甘肃 </option>
          <option value="青海" > 青海 </option>
          <option value="新疆" > 新疆 </option>
          <option value="西藏" > 西藏 </option>
          <option value="宁夏" > 宁夏 </option>
          <option value="云南" > 云南 </option>
          <option value="吉林" > 吉林 </option>
          <option value="内蒙古" > 内蒙古 </option>
          <option value="陕西" > 陕西 </option>
          <option value="安徽" > 安徽 </option>
          <option value="贵州" > 贵州 </option>
          <option value="江苏" > 江苏 </option>
          <option value="重庆" > 重庆 </option>
          <option value="浙江" > 浙江 </option>
          <option value="江西" > 江西 </option>
          <option value="国外" > 国外 </option>
          <option value="台湾" > 台湾 </option>
          <option value="香港" > 香港 </option>
          <option value="澳门" > 澳门 </option>
        </select></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">城&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;市</div></td>
      <td> 
        <input name="City" type="text" id="City" style="width:60%"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址</div></td>
      <td> 
        <input name="Address" type="text" id="Address" style="width:60%"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">介 绍 人</div></td>
      <td> 
        <input name="AddUser" type="text" id="AddUser" style="width:60%"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">签&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</div></td>
      <td> 
        <textarea name="UnderWrite" rows="4" id="UnderWrite" style="width:60%"></textarea>        </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">个人介绍</div></td>
      <td> 
        <textarea name="SelfIntro" rows="4" id="SelfIntro" style="width:60%"></textarea>        </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">是否开放资料</div></td>
      <td> 
        <input name="OpenInfTF" type="radio" value="1" checked>
	  是
		<input type="radio" name="OpenInfTF" value="0">
        否</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td> 
        <div align="center">是否订阅本站信息</div></td>
      <td> 
        <input name="SubInfTF" type="radio" value="1" checked>
        是 
         
        <input type="radio" name="SubInfTF" value="0">
        否　</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td colspan="2"> 
        <div align="right"></div>        
        <div align="center">
          <input name="Submit" type="submit" class="Anbut" value=" 提 交 "> 
          <input name="Submit2" type="reset" class="Anbut" value=" 重 置 ">        
          <input name="action" type="hidden" id="action" value="add">      
        </div></td>
    </tr>
  </table>
  <table width="60%" height="27" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="e6e6e6">
    <tr>
      <td> 
        <div align="center"> 
          <% = RsConfigObj("Copyright") %>
          　</div></td>
    </tr>
  </table>
</form>
<script>
function Checkchannel()
{
  if (document.UserAddForm.channela.checked == true) 
  {
	  channel.style.display = "";
  }
  else
  {
   channel.style.display = "none";
  }
}
Checkchannel();
</script>
</BODY>
</HTML>
<%
	Dim RsUserAddObj,RsUserSql,RsTempObj
	If Request.Form("action")="add" then
		If Replace(Replace(Request.Form("MemName"),"""",""),"'","")="" or isnull(Request.Form("MemName")) then
			Response.Write("<script>alert(""请输入登录名"");location=""javascript:history.back()"";</script>")
			Response.End
		End If
		Set RsTempObj = Conn.Execute("Select ID from Members where MemName='"&Replace(Replace(Request.Form("MemName"),"""",""),"'","")&"'")
		If Not RsTempObj.Eof then
			Response.Write("<script>alert(""此会员名称已经存在,请重新输入"");location=""javascript:history.back()"";</script>")
			Response.End
		End If
		If Request.Form("Password")="" or Request.Form("Password1")="" then
			Response.Write("<script>alert(""请输入登录密码"");location=""javascript:history.back()"";</script>")
			Response.End
		Else
			If Cstr(Request.Form("Password"))<>Cstr(Request.Form("Password1")) then
				Response.Write("<script>alert(""两次输入密码不同,请重新输入"");location=""javascript:history.back()"";</script>")
				Response.End
			End If
		End If
		If IsValidEmail(Request.Form("Email"))=false then
			Response.Write("<script>alert(""Email格式错误,请重新输入"");location=""javascript:history.back()"";</script>")
			Response.End
		End If
		If Replace(Replace(Request.Form("PassQuestion"),"""",""),"'","")="" then
			Response.Write("<script>alert(""请输入密码提示问题,方便您忘记密码的时候查找"");location=""javascript:history.back()"";</script>")
			Response.End
		End If
		If Replace(Replace(Request.Form("PassAnswer"),"""",""),"'","")="" then
			Response.Write("<script>alert(""请输入密码提示问题答案"");location=""javascript:history.back()"";</script>")
			Response.End
		End If
		Set RsUserAddObj = Server.CreateObject("Adodb.RecordSet")
		RsUserSql = "Select * from Members where 1=0"
		RsUserAddObj.Open RsUserSql,Conn,3,3
		RsUserAddObj.AddNew
		RsUserAddObj("MemName") = Replace(Replace(Request.Form("MemName"),"""",""),"'","")
		RsUserAddObj("Password") = md5(Request.Form("Password"),16)
		RsUserAddObj("Email") = Replace(Replace(Request.Form("Email"),"""",""),"'","")
		If Replace(Replace(Request.Form("Telephone"),"""",""),"'","")<>"" then
			RsUserAddObj("Telephone") = Replace(Replace(Request.Form("Telephone"),"""",""),"'","")
		End If
		If Replace(Replace(Request.Form("Oicq"),"""",""),"'","")<>"" then
			RsUserAddObj("Oicq") = Replace(Replace(Request.Form("Oicq"),"""",""),"'","")
		End If
		If Replace(Replace(Request.Form("HomePage"),"""",""),"'","")<>"http://" and Replace(Replace(Request.Form("HomePage"),"""",""),"'","")<>"" then
			RsUserAddObj("HomePage") = Replace(Replace(Request.Form("HomePage"),"""",""),"'","")
		End If
		If Replace(Replace(Request.Form("Name"),"""",""),"'","")<>"" then
			RsUserAddObj("Name") = Replace(Replace(Request.Form("Name"),"""",""),"'","")
		End If
		If Request.Form("Sex")="1" then
			RsUserAddObj("Sex") = "1"
		Else
			RsUserAddObj("Sex") = "0"
		End If
		If Replace(Replace(Request.Form("Address"),"""",""),"'","")<>"" then
			RsUserAddObj("Address") = Replace(Replace(Request.Form("Address"),"""",""),"'","")
		End If
		If Replace(Replace(Request.Form("SelfIntro"),"""",""),"'","")<>"" then
			RsUserAddObj("SelfIntro") = Replace(Replace(Request.Form("SelfIntro"),"""",""),"'","")
		End If
		If Replace(Replace(Request.Form("AddUser"),"""",""),"'","")<>"" then
			RsUserAddObj("AddUser") = Replace(Replace(Request.Form("AddUser"),"""",""),"'","")
		End If
		If Replace(Replace(Request.Form("HeadPic"),"""",""),"'","")<>"" then
			RsUserAddObj("HeadPic") = Replace(Replace(Request.Form("HeadPic"),"""",""),"'","")
		End If
		If Replace(Replace(Request.Form("MSN"),"""",""),"'","")<>"" then
			RsUserAddObj("MSN") = Replace(Replace(Request.Form("MSN"),"""",""),"'","")
		End If
		If Replace(Replace(Request.Form("UnderWrite"),"""",""),"'","")<>"" then
			RsUserAddObj("UnderWrite") = Replace(Replace(Request.Form("UnderWrite"),"""",""),"'","")
		End If
		RsUserAddObj("Birthday") = Request.Form("yyear")&"-"&Request.Form("mmonth")&"-"&Request.Form("dday")
		RsUserAddObj("Corner") = Replace(Replace(Request.Form("Corner"),"""",""),"'","")
		RsUserAddObj("Province") = Replace(Replace(Request.Form("Province"),"""",""),"'","")
		RsUserAddObj("City") = Replace(Replace(Request.Form("City"),"""",""),"'","")
		RsUserAddObj("EduLevel") = Replace(Replace(Request.Form("EduLevel"),"""",""),"'","")
		RsUserAddObj("Vocation") = Replace(Replace(Request.Form("Vocation"),"""",""),"'","")
		If Request.Form("OpenInfTF")="1" then
			RsUserAddObj("OpenInfTF") = "1"
		Else
			RsUserAddObj("OpenInfTF") = "0"
		End If
		If Request.Form("SubInfTF")="1" then
			RsUserAddObj("SubInfTF") = "1"
		Else
			RsUserAddObj("SubInfTF") = "0"
		End If
		RsUserAddObj("PassQuestion") = Replace(Replace(Request.Form("PassQuestion"),"""",""),"'","")
		RsUserAddObj("PassAnswer") = Replace(Replace(Request.Form("PassAnswer"),"""",""),"'","")
		RsUserAddObj("RegTime") = Now()
		RsUserAddObj("LastLoginIP") = Request.ServerVariables("Remote_ADDR")
		RsUserAddObj("LastLoginTime") = Now()
		RsUserAddObj("LoginNum") = "1"
		RsUserAddObj("Point") = "1"
		RsUserAddObj.Update
		Set RsUserAddObj = Nothing
	   Session("MemName") = Replace(Replace(Request.Form("MemName"),"""",""),"'","")
	   Session("MemPassWord") = md5(Request.Form("Password"),16)
		Response.Redirect("UserMain.asp")
	End If
	RsConfigObj.Close
	Set RsConfigObj = Nothing
 Set Conn=nothing
%>