<%@ Page Language="C#" MasterPageFile="~/Admin/MainPage.Master" AutoEventWireup="true"
    Codebehind="PayPal.aspx.cs" Inherits="PPFOR.Admin.Sys.WebConfig.Payments.PayPal" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PPFOR_mainContent" runat="server">
<link href="pay.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>   
<script type="text/javascript">
function $(id)
{
    return (document.all ? document.all[id] : document.getElementById(id)) || false;
} 
function changePaymentRate(isLoadOldValue){
    var obj=$('<%=PPFOR_fixRate.ClientID %>');
    var target1=$('paymentRateRow');   
    var target2=$('paymentFixRow');  
    if(obj && target1){
        target1.style.display = obj.checked ? 'none' : '';        
    }
    if(obj && target2){
        target2.style.display = obj.checked ? '' : 'none';
    }
    var target3=$('<%=PPFOR_paymentRate.ClientID %>');  
    var target4=$('<%=PPFOR_paymentFixMoney.ClientID %>');  
    if(target3)
    {
        if(target1 && target1.style.display=="none"){
            target3.setAttribute('oldValue',target3.value);
            target3.value='';
        }else if(isLoadOldValue){        
            target3.value=target3.getAttribute('oldValue')||'';           
        }
    }
    if(target4)
    {    
        if(target2 && target2.style.display=="none"){
            target4.setAttribute('oldValue',target4.value);
            target4.value='';
        }else if(isLoadOldValue){      
            target4.value=target4.getAttribute('oldValue')||'';           
        }   
    }
}
</script>
    <form action="PayPal.aspx" method="post" id="form1" runat="server">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="fortable">
        <thead>
            <tr>
                <td colspan="2" align="center">支付方式</td>
            </tr>
        </thead>
        <tr>
            <td style="width:15%" align="right">支付方式：</td>
            <td>
                <asp:DropDownList ID="PPFOR_paymentTypeList" OnSelectedIndexChanged="PPFOR_onSelectedIndexChanged" AutoPostBack="true" runat="server"></asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="right">支付方式描述：</td>
            <!--td><asp:Label ID="PPFOR_paymentTypeDescription" runat="server"></asp:Label></td-->
            <td style="margin:0; padding:20px; white-space:normal;">
                <div class="paycon"><img src="images/paypal_logo.gif" width="200" height="50" />
                    <h1>PayPal是更安全便捷的在线收付款方式。PayPal提供的服务使任何人能以任何方式付款，包括通过信用卡、银行账户、买家信用或账户余额付款，同时不会透露用户的财务信息。
                    PayPal已经迅速成为全球领先的在线支付解决方案提供商，在全球范围内拥有超过1.53亿个账户。PayPal可以在全球190个国家和地区以24种货币使用。通过PayPal提供的跨地区、跨币种和跨语言的付款服务，用户可以在全球范围内开展电子商务。</h1>
                    <a href="http://www.paypal.com/" target="_blank"><img src="images/alipaysq.gif" width="119" height="26" border="0" /></a>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
            <td colspan="2" style="background-color: #f2f2f2" align="center"><asp:Label ID="PPFOR_paymentTypeName" runat="server"></asp:Label></td>
        </tr>
        <tr>
          <td style="width:15%" align="right">支付方式名称：</td>
          <td><asp:TextBox ID="PPFOR_paymentName" runat="server" TextMode="SingleLine" Maxlength="50" Width="300px"></asp:TextBox>
              <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" SetFocusOnError="true" ValidationExpression="^[^<>\x22\x27]{2,50}$" Display="Dynamic" ControlToValidate="PPFOR_paymentName"><br />支付方式名称长度必须在2至50个字符之间，且不能包含以下字符之一：<，>，'，"</asp:RegularExpressionValidator>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="true" Display="Dynamic" ControlToValidate="PPFOR_paymentName"><br />支付方式名称不能为空</asp:RequiredFieldValidator>
              <asp:Label ID="PPFOR_paymentID" runat="server" Enabled="false" Visible="false"></asp:Label>
          </td>
        </tr> 
        <tr>
            <td align="right">支持交易货币：</td>
            <td style="white-space:normal;">
                <asp:Label ID="PPFOR_moneys" runat="server"></asp:Label>
            </td>
        </tr>
         <tr>
            <td align="right" style="white-space:normal;">客户号：</td>
            <td>
                <asp:TextBox ID="PPFOR_payPalParterID" runat="server" MaxLength="50"></asp:TextBox>
            </td>
        </tr>
         <tr>
            <td align="right" style="white-space:normal;">私钥：</td>
            <td>
                <asp:TextBox ID="PPFOR_payPalKey" runat="server" MaxLength="50"></asp:TextBox>
            </td>
        </tr>     
        <tr>
            <td align="right">支付手续费设置：</td>
            <td>
                <asp:RadioButton runat="server" ID="PPFOR_noFixRate" GroupName="FixRate" Text="按比例收费" Checked="true" />
                <asp:RadioButton runat="server" ID="PPFOR_fixRate" GroupName="FixRate" Text="固定费用" />
            </td>
        </tr>
        <tr id="paymentRateRow">
            <td align="right">支付手续费：</td>
            <td>
                费率 <asp:TextBox ID="PPFOR_paymentRate" runat="server" Width="50px"  MaxLength="11"></asp:TextBox>% <span style="color:Gray;">说明：顾客将支付订单总金额乘以此费率作为手续费</span>
                <asp:RangeValidator ID="RangeValidator1" runat="server" Display="Dynamic" Type="Double" ControlToValidate="PPFOR_paymentRate" SetFocusOnError="true" MinimumValue="0" MaximumValue="999999.9999"><br />支付手续费费率必须在0至999999.9999之间</asp:RangeValidator>                
            </td>
        </tr>
         <tr id="paymentFixRow">
            <td align="right">支付手续费：</td>
            <td>
                金额 <asp:TextBox ID="PPFOR_paymentFixMoney" runat="server" Width="100px"  MaxLength="11"></asp:TextBox>&nbsp; <span style="color:Gray;">说明：顾客每笔订单需要支付的手续费</span>
                <asp:RangeValidator ID="RangeValidator3" runat="server" Display="Dynamic" Type="Double" ControlToValidate="PPFOR_paymentFixMoney" SetFocusOnError="true" MinimumValue="0" MaximumValue="922337203685477.5807"><br />支付手续费金额必须在0至922337203685477.5807之间</asp:RangeValidator>                
            </td>
        </tr>
        <tr>
            <td align="right">是否启用：</td>
            <td>
               <asp:CheckBox runat="server" ID="PPFOR_isEnable" Text="启用此支付方式" Checked="false" />
            </td>
        </tr>      
        <tr>
            <td align="right">排列顺序：</td>
            <td>
               <asp:TextBox runat="server" ID="PPFOR_order" MaxLength="4" Width="50px"></asp:TextBox>
                <asp:RangeValidator ID="RangeValidator2" runat="server" Display="Dynamic" Type="Integer" ControlToValidate="PPFOR_order" SetFocusOnError="true" MinimumValue="-999" MaximumValue="9999">排列顺序必须为-999至9999之间的整数</asp:RangeValidator>
            </td>
        </tr>
        <tr>
            <td align="right">详细介绍：</td>
            <td>
                <asp:TextBox ID="PPFOR_description" runat="server" TextMode="MultiLine" Height="80px" Width="99%"></asp:TextBox>
                    <script type="text/javascript">
                      var editor = CKEDITOR.replace("<%=PPFOR_description.ClientID%>");       
                    </script>
            </td>
        </tr>     
        <tr>
            <td colspan="2" style="width:100%; height:50px; display:none;" align="center" valign="middle">
                <asp:Button ID="PPFOR_savePayment" CssClass="inputbutton" runat="server" Text="提交" OnClick="PPFOR_savePaymentClick"/>
                <input name="reset" id="reset1" type="reset" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" value="重置" />
                <script type="text/javascript">
                    addButtonArray("<%= PPFOR_savePayment.ClientID %>","reset1");
                </script>
            </td>
        </tr>
        </table>
    </form>
</asp:Content>
