<!--#include file="../../fy.Function.asp"-->
<!--#include file="../../../fy_inc/cls_pageview.asp"-->
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>在线支付平台管理</title>
<link rel="stylesheet" type="text/css" href="../../css/base.css">
<link rel="stylesheet" type="text/css" href="../../css/content.css">
</head>
<body>
<div class="content"> 
	<div class="breadnav">当前位置：<a href="#">后台首页</a> >> 模型管理</div>
    <%  Dim ID:ID=ChkNumeric(fycms.s("ID"))

 	Dim ShowErr,ModeID,ModeName
	ModeID = ChkNumeric(Request("ModeID"))
	if ModeID=0 or ModeID="" Then ModeID=1
	ModeName= fycms.ACT_C(ModeID,1) 
	Dim strLocalUrl
	strLocalUrl = request.ServerVariables("SCRIPT_NAME")
	Dim intPageNow
	intPageNow = request("page")
	Dim intPageSize, strPageInfo
	intPageSize = 20
	Dim arrinfo, i,Action
	Dim sql, sqlCount,Sqls,pages
	Action=fycms.s("Action")
	Select Case Action
		Case "sets":Call sets
		Case "disabled":Call disabled
		Case "Edit":Call Edit
		Case "Editsave":Call Editsave
 		Case Else :Call main
	End Select 
 
		
	Sub Editsave()
	  Dim ID:ID=ChkNumeric(fycms.s("ID"))
	  Dim PlatName:PlatName=fycms.s("PlatName")
	  Dim Notes:Notes=fycms.s("Notes")
	  Dim AccountID:AccountID=fycms.s("AccountID")
	  Dim MD5Key:MD5Key=fycms.s("MD5Key")
	  Dim Rate:Rate=fycms.s("Rate")
	  Dim RateByUser:RateByUser=ChkNumeric(fycms.s("RateByUser"))
	  Dim IsDisabled:IsDisabled=ChkNumeric(fycms.s("IsDisabled"))
	  Dim RS:Set RS=Server.CreateOBject("ADODB.RECORDSET")
	  RS.Open "Select * from PaymentPlat_fy where id=" & ID,conn,1,3
	  If Not RS.Eof Then
		RS("PlatName") = PlatName
		RS("Notes")     = Notes
		RS("AccountID")= AccountID
		RS("MD5Key")   = MD5Key
		RS("Rate")     = Rate
		RS("RateByUser")=RateByUser
		RS("IsDisabled")= IsDisabled
		RS.Update
	  End If
	  RS.Close:Set RS=Nothing
	  Call fycms.Alert("恭喜，修改成功！","index.asp") 
	End Sub
		
	Sub disabled()
	  fycms.actexe("Update PaymentPlat_fy Set IsDisabled=" & ChkNumeric(fycms.s("type")) & " where id=" & ID)
	  Call fycms.Alert("恭喜，修改成功！","index.asp") 
	End Sub
	Sub sets()
		  Dim PlatName:PlatName=fycms.s("PlatName")
		  Dim Notes:Notes=fycms.s("Notes")
		  Dim AccountID:AccountID=fycms.s("AccountID")
		  Dim MD5Key:MD5Key=fycms.s("MD5Key")
		  Dim Rate:Rate=fycms.s("Rate")
		  Dim RateByUser:RateByUser=ChkNumeric(fycms.s("RateByUser"))
		  Dim IsDisabled:IsDisabled=ChkNumeric(fycms.s("IsDisabled"))
		  Dim RS:Set RS=Server.CreateOBject("ADODB.RECORDSET")
		  RS.Open "Select * from PaymentPlat_fy where id=" & ID,conn,1,3
		  If Not RS.Eof Then
		    RS("PlatName") = PlatName
			RS("Notes")     = Notes
			RS("AccountID")= AccountID
			RS("MD5Key")   = MD5Key
			RS("Rate")     = Rate
			RS("RateByUser")=RateByUser
			RS("IsDisabled")= IsDisabled
			RS.Update
		  End If
		  RS.Close:Set RS=Nothing
		  Call fycms.Alert("恭喜，修改成功！","index.asp") 
 	End Sub 
 
 

 Sub main()%><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
      <tr>
      <th>ID</th>
	  <th>排序</th>
	  <th>支付平台</th>
	  <th>商家ID</th>
	  <th>备注说明</th>
	  <th>手续费</th>
	  <th>默认</th>
	  <th>启用</th>
	  <th>管理操作</th>
	  <th>申请</th>
	  </tr>
 





    </thead>
	 <%	Dim rs
		Set rs=fycms.actexe("select * from PaymentPlat_fy")
		If Not rs.eof Then 
			Do While Not rs.eof
	%>
    <tr >
      <td  ><%=rs("ID")%></td>
      <td  >
		  <input name="OrderID" type="text" class="Ainput" id="OrderID" value="<%=rs("OrderID")%>" size="4" maxlength="3">
          <input name="A" type="hidden" id="A" value="N">
		  <input name="ID" type="hidden" id="ID" value="<%=rs("ID")%>">	
 		</td>
      <td><%=rs("PlatName")%></td>
      
	  <td  >
	 <%=rs("AccountID")%></td>
  
      <td><%=rs("Notes")%></td>
	 
      <td><%=rs("Rate")%>%</td>
	   
      <td>
