<!--#include virtual="/show/userhead.asp"-->
<!--#include file="subleft.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<%
'暂时未启用
response.Write "请使用新版商户后台"
response.End()
%>

<script>document.getElementById('o_1').setAttribute("class", "ed"); document.getElementById("t_1").style.display="";document.getElementById('s_1_2').setAttribute("class", "ed4");</script>

<title><%=webname%>-完善账户信息</title>
<script language="javascript">
function selectptype(){
if(document.form1.ptype.value==1)
{
	yinhang1.style.display = "none";
	yinhang2.style.display = "none";
	yinhang3.style.display = "none";
}
if(document.form1.ptype.value==2)
{
	yinhang1.style.display = "none";
	yinhang2.style.display = "none";
	yinhang3.style.display = "none";
}
if(document.form1.ptype.value==3)
{
	yinhang1.style.display = "";
	yinhang2.style.display = "";
	yinhang3.style.display = "";
}
}
 </script>
 			 
<script language="javascript">
function checkedit1()
{ 
		if (document.form1.aymail.value=="")
		{
		alert("请填写商户邮箱")
  	    return false;
		}
  
		if (document.form1.aytel.value=="")
		{
		alert("请填写商户手机号码")
  	    return false;
		}
		
		if (document.form1.ayqq.value=="")
		{
		alert("请填写商户QQ号码")
  	    return false;
		}
		
		if (document.form1.ayshenfenzheng.value=="")
		{
		alert("请填写商户身份证号")
  	    return false;
		}
		
		if (document.form1.aywebname.value=="")
		{
		alert("请填写商户名称")
  	    return false;
		}
  
//var myReg = /^[-_A-Za-z0-9]+@([_A-Za-z0-9]+\.)+[A-Za-z0-9]{2,3}$/; 
//if(myReg.test(document.form1.aymail.value)==false) 
//{ 
//alert("请正确填写商户邮箱")
//return false; 
//}

var regu =/^[1][3-8][0-9]{9}$/; 
var re = new RegExp(regu); 
if (re.test(document.form1.aytel.value)==false) 
{ 
alert("请正确填写商户手机号码")
return false; 
} 

var regu = /^[-]{0,1}[0-9]{1,}$/; 
if((document.form1.ayqq.value.length<4)||(document.form1.ayqq.value.length>12))
{
alert("请正确填写商户QQ号码")
return false;
}
if(regu.test(document.form1.ayqq.value)==false) 
{
alert("请正确填写商户QQ号码")
return false;
}
  
var cardid = document.form1.ayshenfenzheng.value; 
var pattern;
if (cardid.length==15)
{
pattern= /^\d{15}$/;//正则表达式,15位且全是数字
if (pattern.exec(cardid)==null)
{
alert("请正确填写商户身份证号")
return false;
}
}
else if (cardid.length==18)
{
pattern= /^\d{17}(\d|x|X)$/;//正则表达式,18位且前17位全是数字，最后一位只能数字,x,X
if (pattern.exec(cardid)==null)
{
alert("请正确填写商户身份证号")
return false;
}
}
else
{
alert("请正确填写商户身份证号")
return false;
}
return true;   
}
</script>	 
 
 

