<!--#include virtual="/show/userhead.asp"-->
<script>document.getElementById('o_10').setAttribute("class", "ed"); document.getElementById("t_10").style.display="";document.getElementById('s_10_1').setAttribute("class", "ed4");</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title><%=webname%>-结算账号列表</title>

<%
if SafeRequestform("act")="add" then

ayjcard=SafeRequestform("ayjcard")
if ayjcard="" then 
call PopErr2("请填写收款账号","jiesuan_list")
response.End()
end if

ayjfs=SafeRequestform("ptype")
if ayjfs="1" or ayjfs="2" or ayjfs="4" then	'支付宝 微信收款
	fs=ayjfs
	ayjpic=SafeRequestform("ayjpic")
	if ayjpic="" then 
	call PopErr2("请上传收款二维码","jiesuan_list")
	response.End()
	end if
else	'网银收款
	fs="3"
	ayjzhihang=SafeRequestform("ayjzhihang")
	if ayjzhihang="" then 
	call PopErr2("请填写详细开户行地址","jiesuan_list")
	response.End()
	end if
end if

sql="select top 1 ayjcard,ayjisdel from ayjiesuanid where ayjcard='"&trim(ayjcard)&"' and ayjisdel=0" 
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
call PopErr2("该收款账号已存在，请换一个收款账号","jiesuan_list")
end if
rs.close

ismoren="no"
sql="select top 1 ayjuid,ayjisdel from ayjiesuanid where ayjuid="&request.Cookies("aynameid")&" and ayjisdel=0" 
rs.open sql,conn,1,1
response.Write rs.RecordCount
if cint(rs.RecordCount)=0 then ismoren="yes"
rs.close

sql="select * from ayjiesuanid" 
rs.open sql,conn,1,3
	rs.addnew
	rs("ayjuid")=request.Cookies("aynameid")
	rs("ayjname")=trim(request.Cookies("aytrueuser"))
	rs("ayjcard")=trim(ayjcard)
	rs("ayjfs")=cint(fs)
	
	if cint(fs)=3 then '网银收款
	rs("ayjbank")=ayjfs
	rs("ayjzhihang")=ayjzhihang
	else
	rs("ayjpic")=ayjpic
	end if
	
	if ismoren="yes" then rs("ayjismoren")=1

	rs.update
rs.close

call logadd(request.Cookies("aynameid"),"添加结算账号",0,0)
call PopErr2("添加结算账号成功","jiesuan_list")

end if


if SafeRequest("act")="mr" then
	too=SafeRequest("too")
	id=SafeRequest("id")
	if too="" or id="" then call PopErr("缺少参数")
	
	conn.execute "update ayjiesuanid set ayjismoren=0 where ayjuid="&request.Cookies("aynameid")&" and ayjisdel=0"
	
	sql="select * from ayjiesuanid where ayjuid="&request.Cookies("aynameid")&" and ayjid="&id&" and ayjisdel=0" 
	rs.open sql,conn,1,3
	if not(rs.bof and rs.eof) then
	rs("ayjismoren")=1
	rs.update
	end if
	rs.close
	call PopErr2("设置默认结算账号成功","jiesuan_list")
end if

if SafeRequest("act")="del" then
	id=SafeRequest("id")
	if id="" then call PopErr("缺少参数")

	sql="select * from ayjiesuanid where ayjuid="&request.Cookies("aynameid")&" and ayjid="&id&" and ayjisdel=0" 
	rs.open sql,conn,1,3
	if not(rs.bof and rs.eof) then
	rs("ayjisdel")=1
	rs.update
	end if
	rs.close
	call PopErr2("结算账号删除成功","jiesuan_list")

end if
%>

