<!--#include file="../check.asp"--><!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>
<title>商户后台 - 分区管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="/css/reset.css" />
<link type="text/css" rel="stylesheet" href="/css/main.css" />
<link type="text/css" rel="stylesheet" href="/css/template_vendor.css" />
<script type="text/javascript" src="/scripts/common.js"></script>
<script type="text/javascript" src="/scripts/nav.js"></script>
<script type="text/javascript" src="/scripts/footerdock.js"></script>
</head>
<body>
<!--#include file="top.asp"-->




<%

fzid = Request("fzid")
Nowpage=request.QueryString("page")

set Rs1=GrateRs("select * from member where username like '"&trim(Session("Usr_UserName"))&"'",3)

Action = Request("cmd")



if Action="save" then
Set Rs = GrateRs("Select * From [L_woool] Where userid="&session("usr_userid")&" ",3)
  if not (rs.eof or rs.bof) then
    do while not rs.eof
      orderid=ClearSQL(request.form("txt"&rs("id")))
      if orderid="" or isnull(orderid) then orderid=0
	  rs("paixu")=orderid
	  rs.update
	  rs.movenext
	  loop
	  rs.close
	  set rs=nothing
response.write "<script language='JavaScript'>{window.alert('服务器修改排序已成功！');window.location='"&Request.ServerVariables("HTTP_REFERER")&"';}</script>"

		   response.end
	  end if
end if





Select Case Action
	Case "Modify"
	    Call Modify()
	Case "Add"
	    Call Add()
	Case "Del"
	    Call Del()
	Case "jiazai"
	    Call jiazai()
	Case Else
	    Call Main()
End Select



	Function GetBody(url)
		 on error resume next
		  dim Retrieval
		  Set Retrieval = CreateObject("Microsoft.XMLHTTP")
		  With Retrieval
			  .Open "Get", url, False, "", ""
			  .Send
			  GetBody = bytes2BSTR(.ResponseBody)
		  End With
		  Set Retrieval = Nothing
	End Function 

	Private Function bytes2BSTR(vIn)        '转换编码的函数
		dim StrReturn,ThisCharCode,i,NextCharCode
		strReturn = ""
		For i = 1 To LenB(vIn)
				ThisCharCode = AscB(MidB(vIn,i,1))
				If ThisCharCode < &H80 Then
						strReturn = strReturn & Chr(ThisCharCode)
				Else
						NextCharCode = AscB(MidB(vIn,i+1,1))
						strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
						i = i + 1
				End If
		Next
		bytes2BSTR = strReturn
	End Function



Sub jiazai()
ID = (Request("ID"))
If ID = "" Then 
	Response.Write "<script>alert('缺少参数！');history.back();</script>"
	Response.End()
End If

	Set Res = GrateRs("Select * From L_woool Where ID="& Cint(ID) &"  and userid="&Rs1("id")&" ",3)
If Res.Eof And Res.Bof Then
	Response.Write "<script>alert('找不到相关信息！');history.back();</script>"
	Response.End()
End If



ip=Res("ip")
key=Res("wkey")
post=Res("post")
serverid=Res("id")
bili=Res("yuanbao")

url="http://"&ip&":"&post&"/key,"&key&","&serverid&","&bili

Rvalue=GetBody(url)
'response.Write(url)
	'Response.End()
if Lcase(left(Rvalue,2))="ok" then
Response.Write "<script>alert('加载脚本成功！');history.back();</script>"
'response.Write("<img src=images/C4.gif>")
elseif Lcase(left(Rvalue,2))="no" then
Response.Write "<script>alert('加载脚本失败，密钥错误,请修改通讯密钥与客户端密钥一致！');history.back();</script>"
'response.Write("<img src=images/C3.gif>")
else
Response.Write "<script>alert('加载脚本失败，检查防火墙或网关是否开启！');history.back();</script>"
'response.Write("<img src=images/C2.gif>")
end if

set res=nothing
end sub




Sub Del()
ID = (Request("ID"))
If ID = "" Then 
	Response.Write "<script>alert('缺少参数！');history.back();</script>"
	Response.End()
End If

	Set Res = GrateRs("Select * From L_woool Where ID="& Cint(ID) &"  and userid="&Rs1("id")&" ",3)
If Res.Eof And Res.Bof Then
	Response.Write "<script>alert('找不到相关信息！');history.back();</script>"
	Response.End()
