<!--#include file =../conn.asp-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="../inc/Dv_LoadCache.asp" -->
<%	
	Head()
	Dim admin_flag,rs_c
	admin_flag=",1,"
	If Not Dvbbs.master or instr(","&session("flag")&",",admin_flag)=0 Then 
		Errmsg=ErrMsg + "<BR><li>本页面为管理员专用，请<a href=../admin_login.asp target=_top>登录</a>后进入。<br><li>您没有管理本页面的权限。"
		Call dvbbs_error()
	Else
		If Request("action")="Save1" Then
			Save1()
		ElseIf Request("action")="Save2" Then
			Save2()
		ElseIf Request("action")="Save3" Then
			Save3()
		ElseIf Request("action")="Save4" Then
			Save4()
		Else
			consted()
		End If
		If Errmsg <> "" Then Dvbbs_Error()
		Footer()
	End If


Sub consted()
Dim  sel
%>
<form method="POST" action="Challenge.asp?action=Save1">
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center class="tableBorder" style="LINE-HEIGHT: 110%;"> 
<th height=25 colspan=2 align=center id=tabletitlelink><a name="setting20"></a><b>RSS/WAP/手机短信/在线支付</b>
</tr>

<!--网络支付部分开始-->
<tr>
<td width="50%" class=Forumrow> <U>是否开启网络银行充值点券</U><br>开通后可通过网络支付手段来充值论坛点券</td>
<td width="50%" class=Forumrow>
<input type=radio name="Forum_ChanSetting(3)" value=1 <%if cint(Dvbbs.Forum_ChanSetting(3))=1 then%>checked<%end if%>>否&nbsp;
<input type=radio name="Forum_ChanSetting(3)" value=0 <%if cint(Dvbbs.Forum_ChanSetting(3))=0 then%>checked<%end if%>>是&nbsp;
</td>
</tr>
<tr>
<td width="50%" class=Forumrow> <U>支付宝账号</U><br>请到<a href="https://www.alipay.com/" target=_blank><font color=red>支付宝网站</font></a>申请一个支付宝账号，然后填写到表单中</td>
<td width="50%" class=Forumrow>  
<input type=text size=30 value="<%=Dvbbs.Forum_ChanSetting(4)%>" name="Forum_ChanSetting(4)">&nbsp;&nbsp;&nbsp;<%If Dvbbs.Forum_ChanSetting(4) <> "eway@aspsky.net" Then%><input type="submit" name="Submit" value="提交修改"><%End If%>
</td>
</tr>
<%If Dvbbs.Forum_ChanSetting(4) = "eway@aspsky.net" Then%>
<tr>
<td width="100%" class=forumRowHighlight colspan=2 height=25><font color=red>第一次申请要完整填写信息，此信息将不能修改，且将做为您修改论坛支付宝帐号的依据<BR>
如果您<B>已经注册过动网联盟网站帐号</B>，请将<B>联盟帐号</B>填写到支付宝帐号表单中，在此情况下您必须确认您的联盟帐号名和支付宝帐号名<B>相同</B>，并将密码和确认密码填写到下面表单中进行新网站绑定操作
<BR><B>修改论坛支付宝帐号</B>必须将您的身份证原件<B>传真或扫描</B>至动网官方，<a href="http://www.dvbbs.net/contact.asp" target=_blank><font color=red>联系动网官方</font></a><BR>
申请此功能必须确保您当前的论坛地址<B>基于互联网</B>，如在内网或本地测试将不能申请成功，<B>第一次申请您的支付宝帐号即为动网联盟帐号</B></font>
</td>
</tr>
<tr>
<td width="50%" class=Forumrow> <U>帐号密码</U><BR>为登录动网联盟网站密码<BR>申请成功后您可以使用支付宝帐号和此密码进入动网联盟网站</td>
<td width="50%" class=Forumrow>  
<input type=password size=33 name="password">&nbsp;<B>*</B>
</td>
</tr>
<tr>
<td width="50%" class=Forumrow> <U>确认密码</U><BR>请重新输入您的密码</td>
<td width="50%" class=Forumrow>  
<input type=password size=33 name="repassword">&nbsp;<B>*</B>
</td>
</tr>
<tr>
<td width="50%" class=Forumrow> <U>真实姓名</U><BR>请输入您的真实姓名</td>
<td width="50%" class=Forumrow>  
<input type=text size=30 name="realname">&nbsp;<B>*</B>
</td>
</tr>
<tr>
<td width="50%" class=Forumrow> <U>身份证号</U><BR>请输入您的身份证号</td>
<td width="50%" class=Forumrow>  
<input type=text size=30 name="idcode">&nbsp;<B>*</B>&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="申请帐号并绑定网站">&nbsp;<input type="submit" name="Submit" value="绑定网站">
</td>
</tr>
<%Else%>
<tr>
<td width="100%" class=forumRowHighlight colspan=2 height=25>修改论坛支付宝帐号必须将您的身份证原件传真或扫描至动网官方，<a href="http://www.dvbbs.net/contact.asp" target=_blank><font color=red>联系动网官方</font></a></font>
</td>
</tr>
<%End If%>
<tr>
<td width="100%" class=forumRowHighlight colspan=2 height=25><B>说明</B>：<BR>
1、网络银行支付功能由“阿里巴巴支付宝”提供，开通此功能需到<a href="https://www.alipay.com/" target=_blank><font color=red>支付宝网站</font></a>申请一个支付宝账号并填入上述表单，不正确的账号将会影响到您网站收益的结算<BR>
2、相关程序功能整合和中间接口由“海口动网先锋网络科技有限公司”提供，动网将对每笔订单收取一定的手续费用，详情请看“<a href="http://union.dvbbs.net/protocol.asp" target=_blank>动网网络支付服务协议</a>”<BR>
3、通常情况下默认的手续费标准为每笔订单费用的 <B>2%</B> ，最低手续费为 <B>1</B> 元人民币，此费用为动网直接收取，不收取任何的开通费和接口费用，动网会不定期的举行相关活动进行优惠，请随时留意 <a href="http://www.dvbbs.net/" target=_blank>动网官方</a> 公告<BR>
4、默认情况下，动网会每周将论坛交易应得款项转入上述支付宝账号，该帐户管理员可随时免费提取该帐户中的任意金额至银行帐户<BR>
5、开启此功能则默认视为接受“阿里巴巴支付宝”和“海口动网先锋网络科技有限公司”相关协议和条款约束<BR>
6、支付过程出现问题以及结算出现问题请及时和动网官方取得联系<BR>
7、请参考动网相关文档做好论坛的安全设置，尤其是要保证数据库的安全，因使用网站自身安全原因引起的非法支付动网不负任何责任，所有消费帐单以动网官方公布为准，如有疑义可随时联系动网官方解决<BR>
8、实时查询网站交易情况需登陆 <a href="http://union.dvbbs.net/" target=_blank>动网联盟站点</a>
</td>
</tr>
</form>
<form method="POST" action="Challenge.asp?action=Save2">
<!--手机部分开始-->
<tr> 
<td width="50%" class=Forumrow> <U>是否开启论坛手机相关功能</U><BR>手机相关功能总开关</td>
<td width="50%" class=Forumrow>  
<input type=radio name="Forum_ChanSetting(0)" value=0 <%if cint(Dvbbs.Forum_ChanSetting(0))=0 then%>checked<%end if%>>否&nbsp;
<input type=radio name="Forum_ChanSetting(0)" value=1 <%if cint(Dvbbs.Forum_ChanSetting(0))=1 then%>checked<%end if%>>是&nbsp;
</td>
</tr>
<td width="50%" class=Forumrow> <U>是否开启论坛WAP</U><br>开启后通过手机可浏览论坛和进行发贴等操作</td>
<td width="50%" class=Forumrow>  
<input type=radio name="Forum_ChanSetting(1)" value=0 <%if cint(Dvbbs.Forum_ChanSetting(1))=0 then%>checked<%end if%>>否&nbsp;
<input type=radio name="Forum_ChanSetting(1)" value=1 <%if cint(Dvbbs.Forum_ChanSetting(1))=1 then%>checked<%end if%>>是&nbsp;
</td>
</tr>
<tr>
<td width="50%" class=Forumrow> <U>是否开启手机短信充值点券</U><br>开启后可通过手机短信进行论坛点券充值　</td>
<td width="50%" class=Forumrow>  
<input type=radio name="Forum_ChanSetting(13)" value=0 <%if cint(Dvbbs.Forum_ChanSetting(13))=0 then%>checked<%end if%>>否&nbsp;
<input type=radio name="Forum_ChanSetting(13)" value=1 <%if cint(Dvbbs.Forum_ChanSetting(13))=1 then%>checked<%end if%>>是&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="提 交">
</td>
</tr>
<tr>
<td width="100%" class=forumRowHighlight colspan=2 height=25><B>说明</B>：<BR>相关的手机无线产品服务由北京阳光加信科技有限公司提供，开通此功能则默认接受相关的服务条款<BR><BR>
<%
dim trs
set trs=Dvbbs.Execute("select * from Dv_ChallengeInfo")
set rs=Dvbbs.Execute("select * from dv_setup")
%>
<%if Dvbbs.Forum_ChanSetting(0)="1" and rs("Forum_isinstall")=1 then%>
您已经安装了论坛的手机无线产品服务，具体事项请看相关说明<BR>
您当前注册的手机无线产品资料是，用户名：<%=trs("d_username")%>，网站名：<%=trs("d_forumname")%>，论坛地址：<%if trs("d_forumurl")="" then%><%=Dvbbs.Get_ScriptNameUrl()%><%else%><%=trs("d_forumurl")%><%end if%>，如果这些资料和您当前所使用的论坛不符（如论坛地址或用户名），您将不能得到相关的短信收益。<BR>
<a href="install.asp?isnew=1"><font color=blue>您可以点击此处进行资料更新或者重新注册站长资料</font></a>
<%else%>
您还没有安装论坛的手机无线产品服务，通过手机无线产品服务，您可以享受到各种不同的网站收益，具体请看关于<a href=""><font color=red>手机无线产品服务的说明</font></a>，<a href="install.asp"><font color=blue>点击此处开启论坛手机无线产品服务</font></a>
<%end if%>
<%
rs.close
set rs=nothing
trs.close
set trs=nothing
%>
</td>
</tr>
<!--手机部分结束-->
</form>
<form method="POST" action="Challenge.asp?action=Save3">
<tr>
<td width="50%" class=Forumrow> <U>充值的点券兑换率</U><BR>包括手机短信和网络支付方式</td>
<td width="50%" class=Forumrow>  
<input type=text size=5 value="<%=Dvbbs.Forum_ChanSetting(14)%>" name="Forum_ChanSetting(14)"> 张点券=1元人民币或短信
</td>
</tr>
<tr> 
<td width="50%" class=Forumrow> <U>是否开启RSS订阅功能</U><BR>开启后可通过一些RSS阅读软件订阅</td>
<td width="50%" class=Forumrow>  
<input type=radio name="Forum_ChanSetting(2)" value=1 <%if (Dvbbs.Forum_ChanSetting(2))="1" then%>checked<%end if%>>否&nbsp;
<input type=radio name="Forum_ChanSetting(2)" value=0 <%if (Dvbbs.Forum_ChanSetting(2))="0" then%>checked<%end if%>>是&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="Submit" value="提 交">
</td>
</tr>
</table>
</form>
<%
end sub

