<%@ Page Title="" Language="C#" MasterPageFile="~/Master/UserPageMaster.master" CodeBehind="RealName.aspx.cs" Inherits="WAP2P.Web.PC.User.Info.RealName" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <div class="m-container g-zindexmin g-ohide mt20 mb20 m-globalbox m-wholebox">
        <div class="m-title">
            <span><i class="iconfont fs30">&#xe602;</i>  实名认证</span>
        </div>
        <ruson:Space runat="server" ID="passed" Visible="false">
            <p class="mt30">您已经通过了实名验证，无需重复验证。</p>
        </ruson:Space>
        <ruson:Space runat="server" ID="dopass">
            <div class="form-big ml204 mt30">
                <form class="js-auto js-vsum" method="post" action="" data-onsuccess="common.pageTip('<% =PageBase.TipType.Success %>', '实名认证申请提交成功，请耐心等待审核。', '/User/Info/SafeCenter' + gconfig.pageExt, '帐户安全中心');">
                    <ruson:Space runat="server" id="cardUploadDiv" visible="false">
                        <div class="input-big t-uploadid">
                            <span class="uploadid-span">证件照片</span>
                            <div class=" uploadid-photobox mr10">
                                <div class="uploadid-photo">
                                    <img src="/Res/core/Images/bg/id.png" id="cardImg1" />
                                </div>
                                <span class="img"></span>
                                <input type="file" value="上传正面" id="btnCard1" style="display: none;" />
                                <input type="hidden" name="cardPhoto1" id="cardPhoto1" data-vtype="must" data-vmsg="请上传证件正面照片" />
                            </div>
                            <div class="uploadid-photobox">
                                <div class="uploadid-photo">
                                    <img src="/Res/core/Images/bg/id.png" id="cardImg2" />
                                </div>
                                <span class="img"></span>
                                <input type="file" value="上传反面" id="btnCard2" style="display: none;" />
                                <input type="hidden" name="cardPhoto2" id="cardPhoto2" data-vtype="must" data-vmsg="请上传证件反面照片" />
                            </div>
                        </div>
                    </ruson:Space>
                    <div class="input-big g-clear">
                        <label class="leftfont">真实姓名</label>
                        <input type="text" class="text w332" name="realName" maxlength="50" data-vtype="must" data-vmsg="请输入真实姓名。" placeholder="请输入您的真实姓名" />
                        <span class="prompt">请输入与上传证件照中相同的姓名，否则将导致验证不通过。</span>
                    </div>
                    <div class="input-big">
                        <label class="leftfont">证件号</label>
                        <input type="text" class="text w332" name="cardNumber" maxlength="50" data-vtype="custom|ajax" data-vurl="?action=exists" data-vreg="^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$" data-vmsg="请输入正确的身份证号码。|身份证号码已存在。" placeholder="请输入您的身份证证件号" />
                        <span class="prompt">请输入与上传证件照中相同的证件号，否则将导致验证不通过。</span>
                    </div>
                    <div class="btn-submits mt20 ml99">
                        <input type="submit" value="提交相关信息" class="btn-bbord fs16 c-normal w366" data-success-text="提交成功" />
                        <div class="w366"><em class="m-sumtip js-vsum"></em></div>
                    </div>
                </form>
            </div>
        </ruson:Space>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script src="<% =this.ImportJsCss("~/res/uploadify/jquery.uploadify.min.js") %>"></script>
    <script>
        var initUpload = function (n) {
            setTimeout(function () {
                $('#btnCard' + n).uploadify({
                    width: 138,
                    height: 36,
                    multi: false,
                    removeTimeout: 0,
                    swf: '/res/uploadify/uploadify.swf?v=<% =CryptoHelper.Random(100000,999999) %>',
                    uploader: '/res/uploadify/SwfUpload<% =PageExt %>?type=image&width=600',
                    buttonClass:'btn-nobordbig c-normal',
                    buttonText: n == 1 ?  '请上传证件正面' : '请上传证件反面',
                    fileTypeExts: '<% =WAP2P.Web.PC.Res.uploadify.SwfUpload.AllowImages %>',
                    formData: {
                        <% =WAP2P.Web.User.Membership.CookieName %> : '<% =Request.Cookies[WAP2P.Web.User.Membership.CookieName].Value %>'
                    },
                    onUploadSuccess: function(res, data) {
                        eval('var d = ' + data);                     
                        if (d.Success) {
                            $('#cardPhoto' + n).val(d.Message).trigger('blur');
                            $('#cardImg' + n).attr('src', d.Message);
                        } else {
                            alert(d.Message);
                        }
                    }
                });
            }, 10);
        };

        initUpload(1);
        initUpload(2);
    </script>
</asp:Content>
