<%@ Page Title="" Language="C#" MasterPageFile="../BaseMaster.Master" CodeBehind="OfflinePaymentDetail.aspx.cs" Inherits="WAP2P.Web.PC.Admin.Sys.OfflinePaymentDetail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <form action="" method="post" class="auto" onsuccess="parent.$.jPopupEdit.close(true);">
        <div class="m-editbar">
            <input type="submit" class="btn-larger c-priority iconfont" value="&#xe684; 保存" />
            <input type="button" class="btn-larger c-normal iconfont" value="&#xe634; 关闭" onclick="parent.$.jPopupEdit.close();" />
        </div>
        <div class="m-content m-editcontent">
            <table class="m-info" cellpadding="0" cellspacing="0" width="100%">
                <ruson:Space runat="server" ID="edit" Visible="false">
                    <tr>
                        <th>银行名称</th>
                        <td>
                            <ruson:Select runat="server" ID="bankName" data-vtype="must" data-vmsg="请选择银行" TipsText="请选择" FillRequestValue="true"></ruson:Select>
                        </td>
                    </tr>
                    <tr>
                        <th>开户人姓名</th>
                        <td>
                            <input type="text" name="accountName" placeholder="请输入开户时的姓名" class="w250" maxlength="50" value="<%=Model.AccountName.HtmlEncode() %>" data-vtype="must" data-vmsg="请输入开户人姓名" />
                        </td>
                    </tr>
                    <tr>
                        <th>银行卡号</th>
                        <td>
                            <input type="text" id="cardNo" name="cardNo" placeholder="请输入银行卡卡号" class="w250 ui-int" maxlength="23" value="<%=Model.CardNo.HtmlEncode() %>" data-vtype="must" data-vmsg="请输入银行卡号" />
                        </td>
                    </tr>
                    <tr>
                        <th>开户银行所在地</th>
                        <td>
                            <span id="area"></span> 
                           <input type="hidden" class="w250 " name="areaName" id="areaName" />
                        </td>
                    </tr>
                    <tr>
                        <th>支行名称</th>
                        <td><input type="text" name="branch" placeholder="请输入开户行具体名称" maxlength="50" class="w250" value="<%= Model.Branch.HtmlEncode() %>" /></td>
                    </tr>
                </ruson:Space>
                <ruson:Space runat="server" ID="view" Visible="false">
                    <tr>
                        <th>银行名称</th>
                        <td><%=Model.BankName %></td>
                    </tr>
                    <tr>
                        <th>开户人姓名</th>
                        <td><%=Model.AccountName %></td>
                    </tr>
                    <tr>
                        <th>银行卡号</th>
                        <td><%=Model.CardNo %></td>
                    </tr>
                    <tr>
                        <th>开户银行所在地</th>
                        <td><%=Model.AreaName %></td>
                    </tr>
                    <tr>
                        <th>支行名称</th>
                        <td><%=Model.Branch %></td>
                    </tr>
                </ruson:Space>
                <tr>
                    <th>是否启用银行</th>
                    <td><div class="ui-checkbox"><% =HtmlHelper.CheckBox("active", "启用", IsNew ? true : Model.Active) %></div></td>
                </tr>
            </table>
        </div>
    </form>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script src="<% =this.ImportJsCss("../../res/core/scripts/areadata.js") %>"></script>
    <script>
        //开户地区编辑
        $('#area').cascade({ data: areadata, names: ['provinceId', 'cityId', 'areaId'], emptyTip: '全部'});

        $('#area').on('change',function(){
            $('#areaName').val($(this).find('option:selected').text().replace('全部',''));
        });

        $("#cardNo").keypress(function(){
            var text = $(this).val();
            if($(this).val().length >= 4){
                $(this).val(text.replace(/(\d{4})(?=\d)/g,"$1 "));
            }
        });

        setTimeout(function () {
            $('#bankLogoFile').uploadify({
                width: 120,
                height: 32,
                multi: false,
                removeTimeout: 0,
                swf: '../res/uploadify/uploadify.swf?v=<% =CryptoHelper.Random(100000,999999) %>',
                uploader: '../res/uploadify/SwfUpload.aspx?type=image&width=19&height=19',
                buttonClass:'iconfont',
                buttonText: '&#xe629; 上传银行Logo',
                fileTypeExts: '<% =WAP2P.Web.PC.Admin.Res.uploadify.SwfUpload.AllowImages %>',
                formData: {
                    <% =WAP2P.Web.Admin.Membership.CookieName %> : '<% =Request.Cookies[WAP2P.Web.Admin.Membership.CookieName].Value %>'
                },
                onUploadSuccess: function(res, data) {
                    eval('var d = ' + data);
                    if (d.Success) {
                        $('#bankLogo').val(d.Message).trigger('blur');
                        $('#bankLogoResult').html('<img src="' + d.Message + '" />');
                    } else {
                        $.jError(d.Message);
                    }
                }
            });
        }, 10);
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="list" runat="server">
</asp:Content>