'保存网络支付相关
Sub Save1()
	'3是否开启/4支付宝账号/5动网关联ID/6Forum_AliPayKey
	Dim Forum_ChanSetting,iForum_ChanSetting,mForum_ChanSetting
	Set Rs=Dvbbs.Execute("Select Forum_ChanSetting From Dv_Setup")
	Forum_ChanSetting = Rs(0)
	Forum_ChanSetting = Split(Forum_ChanSetting,",")
	Rs.Close
	Set Rs=Nothing

	If Request("Forum_ChanSetting(3)")="1" Then
		For i = 0 To Ubound(Forum_ChanSetting)
			If i = 0 Then
				iForum_ChanSetting = Forum_ChanSetting(i)
			Else
				Select Case i
				Case 3
					iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Replace(Request.Form("Forum_ChanSetting(3)"),"'",""),",","")
				Case Else
					iForum_ChanSetting = iForum_ChanSetting & "," & Forum_ChanSetting(i)
				End Select
			End If
		Next
		Sql="Update Dv_Setup Set Forum_ChanSetting='"&iForum_ChanSetting&"'"
		Dvbbs.Execute(Sql)
		ReloadSetup()
		Dv_suc("网络支付设置成功！")
	Else
		Dim PassWord,rPassWord,RealName,IdCode,UserEmail
		If Request("Submit")="申请帐号并绑定网站" Then
			PassWord = Request("password")
			rPassWord = Request("repassword")
			RealName = Request("realname")
			IdCode = Request("idcode")
			UserEmail = Request("Forum_ChanSetting(4)")
			If PassWord = "" Or rPassWord = "" Or RealName = "" Or IdCode = "" Or UserEmail = "" Then
				Errmsg = "<li>请输入完整的注册信息。"
				Exit Sub
			End If
			If Not IsNumeric(IdCode) Then
				Errmsg = "<li>您输入的身份证信息有误。"
				Exit Sub
			End If
			If Len(IdCode)<>15 And Len(IdCode)<>18 Then
				Errmsg = "<li>您输入的身份证信息有误，必须是15或18位身份证号。"
				Exit Sub
			End If
			If PassWord <> rPassWord Then
				Errmsg = "<li>您两次输入的密码不一致，请重新输入。"
				Exit Sub
			End If
			If InStr(UserEmail,"@")=0 Or InStr(UserEmail,".")=0 Then
				Errmsg = "<li>您输入的邮件格式不正确。"
				Exit Sub
			End If
			Response.Redirect Dvbbs_Server_Url & "alipay.asp?Action=Join&Email="&UserEmail&"&ForumUrl="&Replace(Dvbbs.Get_ScriptNameUrl,Dvbbs.CacheData(33,0),"")&"&UserName="&Dvbbs.MemberName&"&idcode="&IdCode&"&realname="&RealName&"&password="&PassWord&""
		ElseIf Request("Submit")="绑定网站" Then
			PassWord = Request("password")
			rPassWord = Request("repassword")
			RealName = Request("realname")
			IdCode = Request("idcode")
			UserEmail = Request("Forum_ChanSetting(4)")
			If PassWord = "" Or rPassWord = "" Or UserEmail = "" Then
				Errmsg = "<li>请输入完整的注册信息。"
				Exit Sub
			End If
			If PassWord <> rPassWord Then
				Errmsg = "<li>您两次输入的密码不一致，请重新输入。"
				Exit Sub
			End If
			If InStr(UserEmail,"@")=0 Or InStr(UserEmail,".")=0 Then
				Errmsg = "<li>您输入的邮件格式不正确。"
				Exit Sub
			End If
			Response.Redirect Dvbbs_Server_Url & "alipay.asp?Action=Join&Email="&UserEmail&"&ForumUrl="&Replace(Dvbbs.Get_ScriptNameUrl,Dvbbs.CacheData(33,0),"")&"&UserName="&Dvbbs.MemberName&"&idcode=&realname=&password="&PassWord&""
		Else
			For i = 0 To Ubound(Forum_ChanSetting)
				If i = 0 Then
					iForum_ChanSetting = Forum_ChanSetting(i)
				Else
					Select Case i
					Case 3
						iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Replace(Request.Form("Forum_ChanSetting(3)"),"'",""),",","")
					Case Else
						iForum_ChanSetting = iForum_ChanSetting & "," & Forum_ChanSetting(i)
					End Select
				End If
			Next
			Sql="Update Dv_Setup Set Forum_ChanSetting='"&iForum_ChanSetting&"'"
			Dvbbs.Execute(Sql)
			ReloadSetup()
			Dv_suc("网络支付设置成功！")
		End If
	End If
