<!--#include file="head.asp"-->
<script type="text/javascript" src="/Template/newbuy2/js/jquery-1.9.min.js"></script>
<style>body{background-color: #fff;}</style>

<%
'暂时未启用
response.End()

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"))
aymail=trim(SafeRequestform("aymail"))
'ayshenfenzheng=trim(SafeRequestform("ayshenfenzheng"))


if aytel="" or aymail="" then call PopErr("请填写完整")
if left(aytel,3)="170" or left(aytel,3)="171" then call PopErr("手机号暂不支持170/171")

	set rsu=server.CreateObject("adodb.recordset")
	sqlu="select aynameid,aymail,iszhuxiao from ayname where aynameid<>"&clng(request.Cookies("aynameid"))&" and aymail='"&trim(aymail)&"' and iszhuxiao=0" 
	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 * 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(aymail) then
rs("ismailrz")=0
rs("mailbj")=0
end if
rs("aytel")=aytel
rs("aymail")=aymail
'rs("ayshenfenzheng")=ayshenfenzheng
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"))

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

if ptype<>"1" and ptype<>"2" and ptype<>"4" then 
bankname=ptype
ptype="3"
end if

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

	set rsu=server.CreateObject("adodb.recordset")
	sqlu="select aynameid,ayshoukuanid,iszhuxiao from ayname where aynameid<>"&clng(request.Cookies("aynameid"))&" and ayshoukuanid='"&trim(ayshoukuanid)&"' and iszhuxiao=0" 
	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(bankname)
'rs("aytrueuser")=trim(aytrueuser)
rs("ayshoukuanid")=trim(ayshoukuanid)
if trim(bankkaihu)<>"" then rs("bankkaihu")=trim(bankkaihu)
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



sql="select * from ayname where aynameid="&clng(request.Cookies("aynameid"))&"" 
rs.open sql,conn,1,1
skfs=rs("ayshoukuanfs")
%>

<script language="javascript">
window.onload = function()
{
	if('<%=skfs%>'=="3")
	{	
	$('#iskhh').show();
	payid.innerHTML = "银行卡卡号";
	cards.innerHTML = "请正确填写"+str+"卡号";
	}
	if('<%=skfs%>'=="1")
	{	
	payid.innerHTML = "支付宝账号";
	cards.innerHTML = "请正确填写支付宝账号";
	}
	if('<%=skfs%>'=="2")
	{	
	payid.innerHTML = "财付通账号";
	cards.innerHTML = "请正确填写财付通账号";
	}
	if('<%=skfs%>'=="4")
	{	
	payid.innerHTML = "微信号";
	cards.innerHTML = "请正确填写微信号";
	}
}


function selectptype(str)
{
	if(str=="1")
	{
	$('#iskhh').hide();
	payid.innerHTML = "支付宝账号";
	cards.innerHTML = "请正确填写支付宝账号";
	}
	else if(str=="2")
	{
	$('#iskhh').hide();
	payid.innerHTML = "财付通账号";
	cards.innerHTML = "请正确填写财付通账号";
	}
	else if(str=="4")
	{
	$('#iskhh').hide();
	payid.innerHTML = "微信号";
	cards.innerHTML = "请正确填写微信号";
	}
	else
	{
	$('#iskhh').show();
	payid.innerHTML = "银行卡卡号";
	cards.innerHTML = "请正确填写"+str+"卡号";
	}
}


function checkedit1()
{ 
		if (document.form1.aymail.value=="")
		{
		alert("请填写商户邮箱")
  	    return false;
		}
  
		if (document.form1.aytel.value=="")
		{
		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; 
		} 
}


function checkedit2()
{ 
  
		if (document.form1.ayshoukuanid.value=="")
		{
		alert("请填写收款帐号")
  	    return false;
		}
		
		
		if(document.form1.ptype.value!=1 && document.form1.ptype.value!=4)
		{
			if (document.form1.bankkaihu.value=="")
			{
			alert("请填写详细开户行支行地址")
			return false;
			}
		}
  
}

</script>	

                                     


<main>
<div  class="container">
<div class="ui-lrctnei">
<%call userleft()%>
<div class="r"> 
<div class="ui-content">
                        
					
                            
<div class="neiye">

                   
                                                     
            <!-------------------------------------- 修改密码 -------------------------------------->
            <div class="neibiaoti"></div>
            <div class="neibiaoti2">帐号信息自助修改</div>
                	<div class="gexian"></div>

                    	<%if cint(request.Cookies("ayzizhulb"))=0 then%>
                        <form action="" method="post" name="form1" id="form1" onSubmit="return checkedit1()">
                        <%elseif cint(request.Cookies("ayzizhulb"))=1 then%>
            <form action="" method="post" name="form1" id="form1" onSubmit="return checkedit2()">
                        <%end if%>
                        <table class="neitableanquan" width="1080">

                        <%if cint(request.Cookies("ayzizhulb"))=0 then%>
      		  			<tr>
                            <td colspan="2" align="center"  width="150">商家名称：</td>
                            <td width="310">
                            <%=trim(rs("aytrueuser"))%>
                            </td>
                          <td width="498"><div class="regts" > 商家名称！！注册后不能修改！</div></td>
                        </tr>
      		  			<tr>
                            <td colspan="2" align="center">身份证：</td>
                            <td width="310">
                            <%
							if trim(rs("ayshenfenzheng"))<>"" and isnull(trim(rs("ayshenfenzheng")))=false then 
							response.Write left(trim(rs("ayshenfenzheng")),3)&"************"&right(trim(rs("ayshenfenzheng")),3)
							end if
							%>
                            </td>
                          <td width="498"><div class="regts" > 账户修改/认领/拥有人唯一依据！！注册后不能修改！</div></td>
                        </tr>
           		  		<tr>
                            <td colspan="2" align="center">电子邮箱：</td>
                            <td width="310"><input name="aymail" type="text" class="reginput" id="aymail" value="<%=trim(rs("aymail"))%>" maxlength="30" ></td>
                          <td><div class="regts" > 商户邮箱是您资料的重要信息</div></td>
                        </tr>
      		  			<tr>
                            <td colspan="2" align="center">手机号码：</td>
                            <td width="310">
                            <input name="aytel" type="text" class="reginput" id="aytel" value="<%if trim(rs("aytel"))<>"" and isnull(trim(rs("aytel")))=false then response.Write trim(rs("aytel"))%>" maxlength="11" ></td>
                          <td><div class="regts" > 填写常用手机号码</div></td>
                        </tr>
 
                        <%end if%>
                        
                        <%if cint(request.Cookies("ayzizhulb"))=1 then%>
                 		<tr>
                            <td colspan="2" align="center" width="150">收款姓名：</td>
                            <td width="310"><%=trim(rs("aytrueuser"))%></td>
                            <td><div class="regts" > 真实收款姓名</div></td>
                        </tr>
                        
                 		<tr>
                            <td colspan="2" align="center">收款方式：</td>
                            <td>
                			<select name="ptype" id="ptype" class="reginput" onChange="selectptype(this.value)">
                            <option value="1" <%if cint(rs("ayshoukuanfs"))=1 then response.Write"selected"%>>支付宝</option>
                            <option value="4" <%if cint(rs("ayshoukuanfs"))=4 then response.Write"selected"%>>微信</option>
                            <!--
                            <option value="2" <%'if cint(rs("ayshoukuanfs"))=2 then response.Write"selected"%>>财付通</option>
                            <option value="中国建设银行" <%'if cint(rs("ayshoukuanfs"))=3 and trim(rs("aybank"))="中国建设银行" then response.Write"selected"%>>中国建设银行</option>
                            -->
                            <option value="中国工商银行" <%if cint(rs("ayshoukuanfs"))=3 and trim(rs("aybank"))="中国工商银行" then response.Write"selected"%>>工商银行</option>
                            <option value="中国农业银行" <%if cint(rs("ayshoukuanfs"))=3 and trim(rs("aybank"))="中国农业银行" then response.Write"selected"%>>农业银行</option>
                            <option value="中国邮政储蓄" <%if cint(rs("ayshoukuanfs"))=3 and trim(rs("aybank"))="中国邮政储蓄" then response.Write"selected"%>>邮政储蓄</option>
                            <option value="中国银行" <%if cint(rs("ayshoukuanfs"))=3 and trim(rs("aybank"))="中国银行" then response.Write"selected"%>>中国银行</option>
                            <option value="招商银行" <%if cint(rs("ayshoukuanfs"))=3 and trim(rs("aybank"))="招商银行" then response.Write"selected"%>>招商银行</option>
                            </select>
                            </td>
                            <td><div class="regts" > 选择一个收款方式</div></td>
                        </tr>
                        
              
      		  			<tr id="iskhh" style="display:none">
                        <td colspan="2" align="center">开户行全名：</td>
                        <td width="310">
                        <input name="bankkaihu" type="text" class="reginput" id="bankkaihu" value="<%if trim(rs("bankkaihu"))<>"" and isnull(trim(rs("bankkaihu")))=false then response.Write trim(rs("bankkaihu"))%>"></td>
                        <td><div class="regts" > 请填写详细开户行支行名称</div></td>
                        </tr>
				
                        
                 		<tr>
                            <td colspan="2" align="center"><span id="payid">收款账号</span>：</td>
                            <td><input type="text" name="ayshoukuanid" id="ayshoukuanid" class="reginput" maxlength="35" value="<%if trim(rs("ayshoukuanid"))<>"" and isnull(trim(rs("ayshoukuanid")))=false then response.Write trim(rs("ayshoukuanid"))%>"/></td>
                            <td><div class="regts" > <span id="cards"> 请正确填写收款账号</span></div></td>
                        </tr>
                        <%end if%>
                        
                        
                 		<tr>
                            <td colspan="2"><input name="act" type="hidden" id="act" value="edit"></td>
                            <td colspan="2" height="55"><input style="cursor:pointer"  class="logindlreg" type="submit" name="Submit" value=" 确认修改 " ></td>
                        </tr>
                    </table>
                    </form>
            <!-------------------------------------- 修改密码结束 -------------------------------------->
        
        
            
                   
            <div class="gexian20"></div>
            <div class="mzsmbox2" style="padding-top:20px;">
            您已申请自助修改商户信息，请正确真实填写以上所有信息！
            </div>

            </div>
            
            
          
            
            
            
        <div class="clearfix"></div>
       


</div>








</div>
</div>
</div>
</div>
</main>
<%rs.close%>

<footer>
<div class="container">
</div>
</footer>

</body>
</html>