<%
				 If rs("IsDefault")=1 Then
			   echo "<input type='radio' name='IsDefault' value='" & rs("ID") & "' checked>"
			   Else
			    echo "<input type='radio' name='IsDefault' value='" & rs("ID") & "'>"
			   End If
			   
			   %></td>
      <td><%
			 If  rs("IsDisabled")=1 Then
			    echo "<input type='checkbox' name='IsDisabled' value='" &rs("ID") & "' checked>"
			   Else
			    echo "<input type='checkbox' name='IsDisabled' value='" & rs("ID") & "'>"
			   End If
			   
			   
	  %></td>
      <td><a href="?Action=Edit&ID=<%=rs("ID")%>" >修改</a> 
	  <%If rs("IsDisabled")=1 Then %>
		<a href="?Action=disabled&type=0&ID=<%=rs("ID")%>" >关闭</a>
	  <%Else%>
		<a href="?Action=disabled&type=1&ID=<%=rs("ID")%>" >启用</a>
	  <%End If%>
	  </td>
      <td><%   	Select Case rs("ID")
			    Case  1  echo "<a href='http://merchant3.chinabank.com.cn/register.do' target='_blank'>申请商户</a>"
			    Case  2  echo "<a href='http://www.ipay.cn/home/index.php' target='_blank'>申请商户</a>"
			    Case  3  echo "<a href='https://www.ips.com.cn/' target='_blank'>申请商户</a>"
				Case  4  echo "<a href='http://www.yeepay.com/' target='_blank'>申请商户</a>"
				Case  5  echo "<a href='http://new.xpay.cn/SignUp/Default.aspx' target='_blank'>申请商户</a>"
			    Case  6  echo "<a href='https://www.cncard.net/products/products.asp' target='_blank'>申请商户</a>"
			    Case  7,9  echo "<a href='https://b.alipay.com/order/hot.htm' target='_blank'>申请商户</a>"
			    Case  8  echo "<a href='https://www.99bill.com/website/' target='_blank'>申请商户</a>"
			    Case 10  echo "<a href='http://union.tenpay.com/mch/mch_register.shtml?sp_suggestuser=1202640601' target='_blank'>申请商户"
				case 11  echo "<a href='http://union.tenpay.com/mch/mch_register_1.shtml?sp_suggestuser=1202640601' target='_blank'>申请商户"
				case 12  echo "<a href='https://www.paypal.com/c2/cgi-bin/webscr?cmd=_registration-run' target='_blank'>申请商户</a>"
				case 13  echo "<a href='https://www.paypal.com/cn/cgi-bin/webscr?cmd=_registration-run' target='_blank'>申请商户</a>"
				case 14  echo "<a href='https://www.umbpay.com/mer/' target='_blank'>申请商户</a>"
			   End Select %></td>
    </tr>
	<% 
	rs.movenext
	Loop
	End If 
	%>

    <tr>
      <td height="30" colspan="11" >
 <input type="submit" class="btn btn_primary" name="Submit" value=" 批量保存设置 ">
序号越小在前台排在越前面，只有在这里设置启用的支付平台，前台才会显示	   </td>
    </tr>

    </table>
    <div class="pagelist">
    <%= strPageInfo%>
   </div>

<%End Sub 
Sub edit() 
 		Dim Rs 
		id = ChkNumeric(Request.QueryString("id"))
		Set Rs=fycms.actexe("select * from PaymentPlat_fy Where id="&id&"")
		If rs.eof Then
			Call fycms.alert("未知错误","")
 		End If
	  
%>
<form name="form1" method="post" action="?action=Editsave&ID=<%= ID %>">
    <div class="divtable"> 
        <dl>
            <dt>平台名称：</dt>
            <dd>
              <input name="PlatName" type="text" class="Ainput" value="<%= rs("PlatName") %>">    
            </dd>
         </dl>
        
        <dl>
            <dt>备注说明：</dt>
            <dd>
               <textarea name="Notes" cols="70" rows="5"><%= rs("Notes") %></textarea>
             </dd>
         </dl>
        <dl>
            <dt>支付编号：</dt>
            <dd>
               <input name="AccountID" type="text" class="Ainput" value="<%= rs("AccountID") %>" size="60">
             </dd>
         </dl>
        <dl>
            <dt>支付密钥：</dt>
            <dd>
               <input name="MD5Key" type="text" class="Ainput" value="<%= rs("MD5Key") %>" size="60">
             </dd>
         </dl>
        <dl>
            <dt>手续费率：</dt>
            <dd>
               <Input  type="text" class="Ainput" size="6" name="Rate"  value="<%= rs("Rate") %>">%
						<br>
						<input type="checkbox" name="RateByUser" value="<%= rs("RateByUser") %>">
						 手续费由付款人额外支付
             </dd>
         </dl>
        <dl>
            <dt>是否启用:</dt>
            <dd>
               <%if rs("isdisabled")=1 Then%>
		<input type="radio" value="0" name="isdisabled">禁用
		<input type="radio" value="1" name="isdisabled" checked>启用
	<%else%>
		<input type="radio" value="0" name="isdisabled" checked>禁用
		<input type="radio" value="1" name="isdisabled">启用
	<%end if%>
             </dd>
         </dl>
 
            <dl>
            <dt class="vhid">提交：</dt>
            <dd>
				<input type="Submit"  class="btn btn_primary"  name=Submit1 value="保存" />
 				<input class="btn" type="reset" name="Submit2" value="重置">
            </dd>
         </dl>
        
    </div>
    </form>

 
<%end Sub 
CloseConn 
%>

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