End Sub

'保存从主服务器返回信息
Sub Save4()
	'3是否开启/4支付宝账号/5动网关联ID/6Forum_AliPayKey
	If Request("UserID")="" Or Request("Email")="" Or Request("ForumKey")="" Then
		Errmsg=ErrMsg + "<BR><li>非法的返回参数。"
		Exit Sub
	End If
	Dim Forum_ChanSetting,iForum_ChanSetting,mForum_ChanSetting
	Set Rs=Dvbbs.Execute("Select Forum_ChanSetting From Dv_Setup")
	Forum_ChanSetting = Rs(0)
	Forum_ChanSetting = Split(Forum_ChanSetting,",")
	mForum_ChanSetting = False
	For i = 0 To Ubound(Forum_ChanSetting)
		If i = 0 Then
			iForum_ChanSetting = Forum_ChanSetting(i)
		Else
			Select Case i
			Case 3
				iForum_ChanSetting = iForum_ChanSetting & ",0"
			Case 4
				iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Replace(Request("Email"),"'",""),",","")
			Case 5
				iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Replace(Request("UserID"),"'",""),",","")
			Case 6
				iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Replace(Request("ForumKey"),"'",""),",","")
			Case Else
				iForum_ChanSetting = iForum_ChanSetting & "," & Forum_ChanSetting(i)
			End Select
		End If
	Next
	Sql="Update Dv_Setup Set Forum_ChanSetting='"&iForum_ChanSetting&"'"
	Dvbbs.Execute(Sql)
	ReloadSetup()
	Rs.Close
	Set Rs=Nothing
	Dv_suc("主服务器网络支付功能设置成功！" & Request("msg"))
