<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加会员</title>
<link type="text/css" rel="stylesheet" href="../Css/style.css" />
<script language="javascript" type="text/javascript" src="../jQuery/lib/jquery.js"></script>
<script language="javascript" type="text/javascript" src="../js/WebSite.js"></script>
<script language="javascript" type="text/javascript" src="../js/ChkForm.js"></script>
<script language="JavaScript" type="text/javascript" src="../../js/calendar.js"></script>
</head>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Function.asp"-->
<!--#include file="../FCKeditor/fckeditor.asp" -->
<!--#include file="../../inc/Config.asp"-->
<body>
<%
Call ChkLogin(session("WebAdminsUserName"))
Call ConnectionDataBase(2)
id=0
Business=0
Act = Request.QueryString("Act")
IF Act = "Edit" Then
	id = Request.QueryString("id")
	Call ChkIsNumber(id,"参数类型错误!")
	Sql = "SELECT TOP 1 * FROM T_Users WHERE ID=" & id
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then
		UserName=Rs("UserName")
		VIP=Rs("VIP")
		VipGroup=Rs("VipGroup")
		StartDate=Rs("StartDate")
		RegTime=Rs("AddTime")
		nickname =Rs("nickname")
		logo =Rs("logo")
		banner =Rs("banner")
		question =Rs("question")
		answer =Rs("answer")
		realname =Rs("realname")
		sex =Rs("sex")
		birthday =Rs("birthday")
		areaid =Rs("CityID")
		email =Rs("email")
		address =Rs("address")
		postcode =Rs("postcode")
		tel =Rs("tel")
		mobile =Rs("mobile")
		fax =Rs("fax")
		qq =Rs("qq")
		msn=Rs("msn")
		Business=Rs("Business")
		BusinessCard=Rs("BusinessCard")
		houseid =Rs("houseids")
		Company =Rs("Company")	
		Content =Rs("Content")	
		paixv =Rs("paixv")
		Recommend =Rs("Recommend")	
		Sql="Select Top 1 father From T_City Where CityID=(Select Top 1 father From T_Area Where areaid='"& areaid &"')"
		SetRs Rs1,Sql,conn,1,1
		IF Not Rs1.Eof Then	provinceid=Rs1("father")
		DisRs Rs1
		Sql="Select Top 1 father From T_Area Where areaid='"& areaid &"'"
		SetRs Rs1,Sql,conn,1,1
		IF Not Rs1.Eof Then	cityid=Rs1("father")
		DisRs Rs1		
	End IF
