<%@ page language="C#" autoeventwireup="true" inherits="Credit_Identify_user, WebApp_deploy" %>

<!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>认证资料填写</title>
    <script src="../Skin/CommStyle/js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <link href="../Skin/CommStyle/main.css" rel="stylesheet" type="text/css" />
    <%--<style type="text/css">
        .maintable
        {
            border: 0;
            padding: 0;
            margin: auto;
        }
        .maintable tr th
        {
            text-align: right;
        }
    </style>

    <script type="text/javascript">
        $(function () {
            var email = $("#<%=H_UserEmail.ClientID %>");
            email.blur(function () {
                if (email.val() == "") {
                    $("#lbleamil").text('请输入电子邮件');
                    email.addClass("form_dashed");
                } else {

                    if (email.val().charAt(0) == "." ||
                    email.val().charAt(0) == "@" ||
                    email.val().indexOf('@', 0) == -1 ||
                    email.val().indexOf('.', 0) == -1 ||
                    email.val().lastIndexOf("@") == email.val().length - 1 ||
                   email.val().lastIndexOf(".") == email.val().length - 1) {
                        $("#lbleamil").text('电子邮件格式不正确');
                        email.addClass("form_dashed");
                    } else {
                        $("#lbleamil").text('');
                        email.removeClass("form_dashed");
                    }
                }
            });
            });
   </script>--%>
    <style type="text/css">
        #previewImage_fuIDCardImg
        {
            filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);
        }
        #previewImage_fuIDCardImgBack
        {
            filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <hl:Top ID="Top1" runat="server" />
    <div id="main" class="main">
        <div class="content_style">
            <div id="content" style="margin: 0px auto; width: 760px; padding: 5px;">
                <img height="25" src="../images/member_title_auth_3.gif" width="760" alt="" /></div>
            <br />
            <table class="maintable">
                <tr>
                    <th>
                        <span style="color: Red">*为必填项</span>
                    </th>
                    <td>
                    </td>
                </tr>
                <tr>
                    <th>
                        用户名：
                    </th>
                    <td>
                        <asp:Literal ID="UserName" runat="server" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <%--<b>*</b>--%><span style="color: Red">*</span>用户性别：
                    </th>
                    <td>
                        <asp:RadioButtonList ID="RadioU_UserSex" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Selected="True" Value="0">男</asp:ListItem>
                            <asp:ListItem Value="1">女</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <th>
                        <%--<b>*</b>--%><span style="color: Red">*</span>真实姓名：
                    </th>
                    <td>
                        <asp:TextBox ID="TxtU_TrueName" runat="server" Width="160px" MaxLength="50" CssClass="text p2" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TxtU_TrueName"
                            ErrorMessage="必填项不能为空。" CssClass="tips_wrong" Display="Dynamic" />
                    </td>
                </tr>
                <tr>
                    <th>
                        电子邮箱：
                    </th>
                    <td>
                        <asp:Literal ID="Email" runat="server" />
                        <%--<asp:TextBox ID="Email" ReadOnly="True" runat="server" CssClass="text p2" />--%>
                        <a href="../../Passport/confirm_email.aspx" target="_blank" style="cursor: pointer;
                            color: #ff0000;">(修改邮箱)</a>
                        <%--<span style="cursor: pointer; color: #ff0000;" onclick="javascript:{document.getElementById('divEmail').style.display='';}">
                            [修改邮箱]</span>
                        <div style="display: none" id="divEmail">
                            <div style="float: left;">
                                <asp:TextBox ID="H_UserEmail" runat="server" CssClass="text width180" />
                            </div>
                            <div style="float: left;">
                                <label class="error" id="lbleamil">
                                </label>
                            </div>
                        </div>--%>
                    </td>
                </tr>
                <!-- new add  -->
                <tr>
                    <th>
                        <span style="color: Red"></span>固定电话：
                    </th>
                    <td>
                        <asp:TextBox ID="Txt_HomePhone" runat="server" CssClass="text p2"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="rfv5" runat="server" ErrorMessage="格式错误！" ControlToValidate="Txt_HomePhone"
                            ValidationExpression="^\d{3,4}-\d{7,8}$" Enabled="true"></asp:RegularExpressionValidator><span>固定电话请按“区号-电话号码-分机号码”格式填写<br />
                                如：020-87512750 或 020-87512750-2 </span>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red">*</span>手机号码：
                    </th>
                    <td>
                        <asp:TextBox ID="TxtU_MobilePhone" runat="server" Width="160px" MaxLength="11" CssClass="text p2" />
                        <asp:RequiredFieldValidator ID="rfv3" runat="server" ControlToValidate="TxtU_MobilePhone"
                            ErrorMessage="必填项不能为空。" CssClass="tips_wrong" Display="Dynamic" />
                        <asp:RegularExpressionValidator ID="rex1" runat="server" ControlToValidate="TxtU_MobilePhone"
                            ErrorMessage="手机号码格式不对" ValidationExpression="^((\(\d{3}\))|(\d{3}\-))?13[0-9]\d{8}|15[1234567890]\d{8}|18[1234567890]\d{8}$"
                            CssClass="tips_wrong" Display="Dynamic" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red">*</span>身份证号码：
                    </th>
                    <td>
                        <asp:TextBox ID="TxtU_IDCard" runat="server" Width="160px" MaxLength="18" CssClass="text p2" />
                        <asp:RequiredFieldValidator ID="rfv2" runat="server" ControlToValidate="TxtU_IDCard"
                            ErrorMessage="必填项不能为空。" CssClass="tips_wrong" Display="Dynamic" Style="display: inline;" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="身份证填写不正确"
                            ValidationExpression="\d{17}[\d|X]|\d{15}" ControlToValidate="TxtU_IDCard" CssClass="tips_wrong"
                            Display="Dynamic" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red">*</span>身份证图正面：
                    </th>
                    <td>
                        <asp:FileUpload ID="fuIDCardImg" runat="server" CssClass="text width_normal" />
                        <asp:HiddenField ID="hfIDCardImg" runat="server" Value="" />
                        <br />
                    </td>
                </tr>
                <tr>
                    <th>
                    </th>
                    <td>
                        <img src="../UpLoadFile/IDCardPic/2011.jpg" width="200" height="100" id="IDCardImg"
                            runat="server" alt="" />&nbsp;
                        <div id="previewImage_fuIDCardImg" align="left">
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span style="color: Red">*</span>身份证图背面：
                    </th>
                    <td>
                        <asp:FileUpload ID="fuIDCardImgBack" runat="server" CssClass="text width_normal" />
                        <asp:HiddenField ID="hfIDCardImgBack" runat="server" Value="" />
                        <br />
                    </td>
                </tr>
                <tr>
                    <th>
                    </th>
                    <td>
                        <img src="../UpLoadFile/IDCardPic/b2011.gif" width="200" height="100" id="IDCardImgBack"
                            runat="server" alt="" />&nbsp;
                        <div id="previewImage_fuIDCardImgBack" align="left">
                        </div>
                    </td>
                </tr>
            </table>
            <br />
            <div style="text-align: center; color: Red;">
                <asp:Label ID="err_tips" runat="server" Width="97%" /></div>
            <br />
            <div style="text-align: center; padding: 5px;">
                <input type="button" id="goback" value="<<返回前页" runat="server" onclick="javascript:history.back(-1)" />
                <asp:Button ID="SaveInfo" runat="server" Text="确认无误，将不可修改，提交>>" OnClick="SaveInfo_Click" />
            </div>
        </div>
    </div>
    <hl:Foot ID="Foot1" runat="server" />
    </form>
    <script type="text/javascript">
        function DisplayUserChoose(ctlname) {
            if (document.getElementById("ctl00_ContentPlaceHolder1_RadioU_UserType_1").checked) {
                document.getElementById('company_display').style.display = "";
            }
            else {
                document.getElementById('company_display').style.display = "none";
            }
        }

        var imageObject;
        function ResizeImage(obj, MaxW, MaxH) {
            if (obj != null) imageObject = obj;
            var state = imageObject.readyState;
            if (state != 'complete') {
                setTimeout("ResizeImage(null," + MaxW + "," + MaxH + ")", 50);
                return;
            }
            var oldImage = new Image();
            oldImage.src = imageObject.src;
            var dW = oldImage.width; var dH = oldImage.height;
            if (dW > MaxW || dH > MaxH) {
                a = dW / MaxW; b = dH / MaxH;
                if (b > a) a = b;
                dW = dW / a; dH = dH / a;
            }
            if (dW > 0 && dH > 0) {
                imageObject.width = dW;
                imageObject.height = dH;
            }
        }
        //正面图片
        function ShowUpdatePic(file) {
            //火狐浏览器
            if (navigator.userAgent.indexOf("Firefox") > 0) {
                var img_src = window.URL.createObjectURL(file.files[0]); //file.files[0].getAsDataURL() 
                document.getElementById("previewImage_fuIDCardImg").innerHTML = "预览<br/><img src='" + img_src + "' width='200' height='100' borber=0>";
                document.getElementById("IDCardImg").style.display = "none";
            }
            //IE浏览器
            if (navigator.userAgent.indexOf("MSIE") > 0) {
                var preview_img = document.getElementById("previewImage_fuIDCardImg");
                preview_img.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = file.value;
                preview_img.style.width = "200px";
                preview_img.style.height = "100px";

                //采用滤镜效果生成图片预览
                //                file.select();
                //                var imgSrc = file.value; // document.selection.createRange().text;
                //                document.getElementById("previewImage_fuIDCardImg").innerHTML = "预览<br/><img src='" + file.value + "' width='200' height='100' border='0'>";
                document.getElementById("IDCardImg").style.display = "none";
            }
        }
        //背面图片
        function ShowUpdatePicBack(file) {
            //火狐浏览器
            if (navigator.userAgent.indexOf("Firefox") > 0) {
                var img_src = window.URL.createObjectURL(file.files[0]); //file.files[0].getAsDataURL() 
                document.getElementById("previewImage_fuIDCardImgBack").innerHTML = "预览<br/><img src='" + img_src + "' width='200' height='100' borber=0>";
                document.getElementById("IDCardImgBack").style.display = "none";
            }
            //IE浏览器
            if (navigator.userAgent.indexOf("MSIE") > 0) {
                var preview_img = document.getElementById("previewImage_fuIDCardImgBack");
                preview_img.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = file.value;
                preview_img.style.width = "200px";
                preview_img.style.height = "100px";
                //document.getElementById("previewImage_fuIDCardImgBack").innerHTML = "预览<br/><img src='" + file.value + "' width='200' height='100' border='0'>";
                document.getElementById("IDCardImgBack").style.display = "none";
            }
        }

        //判断图片大小
        function getFileSize() {
            var fileName, filesize;
            fileName = $("#UploadPicPath").val().toString();
            filesize = 120;

            if (document.all) {
                window.oldOnError = window.onerror;
                window.onerror = function (err) {
                    if (err.indexOf('utomation') != -1) {
                        alert('没有访问文件的权限');
                        return true;
                    }
                    else
                        return false;
                };
                var fso = new ActiveXObject('Scripting.FileSystemObject');
                var file = fso.GetFile(fileName);
                window.onerror = window.oldOnError;
                return file.Size <= filesize;
            }
        }
    </script>
</body>
</html>