End Sub

'保存手机短信相关
Sub Save2()
	Dim Forum_ChanSetting,iForum_ChanSetting,mForum_ChanSetting
	Set Rs=Dvbbs.Execute("Select Forum_ChanSetting,Forum_challengePassWord From Dv_Setup")
	Forum_ChanSetting = Rs(0)
	Forum_ChanSetting = Split(Forum_ChanSetting,",")
	mForum_ChanSetting = False
	For i = 0 To Ubound(Forum_ChanSetting)
		If i = 0 Then
			iForum_ChanSetting = Request.Form("Forum_ChanSetting("&i&")")
			If (Cint(Replace(Request.Form("Forum_ChanSetting("&i&")"),",",""))=1 And Rs(1)="raynetwork") Or (Cint(Replace(Request.Form("Forum_ChanSetting("&i&")"),",",""))=1 And Cint(Forum_ChanSetting(i))=0) Then
				mForum_ChanSetting = True
			End If
		Else
			Select Case i
			Case 1
				iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Request.Form("Forum_ChanSetting("&i&")"),",","")
			Case 13
				iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Request.Form("Forum_ChanSetting("&i&")"),",","")
			Case Else
				iForum_ChanSetting = iForum_ChanSetting & "," & Forum_ChanSetting(i)
			End Select
		End If
	Next
	Sql="Update Dv_Setup Set Forum_ChanSetting='"&iForum_ChanSetting&"'"
	Dvbbs.Execute(Sql)
	ReloadSetup()
	Rs.Close
	Set Rs=Nothing
	If mForum_ChanSetting Then Response.Redirect "install.asp?isnew=1"
	Dv_suc("手机短信设置成功！")