End IF
%>
<form action="Submit.asp" method="post" name="frm" style="margin:0" onsubmit="return ChkSubmitUsers();">
<input type="hidden" name="action" value="AddUsers" />
<input type="hidden" name="ID" value="<%=id%>" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">  
  <tr>
    <td width="15%" align="right">用户类型：</td>
    <td width="85%" align="left">
    <select name="UsersCategory" id="UsersCategory">
    <%For i=0 To UBOUND(UserClass)%>
    <option value="<%=UserClass(i,0)%>" <%IF Cstr(UserClass(i,0))=Cstr(VipGroup) Then Response.Write("selected")%>><%=UserClass(i,1)%></option>
	<%Next%>
    </select>    </td>
  </tr>
  <tr>
    <td width="15%" align="right">会员等级：</td>
    <td width="85%" align="left">
    <select name="VIP" id="VIP">
    <option value="0" selected="selected">普通会员</option>
	<option value="1" <%IF VIP=1 Then Response.Write("selected")%>>VIP会员</option>
    </select>    </td>
  </tr>
  <tr>
    <td width="15%" align="right">起始日期：</td>
    <td width="85%" align="left">
    <input name="StartDate" type="text" class="txt" id="StartDate" onFocus="calendar()" value="<%=StartDate%>">    </td>
  </tr>
  <tr>
    <td width="15%" align="right">用户名：</td>
    <td width="85%" align="left"><input type="text" name="UserName" id="UserName" class="txt" value="<%=UserName%>" <%IF Act = "Edit" Then Response.Write "Readonly"%> /></td>
  </tr>
  <tr>
    <td width="15%" align="right">密码：</td>
    <td width="85%" align="left"><input type="password" name="UserPwd" id="UserPwd" class="txt" value="" /> 如不需要修改密码,请留空</td>
  </tr>
  <tr>
    <td width="15%" align="right">真实姓名：</td>
    <td width="85%" align="left"><input type="text" name="RealName" id="RealName" class="txt" value="<%=RealName%>" /></td>
  </tr>
  <tr>
    <td width="15%" align="right">昵称：</td>
    <td width="85%" align="left">
    <input type="text" name="NickName" id="NickName" class="txt" value="<%=NickName%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">出生日期：</td>
    <td width="85%" align="left">
    <input name="birthday" type="text" class="txt" id="birthday" onFocus="calendar()" value="<%=birthday%>">    </td>
  </tr>
  <tr>
    <td width="15%" align="right">性别：</td>
    <td width="85%" align="left">
    <input type="radio" name="Sex" id="Sex" value="male" checked/> 男
	<input type="radio" name="Sex" id="Sex" value="female" <%IF Sex="female" Then Response.Write "checked"%> /> 女    </td>
  </tr>
  <tr>
    <td width="15%" align="right">设计专长：</td>
    <td width="85%" align="left">
      <%
	  Sql="Select * From T_Class Where CateID=1 Order BY SortID DESC,ID ASC"
	  SetRs Rs,Sql,Conn,1,1
	  Do While Not Rs.Eof
		checked=""
		IF houseid<>"" Then
			HouseIDs=Split(houseid,",")
			For i=0 To UBOUND(HouseIDs)
				IF Trim(HouseIDs(i))=Cstr(Rs("ID")) Then
					checked="checked"
					Exit For
				End IF
			Next
		End IF
		Response.Write "<input type='checkbox' name='houseid' id='houseid' value='"& Rs("ID") &"' "& checked &" /> " & Rs("ClassName")
	  Rs.movenext
	  Loop
	  DisRs Rs
	  %>    </td>
  </tr>
  <tr>
    <td align="right">LOGO：</td>
    <td align="left">
    <input type="text" name="Logo" id="Logo" class="txt" value="<%=Logo%>" />
    <input type="button" value="添加图片" class="btn2" onClick="window.open('../Public/UpLoad.asp?formname=frm&EditName=Logo&filepath=Users&fileType=gif,jpg,png','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"> 建议上传比例:100px * 100px,支持格式:gif,jpg,png<br />
	  <%
	  userhead="/images/untitled.jpg"
	  IF Logo<>"" Then userhead="/UpLoadFiles/Users/" & Logo			  
	  %>
	<img src="<%=userhead%>" width="80" />    </td>
  </tr>
  <tr>
    <td align="right">Banner：</td>
    <td align="left">
    <input type="text" name="Banner" id="Banner" class="txt" value="<%=Banner%>" />
    <input type="button" value="添加图片" class="btn2" onClick="window.open('../Public/UpLoad.asp?formname=frm&EditName=Banner&filepath=Users&fileType=gif,jpg,png','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"> 建议上传比例:970px * 287px,支持格式:gif,jpg,png<br />
	  <%
	  IF Banner<>"" Then Response.Write("<img src='/UpLoadFiles/Users/" & Banner &"' width='800'>")
	  %>    </td>
  </tr>
  <tr>
    <td width="15%" align="right">公司名称：</td>
    <td width="85%" align="left">
    <input name="Company" type="text" class="txt" id="Company" value="<%=Company%>">    </td>
  </tr>
  <tr>
    <td align="right">企业名片：</td>
    <td align="left">
      <input type="text" name="BusinessCard" id="BusinessCard" class="txt" value="<%=BusinessCard%>" />
	  <input type="button" value="添加图片" class="btn2" onClick="window.open('inc/UpLoad.asp?formname=frm&EditName=BusinessCard&filepath=Users&fileType=gif,jpg,png','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"> 建议上传比例:168px * 50px,支持格式:gif,jpg,png<br />	
	  <%
	  qymp="/images/qymp.jpg"
	  IF BusinessCard<>"" Then qymp="/UpLoadFiles/Users/" & BusinessCard			  
	  %>
	  <img src="<%=qymp%>" width="168" vspace="5" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">成交量：</td>
    <td width="85%" align="left">
    <input type="text" name="Business" id="Business" class="txt" value="<%=Business%>" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">现所在地：</td>
    <td width="85%" align="left">
      <select name="province" style="width:100px" onchange="GetCity(this.options[this.selectedIndex].value)">
		<%
		Sql="Select provinceID,province From T_Province"
		SetRs Rs,Sql,conn,1,1
		IF Not Rs.Eof Then
		IF Act <> "Edit" Then provinceid=Rs("ProvinceID")
		Do While Not Rs.eof
		%>
		<option value="<%=Rs("ProvinceID")%>" <%IF Rs("ProvinceID")=provinceid Then Response.Write "Selected"%>><%=Rs("Province")%></option>
		<%
		Rs.movenext
		Loop
		End IF
		DisRs Rs
		%>
	  </select>

	  <select name="city" id="city" style="width:100px" onchange="GetArea(this.options[this.selectedIndex].value)">
		<%
		Sql="Select cityID,city From T_City Where father='"& provinceid &"'"
		response.write sql
		SetRs Rs,Sql,conn,1,1
		IF Not Rs.Eof Then
		IF Act <> "Edit" Then cityid=Rs("cityID")
		Do While Not Rs.eof
		%>
		<option value="<%=Rs("cityID")%>" <%IF Rs("cityID")=cityid Then Response.Write "Selected"%>><%=Rs("city")%></option>
		<%
		Rs.movenext
		Loop
		End IF
		DisRs Rs
		%>
	  </select>
	  <select name="area" id="area" style="width:100px">
		<%
		Sql="Select areaID,area From T_Area Where father='"& cityid &"'"
		SetRs Rs,Sql,conn,1,1
		IF Not Rs.Eof Then
		Do While Not Rs.eof
		%>
		<option value="<%=Rs("areaID")%>" <%IF Rs("areaID")=Cstr(areaid) Then Response.Write "Selected"%>><%=Rs("area")%></option>
		<%
		Rs.movenext
		Loop
		End IF
		DisRs Rs
		Call CloseDatabase
		%>
	  </select>    </td>
  </tr>
  <tr>
    <td width="15%" align="right">地址：</td>
    <td width="85%" align="left">
    <input type="text" name="Address" id="Address" class="txt" value="<%=Address%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">邮编：</td>
    <td width="85%" align="left">
    <input type="text" name="PostCode" id="PostCode" class="txt" value="<%=PostCode%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">E-mail：</td>
    <td width="85%" align="left">
    <input type="text" name="Email" id="Email" class="txt" value="<%=Email%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">电话：</td>
    <td width="85%" align="left">
    <input type="text" name="Tel" id="Tel" class="txt" value="<%=Tel%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">手机：</td>
    <td width="85%" align="left">
    <input type="text" name="Mobile" id="Mobile" class="txt" value="<%=Mobile%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">传真：</td>
    <td width="85%" align="left">
    <input type="text" name="Fax" id="Fax" class="txt" value="<%=Fax%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">QQ：</td>
    <td width="85%" align="left">
    <input type="text" name="QQ" id="QQ" class="txt" value="<%=QQ%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">MSN：</td>
    <td width="85%" align="left">
    <input type="text" name="MSN" id="MSN" class="txt" value="<%=MSN%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">密码提示问题：</td>
    <td width="85%" align="left">
    <input type="text" name="Question" id="Question" class="txt" value="<%=Question%>" />    </td>
  </tr>
  <tr>
    <td width="15%" align="right">密码提示答案：</td>
    <td width="85%" align="left">
    <input type="text" name="Answer" id="Answer" class="txt" value="<%=Answer%>" />    </td>
  </tr>
  
  <tr>
    <td align="right">公司简介：</td>
    <td align="left">
    	<% 
		Dim oFCKeditor
		Set oFCKeditor = New FCKeditor
		oFCKeditor.BasePath = "../FCKeditor/" '设置编辑器的路径，我站点根目录下的一个目录
		oFCKeditor.ToolbarSet = "Define"
		oFCKeditor.Width = "98%"
		oFCKeditor.Height = "300"
		
		oFCKeditor.Value = Content '这个是给编辑器初始值
		oFCKeditor.Create "Content" '以后编辑器里的内容都是由这个logbody取得，命名由你定		
		%>    </td>
  </tr>
  <tr>
    <td width="15%" align="right">&nbsp;</td>
    <td width="85%" align="left">
    <input type="checkbox" name="Recommend" id="Recommend" class="txt" value="1" <%IF Recommend Then Response.Write("checked")%> /> 
    设为推荐 &nbsp;&nbsp;   
    <input name="paixv" type="text" id="paixv" value="<%=paixv%>" size="6" />
(首页排序，请填写整数，从大到小排)</td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td align="left"><input type="submit" class="btn" value="提交" /><input type="reset" class="btn" value="重置"></td>
  </tr>  
</table>
</form>
</body>
</html>