End If
	set rsq = GrateRs("select * from L_jiangli where quid="& Cint(ID) &" ",3)
	do while not rsq.eof

	rsq.delete
	rsq.update



		rsq.movenext
	Loop
	rsq.close
	set rsq = nothing

	res.delete
	res.update






	response.Write("<script>alert('提示：删除成功！');window.location.href='?fzid="&fzid&"'</script>")
	set res=nothing
end sub




%>


<%Sub Main()%>


<script language="javascript" src="images/swfobject.js" type="text/javascript"></script>

	<div id="mainborder">
		<div id="main">
			
		<form method="post" action="?cmd=save" id="ctl01">

<form method="post" action="?cmd=save">



			<div>
				<div class="fl"><h3 class="bigico bigico_folditem">分区管理</h3></div>
				<div class="fr" style="margin-top:20px">

					<a href="?cmd=Add&fzid=0" class="bullet_add">添加分区</a><span class="separator"> | </span>
					<a href="Groups.asp?cmd=Add" class="bullet_add">添加分组</a>
				</div>
				<div class="vspace clear"></div>
			</div>
		
			<div class="gridwrap">
				<table class="grid fixed">
					<thead>
						<th width="35">序号</th>
						<th>分区</th>
						<th width="215">支付连接</th>
						<th width="70">连接状态</th>
						<th width="80">服务器编号</th>
						<th width="80">分组编号</th>
						<th width="220" class="center">操作</th>
					</thead>
					


          <%
			  	Set Rs=GrateRs("select top 100 * from L_woool where userid="&Rs1("id")&" order by paixu desc",1)
						if rs.eof or rs.bof then
		%>


<tr>
<td colspan="7">暂无分区记录！</td>
</tr>




		<%else
		for i= 1 to rs.pagesize
		if rs.eof then
		exit for
		end if

			  %>




							
							<tr class="alt">
								<td style="padding-right:0"><input type='text' maxlength='4' name='txt<%=rs("id")%>'  value='<%=rs("paixu")%>' style='width:25px' title='排序号'  onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" /> &nbsp;</td>
								<td><span class="ico_storage block"><%=rs("wooolName")%></span></td>
								<td><a target="_blank" class="ico_star block" title="支付链接" href="http://pay.6046.com/?m=<%=rs("id")%>">http://pay.6046.com/?m=<%=rs("id")%></a></td>
								<td>

<div id="flashcontent<%=rs("id")%>" style="width:20px;height:20px;"></div><script language="JavaScript" type="text/javascript">function writeFlash<%=rs("id")%>(){var so = new SWFObject("images/GetGsState.swf", "fplayer", "100%", "100%", 8, "#FFFFFF");so.addParam("quality", "high");so.addParam("swLiveConnect", "true");so.addParam("menu", "false");so.addParam("wmode", "transparent");so.addParam("allowScriptAccess", "sameDomain");so.addParam("allowFullScreen", "true");so.addVariable("ip","<%=Rs("IP")%>");so.addVariable("port","<%=Rs("post")%>");so.write("flashcontent<%=rs("id")%>");}writeFlash<%=rs("id")%>();</script>
</td>
								<td><%=rs("id")%></td>
								<td><%=rs("fzid")%></td>
								<td class="right">
									<a href="PaidlesslyDeliver.asp?id=<%=rs("id")%>" title="直接发货">直接发货</a><span class="separator"> | </span>
									<a href="?cmd=jiazai&fzid=<%=rs("fzid")%>&id=<%=rs("id")%>">重新加载</a><span class="separator"> | </span>
									<a href="?cmd=Modify&fzid=<%=rs("fzid")%>&id=<%=rs("id")%>">修改</a><span class="separator"> | </span>
									<a href='?cmd=Del&fzid=<%=rs("fzid")%>&id=<%=rs("id")%>' onClick="return confirm('确定要删除此服务器吗？删除后不能恢复！')">删除</a>&nbsp;


								</td>
							</tr>

						

          <%
	 Rs.movenext
next
	 %>		





						
					<tr>
						<td colspan="6">
							<input type="submit" name="orderBtn" value="更新排序" id="orderBtn" class="button" /> &nbsp;
							
						</td>
					</tr>
				</table>
			</div>
		</form>
	
		</div>


	</div>





   

      <%
end if
		%>

<%
End Sub