<script language="javascript">
function checkedit2()
{ 
		if (document.form1.aytrueuser.value=="")
		{
		alert("请填写收款人姓名")
  	    return false;
		}
  
		if (document.form1.ayshoukuanid.value=="")
		{
		alert("请填写收款帐号")
  	    return false;
		}
		
  
}
</script>	
<%
sql="select top 1 * from ayzizhu where zyzizhuisok=1 and ayzizhuuid="&trim(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
	if DateDiff("d",rs("ayzizhudate"),now())>3 then 
	rs.delete
	call PopErr2("您的请求已过时效，可以联系管理员重新申请！","index")
	end if
response.Cookies("ayzizhuid")=rs("ayzizhuid")
response.Cookies("ayzizhulb")=rs("ayzizhulb")
else
call PopErr2("您的请求未找到，请联系管理员！","index")
end if
rs.close


act=SafeRequestform("act") 
if act="edit" then
call chkwurl()
if request.Cookies("ayzizhuid")="" or request.Cookies("ayzizhulb")="" then call PopErr2("出现错误请联系管理员","/")

if cint(request.Cookies("ayzizhulb"))=0 then  '修改商户信息
sql="select ayisguolv,ayguolvcon from ayquanju" 
rs.open sql,conn,1,1
ayisguolv=rs("ayisguolv")
ayguolvcon=trim(rs("ayguolvcon"))
rs.close
aytel=trim(SafeRequestform("aytel"))
ayqq=trim(SafeRequestform("ayqq"))
aymail=trim(SafeRequestform("aymail"))
email2=SafeRequestform("email2")
ayshenfenzheng=trim(SafeRequestform("ayshenfenzheng"))
aywebname=trim(SafeRequestform("aywebname"))

if aymail="" then call PopErr("请填写完整")
if instr(1,aymail,"@")<>0 then call PopErr("邮箱填写有误")
email=trim(aymail)&email2


	if ayisguolv=1 then
	if guolvRequestform("aywebname",ayguolvcon)=false then 
	call logadd(request.Cookies("aynameid"),"商户补充信息含有敏感文字"&aywebname,0,1)
	call PopErr("表单含有禁止使用的敏感文字")
	end if
	end if
if aytel="" or ayqq="" or ayshenfenzheng="" or aywebname="" then call PopErr("请填写完整")
if left(aytel,3)="170" or left(aytel,3)="171" then call PopErr("手机号填写有误")

	set rsu=server.CreateObject("adodb.recordset")
	sqlu="select aynameid,aymail from ayname where aynameid<>"&clng(request.Cookies("aynameid"))&" and aymail='"&trim(email)&"'" 
	rsu.open sqlu,conn,1,1
	if not(rsu.bof and rsu.eof) then
	call PopErr("该邮箱已被使用，请重新输入")
	end if
	rsu.close
	set rsu=server.CreateObject("adodb.recordset")
	sqlu="select aynameid,ayshenfenzheng from ayname where aynameid<>"&clng(request.Cookies("aynameid"))&" and ayshenfenzheng='"&trim(ayshenfenzheng)&"'" 
	rsu.open sqlu,conn,1,1
	if not(rsu.bof and rsu.eof) then
	call PopErr("该身份证已被使用，请重新输入")
	end if
	rsu.close

sql="select * from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
if trim(rs("aytel"))<>trim(aytel) then
rs("istelrz")=0
end if
if trim(rs("aymail"))<>trim(email) then
rs("ismailrz")=0
rs("mailbj")=0
end if
rs("aytel")=aytel
rs("ayqq")=ayqq
rs("aymail")=email
rs("ayshenfenzheng")=ayshenfenzheng
rs("aywebname")=aywebname
rs.update
rs.close

sql="select * from ayzizhu where ayzizhuid="&request.Cookies("ayzizhuid")&"" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs("zyzizhuisok")=2
rs.update
end if
rs.close
response.Cookies("ayzizhuid")=""
response.Cookies("ayzizhulb")=""
call logadd(request.Cookies("aynameid"),"账户信息自助修改成功",0,0)
call PopErr2("账户信息自助修改成功","myname")
end if

if cint(request.Cookies("ayzizhulb"))=1 then '修改结算信息
ptype=trim(SafeRequestform("ptype"))
bank=trim(SafeRequestform("bank"))

aytrueuser=trim(SafeRequestform("aytrueuser"))
ayshoukuanid=trim(SafeRequestform("ayshoukuanid"))

if ayshoukuanid="" or aytrueuser="" then call PopErr("请填写完整")

	set rsu=server.CreateObject("adodb.recordset")
	sqlu="select aynameid,ayshoukuanid from ayname where aynameid<>"&clng(request.Cookies("aynameid"))&" and ayshoukuanid='"&trim(ayshoukuanid)&"'" 
	rsu.open sqlu,conn,1,1
	if not(rsu.bof and rsu.eof) then
	call PopErr("该收款帐号已被使用，请重新输入")
	end if
	rsu.close

sql="select * from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,3
rs("ayshoukuanfs")=ptype
rs("aybank")=trim(bank)
rs("aytrueuser")=trim(aytrueuser)
rs("ayshoukuanid")=trim(ayshoukuanid)
rs.update
rs.close

sql="select * from ayzizhu where ayzizhuid="&request.Cookies("ayzizhuid")&"" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs("zyzizhuisok")=2
rs.update
end if
rs.close
response.Cookies("ayzizhuid")=""
response.Cookies("ayzizhulb")=""
call logadd(request.Cookies("aynameid"),"结算信息自助修改成功",0,0)
call PopErr2("结算信息自助修改成功","myname")
end if


end if

%>
<br>
<DIV id=main2> 
<%call webleft()%>
<DIV id=main_right>
<DIV id=main_right_content>

<H2><SPAN>修改帐号信息</SPAN></H2>
<DIV class=main3>
<%
sql="select * from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,1
%>
<%if cint(ayzizhulb)=0 then%>
<form action="" method="post" name="form1" id="form1" onSubmit="return checkedit1()">
<%elseif cint(ayzizhulb)=1 then%>
<form action="" method="post" name="form1" id="form1" onSubmit="return checkedit2()">
<%end if%>
  <TABLE width="800" align="center" class=table_style_home_info>
  <TBODY>
  <TR>
    <TD colspan="3" align="left"><span style="font-weight: bold; color: #009900; font-size: 13px">&nbsp;&nbsp;您申请了自助修改服务，请修改以下内容</span></TD>
    </TR>
  <TR>
    <TD width="102" align="center"><span style="font-size: 13px">用户名：</span></TD>
    <TD width="313"><span style="font-size: 13px"><%=rs("ayusername")%></span></TD>
    <TD width="369" align="left">&nbsp;</TD>
  </TR>
<%if cint(request.Cookies("ayzizhulb"))=0 then%>
  <TR>
    <TD align="center"><span style="font-size: 13px">电子邮箱：</span></TD>
    <TD><span style="font-size: 13px">
    
    <%
	mailstr=split(trim(rs("aymail")),"@")
	mail2="@"&mailstr(1)
	'response.Write mail2
	%>
    
      <input name="aymail" type="text" class="inputty" id="aymail" value="<%if mailstr(0)<>"" then response.Write trim(mailstr(0))%>" maxlength="30" >
<select name="email2" id="email2" style="width:130px;">
			    <option value="@163.com" <%if mail2="@163.com" then response.Write "selected"%>>@163.com</option>
                <option value="@vip.163.com" <%if mail2="vip.163.com" then response.Write "selected"%>>@vip.163.com</option>
                <option value="@126.com" <%if mail2="@126.com" then response.Write "selected"%>>@126.com</option>
                <option value="@vip.126.com" <%if mail2="@vip.126.com" then response.Write "selected"%>>@vip.126.com</option>
                <option value="@263.net" <%if mail2="@263.net" then response.Write "selected"%>>@263.net</option>
                <option value="@sina.com" <%if mail2="@sina.com" then response.Write "selected"%>>@sina.com</option>
                <option value="@sina.com.cn" <%if mail2="@sina.com.cn" then response.Write "selected"%>>@sina.com.cn</option>
                <option value="@sohu.com" <%if mail2="@sohu.com" then response.Write "selected"%>>@sohu.com</option>
                <option value="@17173.com" <%if mail2="@17173.com" then response.Write "selected"%>>@17173.com</option>
                <option value="@yahoo.com.cn" <%if mail2="@yahoo.com.cn" then response.Write "selected"%>>@yahoo.com.cn</option>
                <option value="@hotmail.com" <%if mail2="@hotmail.com" then response.Write "selected"%>>@hotmail.com</option>
                <option value="@gmail.com" <%if mail2="@gmail.com" then response.Write "selected"%>>@gmail.com</option>
                <option value="@msn.com" <%if mail2="@msn.com" then response.Write "selected"%>>@msn.com</option>
                <option value="@3721.net" <%if mail2="@3721.net" then response.Write "selected"%>>@3721.net</option>
                <option value="@yeah.net" <%if mail2="@yeah.net" then response.Write "selected"%>>@yeah.net</option>
                <option value="@21cn.com" <%if mail2="@21cn.com" then response.Write "selected"%>>@21cn.com</option>
                <option value="@tom.com" <%if mail2="@tom.com" then response.Write "selected"%>>@tom.com</option>
                <option value="@eyou.com" <%if mail2="@eyou.com" then response.Write "selected"%>>@eyou.com</option>
                <option value="@56.com" <%if mail2="@56.com" then response.Write "selected"%>>@56.com</option>
                <option value="@chinaren.com" <%if mail2="@chinaren.com" then response.Write "selected"%>>@chinaren.com</option>
                <option value="@139.com" <%if mail2="@139.com" then response.Write "selected"%>>@139.com</option>
              </select>
    </span></TD>
    <TD align="left"><span style="color: #999999">商户邮箱是您资料的重要信息</span></TD>
  </TR>
  <TR>
    <TD align="center"><span style="font-size: 13px">手机号码：</span></TD>
    <TD><span style="font-size: 13px">
      <input name="aytel" type="text" class="inputty" id="aytel" value="<%if trim(rs("aytel"))<>"" and isnull(trim(rs("aytel")))=false then response.Write trim(rs("aytel"))%>" maxlength="11" >
    </span></TD>
    <TD align="left"><span style="color: #999999">当商品出售，库存不足时我们可以通知手机短信方式通知您</span></TD>
  </TR>
  <TR>
    <TD align="center"><span style="font-size: 13px">商户 QQ：</span></TD>
    <TD><span style="font-size: 13px">
      <input name="ayqq" type="text" class="inputty" id="ayqq" value="<%if trim(rs("ayqq"))<>"" and isnull(trim(rs("ayqq")))=false then response.Write trim(rs("ayqq"))%>" maxlength="11">
    </span></TD>
    <TD align="left"><span style="color: #999999">商户QQ将出现在商品出售页面，方便买家联系到您</span></TD>
  </TR>
  <TR>
    <TD align="center"><span style="font-size: 13px">身份证：</span></TD>
    <TD>
      <input name="ayshenfenzheng" type="text"  class="inputty" id="ayshenfenzheng" value="<%if trim(rs("ayshenfenzheng"))<>"" and isnull(trim(rs("ayshenfenzheng")))=false then response.Write trim(rs("ayshenfenzheng"))%>" maxlength="18" >   </TD>
    <TD align="left"><span style="color: #999999">商户修改信息的重要验证资料</span></TD>
  </TR>
  <TR>
    <TD align="center">商户名称<span style="font-size: 13px">：</span></TD>
    <TD><input name="aywebname" type="text"  class="inputty" id="aywebname" value="<%if trim(rs("aywebname"))<>"" and isnull(trim(rs("aywebname")))=false then response.Write trim(rs("aywebname"))%>" maxlength="50" ></TD>
    <TD align="left"><span style="color: #999999">将出现在商品购买页面 如：爱卡产品 </span></TD>
  </TR>
<%end if%>
<%if cint(request.Cookies("ayzizhulb"))=1 then%>
  <TR>
    <TD align="center">收款方式：</TD>
    <TD colspan="2">
			<select name="ptype" id="ptype" onChange="selectptype()">
			<option value="1" <%if cint(rs("ayshoukuanfs"))=1 then response.Write"selected"%>>支付宝</option>
			<!--<option value="2" <%if cint(rs("ayshoukuanfs"))=2 then response.Write"selected"%>>财付通</option>-->
			<option value="3" <%if cint(rs("ayshoukuanfs"))=3 then response.Write"selected"%>>银行账户</option>
			</select></TD>
  </TR>

  <TR id="yinhang1" style="display:none">
    <TD align="center">开户银行：</TD>
    <TD colspan="2"><span class="r_o_i">
      <select name="bank" id="bank">
        <option value="中国工商银行" <%if trim(rs("aybank"))="中国工商银行" then response.Write"selected"%>>中国工商银行</option>
        <option value="上海浦东发展银行" <%if trim(rs("aybank"))="上海浦东发展银行" then response.Write"selected"%>>上海浦东发展银行</option>
        <option value="中国农业银行" <%if trim(rs("aybank"))="中国农业银行" then response.Write"selected"%>>中国农业银行</option>
        <option value="招商银行" <%if trim(rs("aybank"))="招商银行" then response.Write"selected"%>>招商银行</option>
        <option value="中国建设银行" <%if trim(rs("aybank"))="中国建设银行" then response.Write"selected"%>>中国建设银行</option>
        <option value="兴业银行" <%if trim(rs("aybank"))="兴业银行" then response.Write"selected"%>>兴业银行</option>
        <option value="广东发展银行" <%if trim(rs("aybank"))="广东发展银行" then response.Write"selected"%>>广东发展银行</option>
        <option value="深圳发展银行" <%if trim(rs("aybank"))="深圳发展银行" then response.Write"selected"%>>深圳发展银行</option>
        <option value="中国民生银行" <%if trim(rs("aybank"))="中国民生银行" then response.Write"selected"%>>中国民生银行</option>
        <option value="交通银行" <%if trim(rs("aybank"))="交通银行" then response.Write"selected"%>>交通银行</option>
        <option value="中信银行" <%if trim(rs("aybank"))="中信银行" then response.Write"selected"%>>中信银行</option>
        <option value="中国光大银行" <%if trim(rs("aybank"))="中国光大银行" then response.Write"selected"%>>中国光大银行</option>
        <option value="中国银行" <%if trim(rs("aybank"))="中国银行" then response.Write"selected"%>>中国银行</option>
        <option value="中国邮政储蓄" <%if trim(rs("aybank"))="中国邮政储蓄" then response.Write"selected"%>>中国邮政储蓄</option>
        </select>
      </span></TD>
  </TR>
    <TR>
      <TD align="center">收款人姓名：</TD>
      <TD colspan="2"><span class="r_o_i">
        <input type="text" name="aytrueuser" id="aytrueuser" class="inputty" maxlength="35" value="<%if trim(rs("aytrueuser"))<>"" and isnull(trim(rs("aytrueuser")))=false then response.Write trim(rs("aytrueuser"))%>"/>
        </span></TD>
    </TR>
  <TR>
    <TD align="center">收款帐号</TD>
    <TD colspan="2"><span class="r_o_i">
      <input type="text" name="ayshoukuanid" id="ayshoukuanid" class="inputty" maxlength="35" value="<%if trim(rs("ayshoukuanid"))<>"" and isnull(trim(rs("ayshoukuanid")))=false then response.Write trim(rs("ayshoukuanid"))%>"/>
    </span></TD>
  </TR>
<%end if%>
  
  <TR>
    <TD colspan="3" align="center">
      <span style="font-size: 13px">
      <input name="act" type="hidden" id="act" value="edit">
      </span>
      <input style="cursor:pointer"  class="butbaocun" type="submit" name="Submit" value=" 确认修改 " ></TD>
    </TR>
  </TBODY></TABLE>
</form>



</DIV></DIV>
<DIV class=clear></DIV></DIV>
</DIV>

<%if cint(rs("ayshoukuanfs"))=3 then%>
<script language="javascript">
yinhang1.style.display = "";
yinhang2.style.display = "";
yinhang3.style.display = "";
</script>
<%end if%>
<%rs.close%>
<br>

	<!--#include virtual="/show/foot.asp"-->