End Sub

'保存杂项
Sub Save3()
	Dim Forum_ChanSetting,iForum_ChanSetting,mForum_ChanSetting
	Set Rs=Dvbbs.Execute("Select Forum_ChanSetting,Forum_challengePassWord From Dv_Setup")
	Forum_ChanSetting = Rs(0)
	Forum_ChanSetting = Split(Forum_ChanSetting,",")
	mForum_ChanSetting = False
	For i = 0 To Ubound(Forum_ChanSetting)
		If i = 0 Then
			iForum_ChanSetting = Forum_ChanSetting(i)
		Else
			Select Case i
			Case 2
				iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Request.Form("Forum_ChanSetting("&i&")"),",","")
			Case 14
				iForum_ChanSetting = iForum_ChanSetting & "," & Replace(Request.Form("Forum_ChanSetting("&i&")"),",","")
			Case Else
				iForum_ChanSetting = iForum_ChanSetting & "," & Forum_ChanSetting(i)
			End Select
		End If
	Next
	Sql="Update Dv_Setup Set Forum_ChanSetting='"&iForum_ChanSetting&"'"
	Dvbbs.Execute(Sql)
	ReloadSetup()
	Rs.Close
	Set Rs=Nothing
	Dv_suc("RSS设置成功！")
End Sub
%>