Sub Modify()
ID = (Request("ID"))
If ID = "" Then 
	Response.Write "<script>alert('缺少参数！');history.back();</script>"
	Response.End()
End If


Set Res = GrateRs("Select * From L_woool Where ID="& Cint(ID) &" and userid="&Rs1("id")&" ",3)
If Res.Eof And Res.Bof Then
	Response.Write "<script>alert('找不到相关信息！');history.back();</script>"
	Response.End()
End If

    If Request("Update") = "OK" Then
	    wooolName = Request("wooolName")
		yuanbao = Request("yuanbao")
		if yuanbao = "" then yuanbao = 0
		IP = Request("IP")
		wkey = Request("wkey")
		post = Request("post")
		mbjz = Request("mbjz")
		serverfz =  Request("serverfz")
		gonggao = Request("gonggao")


		If wooolName = "" Then 
			Response.Write "<script>alert('请输入名称！');history.back();</script>"
			Response.End()
		End If	
		
		 Res("wooolName") = wooolName
		 Res("yuanbao") = yuanbao
		 Res("wkey") = wkey
		 Res("post") = post
		 Res("IP") = IP
		 Res("fzid") = serverfz
		 Res("mbjz")= mbjz
		 Res("gonggao")= gonggao
		 Res("GameID")= 1
		 Res.Update

		Set Res = Nothing






		  SQL = "Select ID, pname From H_name  order by id"
		  Set Res3 = Server.CreateObject("ADODB.Recordset")
		  Res3.Open SQL,Conn,1,2
		  Do While Not Res3.Eof
		  	jiangli = Request("jiangli_"&Res3("id"))
			if jiangli<>"" then 
				set prs = GrateRs("Select * From L_jiangli where UserID="&Rs1("id")&" and QuID="&Cint(ID)&" and psortID="&Res3("id"),3)
				If (prs.Eof and prs.Bof) Then
					prs.addnew
					prs("UserID") = Rs1("id")
					prs("psortID") = Res3("id")
					prs("QuID") = ID
				end if
				prs("jiangli") = Cint(jiangli)
				prs.update
				prs.close
			end if
		  Res3.Movenext
		  Loop






		  SQL = "Select ID, rmbname From H_rmbname order by id"
		  Set Res3 = Server.CreateObject("ADODB.Recordset")
		  Res3.Open SQL,Conn,1,2
		  Do While Not Res3.Eof
		  	rmbjiangli = Request("rmbjiangli_"&Res3("id"))
			if rmbjiangli<>"" then 
				set prs = GrateRs("Select * From L_rmbjiangli where UserID="&Rs1("id")&" and QuID="&Cint(ID)&" and psortID="&Res3("id"),3)
				If (prs.Eof and prs.Bof) Then
					prs.addnew
					prs("UserID") = Rs1("id")
					prs("psortID") = Res3("id")
					prs("QuID") = ID
				end if
				prs("jiangli") = Cint(rmbjiangli)
				prs.update
				prs.close
			end if
		  Res3.Movenext
		  Loop







		Response.Write "<script>alert('修改成功!');location.href='?fzid="&serverfz&"';</script>"
		Response.End()
	End IF
%>