<script language=javascript>
function selectptype(str)
{
	if(str=="1")
	{
	khh.style.display ="none";
	skm.style.display ="";
	payid.innerHTML = "支付宝账号";
	cards.innerHTML = "请填写与收款姓名一致的支付宝账号";
	document.getElementById("cardd").className='regts';
	document.getElementById("card").value="";
	}
	else if(str=="2")
	{
	khh.style.display ="none";
	skm.style.display ="none";
	payid.innerHTML = "财付通账号";
	cards.innerHTML = "请填写与收款姓名一致的财付通账号";
	document.getElementById("cardd").className='regts';
	document.getElementById("card").value="";
	}
	else if(str=="4")
	{
	khh.style.display ="none";
	skm.style.display ="";
	payid.innerHTML = "微信号";
	cards.innerHTML = "请填写与收款姓名一致的微信账号";
	document.getElementById("cardd").className='regts';
	document.getElementById("card").value="";
	}
	else
	{
	khh.style.display = "";
	skm.style.display ="none";
	payid.innerHTML = "银行卡号";
	cards.innerHTML = "请与收款姓名一致的"+str+"卡号";
	document.getElementById("cardd").className='regts';
	document.getElementById("card").value="";
	}
}
</script>

<style>
table{font-size:14px; font-weight:normal;line-height:27px;}
.regts{width:440px; height:36px; border:#CCC solid 1px; background:#f1f1f1; color:#666666; line-height:36px; padding-left:10px}
.reginput{width:290px; height:36px; border:#CCC solid 1px; color:#949494; text-indent:10px; line-height:36px}
.gexian20{float:left;width:100%;height:20px;}
.mzsmbox2{width:90%; height:auto; overflow:hidden; background:#fcf8e2; border-left:#edd28a solid 5px; color:#956825; line-height:22px; padding:20px;margin-left:40px; margin-bottom:60px; font-size:13px;padding-top:20px;}
.neitable table{border: 1px solid #E8E8E8;width: 100%;}
.neitable table tr{border-bottom: 1px solid #E8E8E8;}
.neitable table tr td{line-height: 42px;text-align: center;color: #1b1b1b;font-size: 14px;}
.neitable table tr.hd td{line-height: 35px;background-color: #F7F7F7;}
.btnFn1 {cursor:pointer!important;cursor:hand;  height:40px; width:101px; padding:0px 0px 0 0; }
.btnFn2 {cursor:pointer!important;cursor:hand;  height:40px; width:101px; padding:0px 0px 0 0; font-weight:bold; }
.logindlreg2{cursor:pointer;margin-left:5px; padding:7px;font-family:"Microsoft YaHei",Verdana,Arial; font-size:13px; text-align:center; color:#505050; font-weight:bold; background:#F2F2F2; border:#C3C3C3 solid 1px; border-radius:2px; }
.logindlreg2:hover{color:#505050;border:#999999 solid 1px; border-radius:2px; }
.logindlregedit{ margin-top:3px;height:36px;font-family:"Microsoft YaHei",Verdana,Arial; line-height:30px; font-size:13px; text-align:center; color:#505050; font-weight:bold; background:#F2F2F2;  border:#C3C3C3 solid 1px; border-radius:2px; }
.logindlregedit:hover{color:#505050;border:#999999 solid 1px; border-radius:2px; }
.logindlreg2tj{ margin-top:4px;height:36px;font-family:"Microsoft YaHei",Verdana,Arial; line-height:30px; font-size:13px; text-align:center; color:#ffffff; font-weight:bold; background:#F79740; border:0; border-radius:2px; }
.logindlreg2tj:hover{background:#F99C48; }
.reginputd{ width:190px; height:36px; border:#CCC solid 1px; text-indent:10px; line-height:36px}
.reginputdd{ width:110px; height:36px; border:#CCC solid 1px; text-indent:10px; line-height:36px}
.reginputddd{ width:40px; height:36px; border:#CCC solid 1px; text-indent:10px; line-height:36px}
.reginputdddd{ width:50px; height:36px; border:#CCC solid 1px; text-indent:10px; line-height:36px}
.regt3{ width:650px; height:36px; border:#CCC solid 1px; background:#F9F9F9; color:#999999; line-height:36px; padding-left:10px}
</style>

<br>
<DIV id=main2> 
<DIV style="PADDING-LEFT:0px">
<DIV id=main_right_content>

<H2><SPAN>结算账号列表</SPAN></H2>
<DIV class=main4>
		

<div class="neitable">
                    <form action="" method="post" name="myform" id="myform">
					<table>
                        <tr class="hd">
                            <td>结算方式</td>
                            <td>收款名称</td>
                            <td>收款账号</td>
                            <td>收款码/开户行</td>
                            <td>默认收款账号</td>
                            <td>操作</td>
                        </tr>
						<%
                        sql="select * from ayjiesuanid where ayjuid="&request.Cookies("aynameid")&" and ayjisdel=0 order by ayjismoren desc,ayjid asc" 
                        rs.open sql,conn,1,1
                        if not(rs.bof and rs.eof) then
                        do while not rs.eof
						%>
                  		<tr onmouseover=this.bgColor='#FAFAFA' onmouseout=this.bgColor='#ffffff'>
                            <td>
							<%
							if cint(rs("ayjfs"))=1 then response.Write "<img style=padding-top:13px src="&ossurl&"images/jz.gif width=20 /> "
							if cint(rs("ayjfs"))=4 then response.Write "<img style=padding-top:13px src="&ossurl&"images/jw.gif width=20 /> "
							if cint(rs("ayjfs"))=3 then response.Write "<img style=padding-top:13px src="&ossurl&"images/jyl.gif width=30 /> "
							
							if cint(rs("ayjfs"))=1 then response.Write "支付宝"
							if cint(rs("ayjfs"))=4 then response.Write "微信"
							if cint(rs("ayjfs"))=2 then response.Write "财付通"
							if cint(rs("ayjfs"))=3 then response.Write "网银"
							%>
                            </td>
                            <td><%=trim(rs("ayjname"))%></td>
                            <td><%=trim(rs("ayjcard"))%></td>
                            <td>
							<%
							if cint(rs("ayjfs"))=3 then
							response.Write trim(rs("ayjbank"))&"-"
							response.Write trim(rs("ayjzhihang"))
							else
							response.Write "<a href="&trim(rs("ayjpic"))&" target=_blank>【查看收款码】</a>"
							if cint(rs("ayjpicisok"))=2 then response.Write "<a style=color:#F00 href=jiesuan_edit?id="&rs("ayjid")&">- 收款码有误请重新上传</a>"
							end if
							%>
                            </td>
                            <td>
							<%
							if cint(rs("ayjismoren"))=1 then response.Write "<span style=color:#090>默认结算账号</span>"
							if cint(rs("ayjismoren"))=0 then response.Write "<a href=?act=mr&too=1&id="&rs("ayjid")&" style=color:#999>设为默认账号</a>"
							%>
                            </td>
                          <td>
                          <a href="jiesuan_edit?id=<%=rs("ayjid")%>">修改</a>
                          <a onClick="javascript:return confirm('删除后不可恢复！您确定要删除该结算方式吗？');" href="?act=del&id=<%=rs("ayjid")%>">删除</a>
                          </td>
                        </tr>
						<%
                        rs.movenext  
                        loop
						else%>
                  		<tr>
                            <td colspan="6" align="center">还没有结算账号，请先添加！</td>
                        </tr>
                        <%end if
                        rs.close
						%>

                    </table>
                    </form>
            		
                    
                    
                    
                    
        <!-------------------------------------- 开始 -------------------------------------->
            <div class="gexian20"></div><div class="gexian20"></div>
            
            
            
                                        <link rel="stylesheet" href="/kindeditor/themes/default/default.css" />
                                        <script charset="utf-8" src="/kindeditor/kindeditor.js"></script>
                                        <script charset="utf-8" src="/kindeditor/lang/zh-CN.js"></script>
                            			<script>
                                        KindEditor.ready(function(K) {
                                            var uploadbuttone = K.uploadbutton({
                                                button : K('#uploadButtone')[0],
                                                fieldName : 'imgFile',
                                                url : '/kindeditor/asp/upload_erweima.asp?dir=image',
                                                afterUpload : function(data) { 
                                                    if (data.error === 0) {
                                                        var url = K.formatUrl(data.url, '');
                                                        urlcon=url.replace("/kindeditor/asp/../../","/"); 
                                                        K('#picurle').val(urlcon);
                                                        cone.innerHTML='<a href='+urlcon+' target=_blank><img src='+urlcon+' width=120 height=120/></a>';
                                                    } else {
                                                        alert(data.message);
                                                    }
                                                },
                                                afterError : function(str) {
                                                    alert('自定义错误信息: ' + str);
                                                }
                                            });
                                            uploadbuttone.fileBox.change(function(e) {
                                                uploadbuttone.submit();
                                            });
                                        });
                                    </script>
            <div class="neibiaoti"></div>
            
<div style="font-size:18px;">&nbsp;&nbsp;添加结算账号</div>
                	<div class="gexian"></div>

                    	<form action="" method="post" name="form" id="form">
                        <table class="neitableanquan">
           		  		<tr>
                          <td align="center" width="100">收款姓名：</td>
                            <td width="310" align="left"><%=request.Cookies("aytrueuser")%></td>
                          <td></td>
                        </tr>
                        
           		  		<tr>
                            <td align="center">收款方式：</td>
                            <td align="left">
                            <select name="ptype" class="reginput" id="ptype" onChange="selectptype(this.value)">
                              <option value="1">支付宝</option>
                              <option value="4">微信</option>
                              
                              <!--
                              <option value="2">财付通</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>
                          <td><div class="regts" > 请选择一种收款方式，大于1千元的结算请使用网银收款</div></td>
                        </tr>
           		  		<tr>
                            <td align="center"><span id="payid">支付宝账号</span>：</td>
                            <td align="left"><input name="ayjcard" type="text" class="reginput" id="ayjcard" onBlur="return checkcard(this.value);" maxlength="30"></td>
                          <td><div id="cardd" class="regts" ><span id="cards"> 请填写与收款姓名一致的支付宝账号</span></div></td>
                        </tr>
                        
           		  		<tr id="khh" style="display:none">
                            <td align="center">开户行：</td>
                            <td align="left">
                            <input name="ayjzhihang" class="reginput" type="text" id="ayjzhihang"></td>
                          <td><div class="regts" > 填写详细开户行地址，包括省份，城市。查询开户行请致电银行。</div></td>
                        </tr>
                        
           		  		<tr id="skm">
                            <td align="center">收款码：</td>
                            <td align="left">
                            <input type="button" id="uploadButtone" value="上传收款二维码" /><input name="ayjpic" type="hidden" id="picurle" value="" readonly="readonly" /> 
							<span id="cone"></span>
                            </td>
                          <td><div class="regts" > 请上传收款二维码 <a href="/index/shili_shou" target="_blank">【什么是收款二维码？】</a></div></td>
                        </tr>
                        
                        
                 		<tr>
                            <td height="50"></td>
                            <td colspan="2"><input style="cursor:pointer" class="logindlreg" type="submit" name="Submit" value=" 添 加 结 算 账 号 " ><input name="act" type="hidden" value="add" /></td>
                        </tr>
                    </table>
            </form>
            <!-------------------------------------- 结束 -------------------------------------->
                    
                    
            <div class="gexian20"></div><br><br><br>
            <div class="mzsmbox2" style="padding-top:20px;">
            相关说明：<br>
            结算收款账号必须与商家姓名一致！<br>
            支付宝，微信结算只适用于1000元以下的结算！大于1000元的结算请使用银行卡收款！<br>
            </div>    

</div>


</DIV>


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

<br>

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


