<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Gobuy.aspx.cs" Inherits="RM.Web.Mall.Alipay.Gobuy" %>

<!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 runat="server">

    <title><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("gobuy_zxcz")%></title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <script type="text/javascript">
        var browser = {
            versions: function () {
                var u = navigator.userAgent, app = navigator.appVersion;
                return {         //移动终端浏览器版本信息
                    trident: u.indexOf('Trident') > -1, //IE内核
                    presto: u.indexOf('Presto') > -1, //opera内核
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
                    iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
                    iPad: u.indexOf('iPad') > -1, //是否iPad
                    wp: u.indexOf('IEMobile') > -1, //是否wp
                    symbianos: !!u.match(/SymbianOS.*/), //是否SymbianOS
                    webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
                };
            } (),
            language: (navigator.browserLanguage || navigator.language).toLowerCase()
        }

        window.onload = function () {
            if (browser.versions.mobile || browser.versions.ios || browser.versions.android || browser.versions.symbianos || browser.versions.wp) {//手机支付
                window.location.href = "/Mall/Alipay/Gobuy_mobile.aspx";
            }

            $("input[name=bankype]").change(function () {
                var banktype = $("input[name=bankype]:checked").val();
                $("#WIDdefaultbank").val(banktype);
            });

            $("input[name=paytype]").change(function () {
                var paytype = $("input[name=paytype]:checked").val();
                if (paytype == "paypal") {
                    $("#paytype2").show();
                    $("#paytype1").hide();
                    $("#Form1").attr("action","<%=ConfigurationManager.AppSettings["PAYPAL_REDIRECT_URL"].ToString() %>");
                    $("#bankypelist").hide();
                } else if (paytype == "alipay"){
                    $("#paytype2").hide();
                    $("#paytype1").show();
                    $("#Form1").attr("action","");
                    $("#bankypelist").hide();
                }else if (paytype == "yeepay") {
                    $("#paytype2").show();
                    $("#paytype1").hide();
                    $("#Form1").attr("action","Req_yeepay.aspx");
                    $("#bankypelist").hide();
                }else{
                    $("#paytype2").hide();
                    $("#paytype1").show();
                    $("#bankypelist").show();                    
                }
            });
        }        

    </script>

    <style type="text/css">
    label{ display:block;width:160px; cursor:pointer; vertical-align:middle;height:36px; line-height:30px; float:left;}
	label input{float:left;vertical-align:middle;margin-top:13px;}
	label span{border:1px solid #ddd; display:block;}
    .ico{background-image:url("combo.png");height:36px; line-height:30px;width:125px; overflow:hidden;}
    .ICBC{background-position:0px -685px; background-repeat:no-repeat;}
	.ABC{background-position:0px 0px; background-repeat:no-repeat;}
	.CCB{background-position:0px -215px; background-repeat:no-repeat;}
	.SPDB{background-position:0px -1043px; background-repeat:no-repeat;}
	.BOCB2C{background-position:0px -37px; background-repeat:no-repeat;}
	.CMB{background-position:0px -361px; background-repeat:no-repeat;}
	.CIB{background-position:0px -291px; background-repeat:no-repeat;}
	.GDB{background-position:0px -579px; background-repeat:no-repeat;}
	.CITIC{background-position:0px -321px; background-repeat:no-repeat;}
	.HZCBB2C{background-position:0px -649px; background-repeat:no-repeat;}
	.SHBANK{background-position:0px -973px; background-repeat:no-repeat;}
	.NBBANK{background-position:0px -900px; background-repeat:no-repeat;}	
	.SPABANK{background-position:0px -1008px; background-repeat:no-repeat;}
	.POSTGC{background-position:0px -935px; background-repeat:no-repeat;}
	
	table{ border:1px solid #ddd; padding:5px 0; }	
	table tr{ border:1px solid #ddd; padding:5px 0; }	
	table th{ border-bottom:1px solid #ddd; border-right:1px solid #ddd; padding:5px 10px; }
		table td{ border-bottom:1px solid #ddd; padding:5px; }
	/*
	table tr,td,th{ border:1px solid #ddd; padding:5px; }	
    */
    </style>
</head>
<body>
<div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("gobuy_zxcz")%>
        </div>
    </div>
    
    <div class="buymain" style=" margin:10px;">
    	<div style="font-size:18px; border-bottom:1px solid #69B3F2; color:blue; padding:5px; margin-bottom:10px;"><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("gobuy_fkfs")%>：</div>        
        <table cellpadding="0" cellspacing="0" >
        <form id="Form1" runat="server" method="post">
        <tr class="sdf">        
        <th><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("gobuy_zfpt")%></th>
        <td>
        <input type="radio" name="paytype" id="alipay" value="alipay" runat="server" />
        <img src="alipay.gif" alt="支付宝" width="135" height="45" />
        <input type="radio" name="paytype" id="paypal" value="paypal" runat="server"/>
        <img src="paypal.png" alt="贝宝" width="135" height="45" />
        <input type="radio" name="paytype" id="wyzf" value="wyzf" runat="server"/>网银支付
        <input type="radio" name="paytype" id="yeepay" value="yeepay" runat="server"/>
        <img src="yeepay.png" alt="易宝支付" width="135" height="45" />
        </td>
        </tr>        
        <tr id="bankypelist" style="display:none;"  >
        <th><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("gobuy_wyzf")%></th>
        <td >
        <!--
        <input type="radio" name="bankype" value="ICBCBTB"/>中国工商银行
        <input type="radio" name="bankype" value="ABCBTB" />中国农业银行
        <input type="radio" name="bankype" value="CCBBTB"/>中国建设银行
        <input type="radio" name="bankype" value="BOCBTB"/>中国银行
        <input type="radio" name="bankype" value="CMBBTB"/>招商银行
        <input type="radio" name="bankype" value="SPDBB2B"/>上海浦东发展银行
        -->
        <label>
        <input type="radio" name="bankype" id="ICBCBTB" value="ICBCB2C" runat="server"/>
        <span title="中国工商银行" class="ico ICBC"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="ABC"/>
        <span title="中国农业银行" class="ico ABC"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="CCB"/>
        <span title="中国建设银行" class="ico CCB"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="SPDB"/>
        <span title="上海浦东发展银行" class="ico SPDB"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="BOCB2C" />
        <span title="中国银行" class="ico BOCB2C"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="CMB"/> 
        <span title="招商银行" class="ico CMB"></span>    
        </label>   
        <br /><br /><br />

		<label>
        <input type="radio" name="bankype" value="CIB" />
        <span title="兴业银行" class="ico CIB"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="GDB"/>
        <span title="广发银行" class="ico GDB"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="CITIC"/>
        <span title="中信银行" class="ico CITIC"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="HZCBB2C"/>
        <span title="杭州银行" class="ico HZCBB2C"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="SHBANK"/>
        <span title="上海银行" class="ico SHBANK"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="NBBANK"/>
        <span title="宁波银行" class="ico NBBANK"></span>
        </label>
        <br /><br /><br />

		<label>
        <input type="radio" name="bankype" value="SPABANK" />
        <span title="平安银行" class="ico SPABANK"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="POSTGC"/>
        <span title="中国邮政储蓄银行" class="ico POSTGC"></span>
        </label>

        <!--<label>
        <input type="radio" name="bankype" value="abc1003"/>
        <span title="visa" class="ico SHBANK"></span>
        </label>
        <label>
        <input type="radio" name="bankype" value="abc1004"/>
        <span title="master" class="ico SHBANK"></span>
        </label>-->
        
        </td>
        </tr>
        <tr id="paytype1" >
        <th><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("gobuy_fkje")%></th>        
        <td><asp:TextBox ID="WIDtotal_fee" name="WIDtotal_fee" runat="server"></asp:TextBox><asp:Button ID="BtnAlipay" name="BtnAlipay" class="new-btn-login" Text="" Style="text-align: center;"  runat="server" OnClick="BtnAlipay_Click"/></td>
        </tr>
        
        <tr id="paytype2"  style="display:none;" >
        <th><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("gobuy_fkje")%></th>        
        <td>
        <input type="text" name="oid" id="oid" runat="server" style="display:none;"  />
        <input type="text" runat="server" id="mail" value="payment@qsschool.com.au" style="display:none;"/>
        <input type="text" name="WIDdefaultbank" id="WIDdefaultbank" runat="server" value="ICBCB2C" style="display:none;"/>        
        <input type="hidden" name="cmd" value="_xclick">
        <input type="hidden" name="business" value="<%=paypalUsername %>">
        <input type="hidden" name="item_name" value="SIGMA SD1000">
<input type="text" name="amount" id="amount" value="" runat="server">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="invoice" value="<%=oidStr %>">
<input type="hidden" name="return"value="http://58.96.183.147:801/b.aspx">
<input type="hidden" name="notify_url" value="<%=returnAuthority %>/Mall/Alipay/notify_url_paypal.aspx">

<input type="submit" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Ques_dete") %>" />
</td></tr>
</form>
        </table>
    </div>

</body>
</html>