<script type="text/javascript" src="/scripts/vendor.merchandiseedit.aspx.js"></script>





	<div id="mainborder">
		<div id="main">
			
		<h3 class="bigico bigico_folditem">编辑分区</h3>
		<div class="vspace"></div>
		
		<div class="shrink">
			<form method="post" action="" id="ctl01">




				<style type="text/css">
					.caption { float: left; width:108px; text-align: center; padding: 5px 12px 3px 12px; position: relative; top:12px; left: 15px; font-weight: bold; color: white; background: gray; }
					.container { border-width: 1px; border-style: solid; border-color: #ccc; padding: 25px 15px 15px 15px; }
					.fieldname { width: 75px; text-align: right; }
					.button { color: black !important; color: black; }
					input, textarea { color: Red; }
					#groupSelect, #bankAmounts { margin-left: -4px; }
					#groupSelect td, #bankAmounts td { background: none; padding: 1px; }
				</style>
				
				<div class="caption">分区分组</div>
				<div class="clear"></div>
				<div class="container">
					<table cellpadding="4" cellspacing="0" class="fixed">
						<tr>
							<td class="fieldname">位于分组</td>
							<td><select name="serverfz" id="serverSelect" class="aspNetDisabled" style="width:206px;">
<%

fzid = Cint(Request("fzid"))

	set Rs=GrateRs("select * from L_fenzu where userid="&Session("Usr_userid"),1)
	do while not Rs.eof
		Response.Write "<option value='"&Rs("id")&"'"
		If Rs("id")=fzid Then Response.Write " selected "
		Response.Write ">"&Rs("name")&"</option>"
		Rs.movenext
	loop 

%>

</select>
								&nbsp;
								<span id="serverTip" class="t3"></span>
								<a href="Groups.asp?cmd=Add" class="bullet_add underline">添加分组</a> &nbsp;
								
							</td>
						</tr>

					</table>
				</div>
				
				<div>
					<div class="caption" style="background:#72B02B">分区基本设置</div>
					<div class="clear"></div>
					<div class="container" style="border-color:#72B02B">
						<div>
								<table width="95%" cellpadding="4" cellspacing="0" class="fixed">
									<tr>
										<td class="fieldname">分区名称</td>
										<td><input name="wooolName" type="text" value="<%=Res("wooolName")%>" maxlength="24" id="wooolName" style="width:200px;" /> &nbsp; <span class="t3">请不要在区名中包含特殊字符</span></td>
									</tr>
									<tr>
										<td class="fieldname">服务器IP</td>
										<td><input name="IP" type="text" value="<%=Res("IP")%>" maxlength="24" id="IP" style="width:200px;" /> &nbsp; <span class="t3">服务器IP </span></td>
									</tr>
									<tr>
										<td class="fieldname">支付网关端口</td>
										<td><input name="post" type="text" value="<%=Res("post")%>" maxlength="24" id="post" pattern="^\d+$" style="width:200px;" /> &nbsp; <span class="t3">8880为默认值, 如果网关修改了端口, 这里请与网关端口填写一致</span></td>
									</tr>
									<tr>
										<td class="fieldname">支付网关密钥</td>
										<td><input name="wkey" type="text" value="<%=Res("wkey")%>" maxlength="24" id="wkey" style="width:200px;" /> &nbsp; <span class="t3">必须与您运行的冲值服务器端设定的一致</span></td>
									</tr>
									<tr>
										<td class="fieldname">兑换比例</td>
										<td><input name="yuanbao" type="text" value="<%=Res("yuanbao")%>" maxlength="24" id="yuanbao" pattern="^\d+$" style="width:200px;" /> &nbsp; <span class="t3">如1元人民币兑换200元宝, 填200</span></td>
									</tr>
									<tr>
										<td class="fieldname">兑换名称</td>
										<td><input name="mbjz" type="text" value="<%=Res("mbjz")%>" maxlength="24" id="mbjz" style="width:200px;" /> &nbsp; <span class="t3">如元宝, 金币, 金刚石等</span></td>
									</tr>
									<tr>
										<td class="fieldname" valign="top">分区公告</td>
										<td><textarea name="gonggao" rows="5" cols="20" id="description" style="width:98%;">
<%=Res("gonggao")%></textarea></td>
									</tr>
								</table>
							</div>

							<div class="clear"></div>
						</div>
					</div>









					<div class="caption" style="background:#549EE5">充值额外奖励设置</div>
					<div class="clear"></div>
					<div class="container" style="border-color:#549EE5">
						<table cellpadding="4" cellspacing="0" width="100%" class="fixed">
							<tr>



<%
		  SQL = "Select ID, pname From H_name  order by id"
		  Set Res3 = Server.CreateObject("ADODB.Recordset")
		  Res3.Open SQL,Conn,1,2
		  i=1
		  Do While Not Res3.Eof
		  set prs = GrateRs("Select * From L_jiangli where UserID="&Rs1("id")&" and QuID="&Cint(ID)&" and psortID="&Res3("id"),1)
		  If not (prs.Eof and prs.Bof) Then
		  	jiangli = prs("jiangli")
		  else
			jiangli = 0
		  end if
		  %>



								<td class="fieldname"><%=Res3("pname")%>赠送</td>
								<td><input name="jiangli_<%=Res3("id")%>" type="text" value="<%=jiangli%>" maxlength="4" id="jiangli_<%=Res3("id")%>" pattern="^\d+$" style="width:45px;" /> %</td>




		  <%

		  i=i+1
		 	Res3.Movenext
		 Loop
		 %>




							</tr>
							<tr>
								<td></td>
								<td colspan="7" class="t3">填写百分数 (不用填百分号)，表示使用不同支付方式时分别可获得的额外赠送比例，填 <span class="bold">0</span> 表示关闭对应项。</td>
							</tr>
						</table>
						<div style="width:90%; height:20px; margin:auto; background:url(../images/dotline.gif) 0 6px repeat-x">&nbsp;</div>

						<table cellpadding="4" cellspacing="0" width="100%" class="fixed">
							<tr>



<%
		  SQL = "Select ID, rmbname From H_rmbname  order by id"
		  Set Res3 = Server.CreateObject("ADODB.Recordset")
		  Res3.Open SQL,Conn,1,2
		  i=1
		  Do While Not Res3.Eof
		  set prs = GrateRs("Select * From L_rmbjiangli where UserID="&Rs1("id")&" and QuID="&Cint(ID)&" and psortID="&Res3("ID"),1)
		  If not (prs.Eof and prs.Bof) Then
		  	jiangli = prs("jiangli")
		  else
			jiangli = 0
		  end if
		  %>


								<td class="fieldname"><%=Res3("rmbname")%>赠送</td>
								<td><input name="rmbjiangli_<%=Res3("ID")%>" type="text" value="<%=jiangli%>" maxlength="4" id="rmbjiangli_<%=Res3("ID")%>" pattern="^\d+$" style="width:45px;" /> %</td>




		  <%

if i mod 4=0 then response.write"</tr><tr>"

		  i=i+1
		 	Res3.Movenext
		 Loop
		 %>

							</tr>
							<tr>
								<td></td>
								<td colspan="7" class="t3">填写百分数 (不用填百分号)，表示单次充值金额达到某个数额时可以获得的赠送比例，填 <span class="bold">0</span> 表示关闭对应项。</td>
							</tr>
						</table>
					</div>
					


              <input name="Update" type="hidden"  id="Update" value="OK">
              <input name="ID" type="hidden" id="ID" value="<%=Res("ID")%>">



					<div style="margin-top:15px">		
						<input type="submit" name="save" value="修改" id="save" class="button" style="height:28px;width:90px;" />
						<input type="button" value="取消" style="width:90px; height:28px" class="button" onclick="javascript:history.back();" />
						&nbsp; &nbsp;
						<span id="testing" class="t2"></span>
					</div>
				</div>
			


</form>
		</div>
	
		</div>
	</div>
</div>
</body>
</html>


























<%
Set Res = Nothing
End Sub


Sub Add()
    If Request("Update") = "OK" Then
	    wooolName = Request("wooolName")
		yuanbao = Request("yuanbao")
		if yuanbao = "" then yuanbao = 0
		IP = Request("IP")
		wkey = Request("wkey")
		post = Request("post")
		mbjz = Request("mbjz")
		serverfz =  Request("serverfz")
		gonggao = Request("gonggao")

		If wooolName = "" Then 
			Response.Write "<script>alert('请输入名称！');history.back();</script>"
			Response.End()
		End If
		




		Set Res = GrateRs("Select * From L_woool Where ID is null ",3)	
		Res.Addnew
		Res("wooolName") = wooolName
		Res("yuanbao") = yuanbao
		Res("wkey") = wkey		
		Res("post") = post
		Res("IP") = IP
		Res("mbjz") = mbjz
		Res("gonggao") = gonggao
		Res("fzid") = serverfz
		Res("UserID") = Rs1("id")
		Res.Update
		Set Res = Nothing
		

		  Set quRes = GrateRs("Select top 1 ID From L_woool Where UserID="&Rs1("id")&" Order By ID Desc",1)
		  QuID = quRes("ID")
		  quRes.close
		  SQL = "Select ID, pname From H_name  order by id"
		  Set Res3 = Server.CreateObject("ADODB.Recordset")
		  Res3.Open SQL,Conn,1,2
		  Do While Not Res3.Eof
		  	jiangli = Request("jiangli_"&Res3("id"))
			if jiangli<>"" then 
				set prs = GrateRs("Select * From L_jiangli where UserID="&Rs1("id")&" and QuID="&QuID&" and psortID="&Res3("id"),3)
				If (prs.Eof and prs.Bof) Then
					prs.addnew
					prs("UserID") = Rs1("id")
					prs("psortID") = Res3("id")
					prs("QuID") = QuID
				end if
				prs("jiangli") = Cint(jiangli)
				prs.update
				prs.close
			end if
		  Res3.Movenext
		  Loop



		  SQL = "Select ID, rmbname From H_rmbname order by id"
		  Set Res3 = Server.CreateObject("ADODB.Recordset")
		  Res3.Open SQL,Conn,1,2
		  Do While Not Res3.Eof
		  	rmbjiangli = Request("rmbjiangli_"&Res3("id"))
			if rmbjiangli<>"" then 
				set prs = GrateRs("Select * From L_rmbjiangli where UserID="&Rs1("id")&" and QuID="&QuID&" and psortID="&Res3("id"),3)
				If (prs.Eof and prs.Bof) Then
					prs.addnew
					prs("UserID") = Rs1("id")
					prs("psortID") = Res3("id")
					prs("QuID") = QuID
				end if
				prs("jiangli") = Cint(rmbjiangli)
				prs.update
				prs.close
			end if
		  Res3.Movenext
		  Loop






		Response.Write "<script>alert('添加成功!');location.href='?fzid="&serverfz&"';</script>"
		Response.End()
	End IF
%>





<script type="text/javascript" src="/scripts/vendor.merchandiseedit.aspx.js"></script>



	<div id="mainborder">
		<div id="main">
			
		<h3 class="bigico bigico_folditem">添加分区</h3>
		<div class="vspace"></div>
		
		<div class="shrink">
			<form method="post" action="" id="ctl01">



				<style type="text/css">
					.caption { float: left; width:108px; text-align: center; padding: 5px 12px 3px 12px; position: relative; top:12px; left: 15px; font-weight: bold; color: white; background: gray; }
					.container { border-width: 1px; border-style: solid; border-color: #ccc; padding: 25px 15px 15px 15px; }
					.fieldname { width: 75px; text-align: right; }
					.button { color: black !important; color: black; }
					input, textarea { color: Red; }
					#groupSelect, #bankAmounts { margin-left: -4px; }
					#groupSelect td, #bankAmounts td { background: none; padding: 1px; }
				</style>
				
				<div class="caption">分区分组</div>
				<div class="clear"></div>
				<div class="container">
					<table cellpadding="4" cellspacing="0" class="fixed">
						<tr>
							<td class="fieldname">位于分组</td>
							<td><select name="serverfz" id="serverSelect" class="aspNetDisabled" style="width:206px;">

<%
fzid = Cint(Request("fzid"))

	Response.Write "<option value='' >请选择服务器分组</option>"
	set Rs=GrateRs("select * from L_fenzu where userid="&Session("Usr_userid"),1)
	do while not Rs.eof
		Response.Write "<option value='"&Rs("id")&"'"
		If Rs("id")=fzid Then Response.Write " selected "
		Response.Write ">"&Rs("name")&"</option>"
		Rs.movenext
	loop 

%>
</select>
								&nbsp;
								<span id="serverTip" class="t3"></span>
								<a href="Groups.asp?cmd=Add" class="bullet_add underline">添加分组</a> &nbsp;
								
							</td>
						</tr>

					</table>
				</div>
				
				<div>
					<div class="caption" style="background:#72B02B">分区基本设置</div>
					<div class="clear"></div>
					<div class="container" style="border-color:#72B02B">
						<div>
								<table width="95%" cellpadding="4" cellspacing="0" class="fixed">

									<tr>
										<td class="fieldname">分区名称</td>
										<td><input name="wooolName" type="text"  maxlength="24" id="wooolName" style="width:200px;" /> &nbsp; <span class="t3">请不要在区名中包含特殊字符</span></td>
									</tr>
									<tr>
										<td class="fieldname">服务器IP</td>
										<td><input name="IP" type="text"  maxlength="24" id="IP" style="width:200px;" /> &nbsp; <span class="t3">服务器IP </span></td>
									</tr>
									<tr>
										<td class="fieldname">支付网关端口</td>
										<td><input name="post" type="text" value="8880" maxlength="24" id="post" pattern="^\d+$" style="width:200px;" /> &nbsp; <span class="t3">8880为默认值, 如果网关修改了端口, 这里请与网关端口填写一致</span></td>
									</tr>
									<tr>
										<td class="fieldname">支付网关密钥</td>
										<td><input name="wkey" type="text" value="<%
For i=1 To 12
Randomize
Rnd_Chr = Rnd_Chr & Chr(Int((122 - 97 + 1) * Rnd + 97))
Next

response.Write replace(replace(replace(replace(replace(replace(replace(replace(replace(Rnd_Chr,"a","1"),"b","2"),"c","3"),"d","4"),"e","5"),"f","6"),"g","7"),"h","8"),"j","9")
%>" maxlength="24" id="wkey" style="width:200px;" /> &nbsp; <span class="t3">必须与您运行的冲值服务器端设定的一致</span></td>
									</tr>
									<tr>
										<td class="fieldname">兑换比例</td>
										<td><input name="yuanbao" type="text" value="10" maxlength="24" id="yuanbao" pattern="^\d+$" style="width:200px;" /> &nbsp; <span class="t3">如1元人民币兑换200元宝, 填200</span></td>
									</tr>
									<tr>
										<td class="fieldname">兑换名称</td>
										<td><input name="mbjz" type="text" value="元宝" maxlength="24" id="mbjz" style="width:200px;" /> &nbsp; <span class="t3">如元宝, 金币, 金刚石等</span></td>
									</tr>
									<tr>
										<td class="fieldname" valign="top">分区公告</td>
										<td><textarea name="gonggao" rows="5" cols="20" id="description" style="width:98%;">
</textarea></td>
									</tr>
								</table>
							</div>

							<div class="clear"></div>
						</div>
					</div>





					<div class="caption" style="background:#549EE5">充值额外奖励设置</div>
					<div class="clear"></div>
					<div class="container" style="border-color:#549EE5">
						<table cellpadding="4" cellspacing="0" width="100%" class="fixed">
							<tr>


<%
		  SQL = "Select ID, pname From H_name  order by id"
		  Set Res3 = Server.CreateObject("ADODB.Recordset")
		  Res3.Open SQL,Conn,1,2
		  i=1
		  Do While Not Res3.Eof
		  %>


								<td class="fieldname"><%=Res3("pname")%>赠送</td>
								<td><input name="jiangli_<%=Res3("id")%>" type="text" value="0" maxlength="4" id="jiangli_<%=Res3("id")%>" pattern="^\d+$" style="width:45px;" /> %</td>





		  <%
'if i mod 3=0 then response.write"</tr><tr>"
		  i=i+1
		 	Res3.Movenext
		 Loop
		 %>

							</tr>
							<tr>
								<td></td>
								<td colspan="7" class="t3">填写百分数 (不用填百分号)，表示使用不同支付方式时分别可获得的额外赠送比例，填 <span class="bold">0</span> 表示关闭对应项。</td>
							</tr>
						</table>



						<div style="width:90%; height:20px; margin:auto; background:url(../images/dotline.gif) 0 6px repeat-x">&nbsp;</div>

						<table cellpadding="4" cellspacing="0" width="100%" class="fixed">
							<tr>




<%
		  SQL = "Select ID, rmbname From H_rmbname  order by id"
		  Set Res3 = Server.CreateObject("ADODB.Recordset")
		  Res3.Open SQL,Conn,1,2
		  i=1
		  Do While Not Res3.Eof
		  %>


								<td class="fieldname"><%=Res3("rmbname")%>赠送</td>
								<td><input name="rmbjiangli_<%=Res3("ID")%>" type="text" value="0" maxlength="4" id="rmbjiangli_<%=Res3("ID")%>" pattern="^\d+$" style="width:45px;" /> %</td>





		  <%

if i mod 4=0 then response.write"</tr><tr>"

		  i=i+1
		 	Res3.Movenext
		 Loop
		 %>


							</tr>
							<tr>
								<td></td>
								<td colspan="7" class="t3">填写百分数 (不用填百分号)，表示单次充值金额达到某个数额时可以获得的赠送比例，填 <span class="bold">0</span> 表示关闭对应项。</td>
							</tr>
						</table>
					</div>

              <input name="Update" type="hidden"  id="Update" value="OK">



					<div style="margin-top:15px">		
						<input type="submit" name="save" value="成功" id="save" class="button" style="height:28px;width:90px;" />
						<input type="button" value="取消" style="width:90px; height:28px" class="button" onclick="javascript:history.back();" />
						&nbsp; &nbsp;
						<span id="testing" class="t2"></span>
					</div>
				</div>
			


</form>
		</div>
	
		</div>
	</div>
</div>
</body>
</html>







<%
Set Res = Nothing
End Sub
%>







</div>
</body>
</html>


