<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeBehind="ModifyInfo.aspx.cs"
    Inherits="PowerEasy.Module.General.WebSite.User.Info.ModifyInfo" EnableEventValidation="false" %>

<!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>
</head>
<body>
    <pe:ExtendedSiteMapPath ID="YourPosition" SiteMapProvider="UserMapProvider" runat="server" />
    <form id="MainForm" runat="server">
    <asp:ScriptManager ID="SmgeRegion" runat="server" EnablePartialRendering="true" />
    <script language="javascript" type="text/javascript">
        function ShowTabs(ID) {
            for (i = 0; i < 8; i++) {
                if (i == ID) {
                    document.getElementById("TabTitle" + i).className = "hover";
                    document.getElementById("Tabs" + i).style.display = "";
                }
                else {
                    document.getElementById("TabTitle" + i).className = "";
                    document.getElementById("Tabs" + i).style.display = "none";
                }
            }
        }
    </script>
    <div class="model_info_sate mtop10">
        <ul>
            <li class="hover" id="TabTitle0"><span><a href="javascript:void(0)" onclick="ShowTabs(0)">
                <asp:Localize ID="Localize1" Text="<%$ Res: User_Info_ModifyInfo_Localize1,会员信息 %>"
                    runat="server" /></a></span></li>
            <li id="TabTitle1"><span><a href="javascript:void(0)" onclick="ShowTabs(1)">
                <asp:Localize ID="Localize2" Text="<%$ Res: User_Info_ModifyInfo_Localize2,联系信息 %>"
                    runat="server" /></a></span></li>
            <li id="TabTitle2"><span><a href="javascript:void(0)" onclick="ShowTabs(2)">
                <asp:Localize ID="Localize3" Text="<%$ Res: User_Info_ModifyInfo_Localize3,个人信息 %>"
                    runat="server" /></a></span></li>
            <li id="TabTitle3"><span><a href="javascript:void(0)" onclick="ShowTabs(3)">
                <asp:Localize ID="Localize4" Text="<%$ Res: User_Info_ModifyInfo_Localize4,业务信息 %>"
                    runat="server" /></a></span></li>
            <li id="TabTitle4" style="<%= IsCompanyShow()%>"><span><a href="javascript:void(0)"
                onclick="ShowTabs(4)">
                <asp:Localize ID="Localize5" Text="<%$ Res: User_Info_ModifyInfo_Localize5,单位信息 %>"
                    runat="server" /></a></span></li>
            <li id="TabTitle5"><span><a href="javascript:void(0)" onclick="ShowTabs(5)">
                <asp:Localize ID="Localize16" Text="<%$ Res: User_UserInfo_UserOption,会员选项 %>" runat="server" /></a></span></li>
            <li id="TabTitle6" style="<%= IsCompanyShow()%>"><span><a href="javascript:void(0)"
                onclick="ShowTabs(6)">
                <asp:Localize ID="Localize200" Text="<%$ Res: User_UserInfo_CompanyOption,企业选项 %>"
                    runat="server" /></a></span></li>
            <li id="TabTitle7"><span><a href="javascript:void(0)" onclick="ShowTabs(7)">修改头像</a></span></li>
        </ul>
    </div>
    <div class="model_info_content">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="width: 100%; padding-left: 0;" valign="top">
                    <table style="width: 100%; table-layout: fixed;" cellspacing="1" cellpadding="0"
                        class="table_style" id="Tabs0">
                        <tr class="first">
                            <td style="width: 16%;" class="ok_tab">
                                <asp:Localize ID="Localize6" Text="<%$ Res: User_Info_ModifyInfo_Localize6,会 员 组： %>"
                                    runat="server" />
                            </td>
                            <td style="width: 38%;">
                                <asp:Label ID="LblUserGroup" runat="server" Text="" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize7" Text="<%$ Res: User_Info_ModifyInfo_Localize7,会员类别： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:Label ID="LblUserType" runat="server" Text="" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize8" Text="<%$ Res: User_Info_ModifyInfo_Localize8,用 户 名： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:Label ID="LblUserName" runat="server" Text="" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize9" Text="<%$ Res: User_Info_ModifyInfo_Localize9,用户密码： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:TextBox ID="TxtUserPassword" runat="server" CssClass="inputxt" Width="200px"
                                    TextMode="Password" />
                                <span style="color: Red">
                                    <asp:Localize ID="Localize10" Text="<%$ Res: User_Info_ModifyInfo_Localize10,不修改请留空！ %>"
                                        runat="server" /></span>
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize11" Text="<%$ Res: User_Info_ModifyInfo_Localize11,提示问题： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:TextBox ID="TxtQuestion" runat="server" CssClass="inputxt" Width="200px" />
                                <pe:RequiredFieldValidator ID="ValrQuestion" ControlToValidate="TxtQuestion" runat="server"
                                    ErrorMessage="<%$ Res: User_Info_ModifyInfo_ValrQuestion,提示问题不能为空！ %>" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize12" Text="<%$ Res: User_Info_ModifyInfo_Localize12,提示答案： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:TextBox ID="TxtAnswer" runat="server" CssClass="inputxt" Width="200px" />
                                <span style="color: Red">
                                    <asp:Localize ID="Localize13" Text="<%$ Res: User_Info_ModifyInfo_Localize13,不修改请留空！ %>"
                                        runat="server" /></span>
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize14" Text="<%$ Res: User_Info_ModifyInfo_Localize14,电子邮件： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:TextBox ID="TxtEmail" runat="server" CssClass="inputxt" Width="200" />
                                <pe:RequiredFieldValidator ID="ValrEmail" ControlToValidate="TxtEmail" runat="server"
                                    ErrorMessage="<%$ Res: User_Info_ModifyInfo_ValrEmail,Email不能为空！ %>" Display="Dynamic" />
                                <pe:RegexValidator ValidateType="Email" ID="Vmail" runat="server" ControlToValidate="TxtEmail"
                                    Display="Dynamic" ErrorMessage="<%$ Res: User_Info_ModifyInfo_Vmail,电子邮件格式不对 %>" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize15" Text="<%$ Res: User_Info_ModifyInfo_Localize15,隐私设定： %>"
                                    runat="server" />
                            </td>
                            <td style="padding: 2px;">
                                <asp:RadioButtonList ID="RadlPrivacySetting" runat="server" RepeatDirection="Horizontal">
                                    <asp:ListItem Selected="True" Value="0" Text="<%$ Res: User_Info_ModifyInfo_ListItem,全部公开 %>"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="<%$ Res: User_Info_ModifyInfo_ListItem2,部分公开 %>"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="<%$ Res: User_Info_ModifyInfo_ListItem3,完全保密 %>"></asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize20" Text="<%$ Res: User_Info_ModifyInfo_Localize20 , 偏爱语言： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:DropDownList ID="DropCultureName" runat="server">
                                </asp:DropDownList>
                                <asp:Label ID="LblCultureName" runat="server" Text="<%$ Res: User_Info_ModifyInfo_LblCultureName , 中文(中国) [zh-CN] (默认) %>"
                                    Visible="false" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize19" Text="<%$ Res: User_Info_ModifyInfo_Localize19,签名信息： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:TextBox ID="TxtSign" runat="server" Height="74px" TextMode="MultiLine" Width="98%" />
                            </td>
                        </tr>
                    </table>
                    <table style="width: 100%; display: none" cellspacing="1" cellpadding="0" class="table_style"
                        id="Tabs1">
                        <tr class="first">
                            <td style="width: 12%;" class="ok_tab">
                                <asp:Localize ID="Localize123" Text="<%$ Res: User_Info_ModifyInfo_Localize123,真实姓名： %>"
                                    runat="server" />
                            </td>
                            <td style="width: 38%;">
                                <asp:TextBox ID="TxtTrueName" runat="server" CssClass="inputxt" Width="150px" />
                            </td>
                            <td style="width: 12%;" class="ok_tab">
                                <asp:Localize ID="Localize23" Text="<%$ Res: User_Info_ModifyInfo_Localize23,称谓： %>"
                                    runat="server" />
                            </td>
                            <td style="width: 38%;">
                                <asp:TextBox ID="TxtTitle" runat="server" CssClass="inputxt" Width="150px" />
                            </td>
                        </tr>
                        <pe:LiaisonInformation ID="LiaisonInformation1" runat="server" />
                    </table>
                    <table style="width: 100%; display: none" cellspacing="1" cellpadding="0" class="table_style"
                        id="Tabs2">
                        <pe:PersonalInformation ID="PersonalInformation1" runat="server" />
                    </table>
                    <table style="width: 100%; display: none" cellspacing="1" cellpadding="0" class="table_style"
                        id="Tabs3">
                        <tr class="first">
                            <td style="width: 15%;" class="ok_tab">
                                <asp:Localize ID="Localize24" Text="<%$ Res: User_Info_ModifyInfo_Localize24,单位名称： %>"
                                    runat="server" />
                            </td>
                            <td style="width: 35%;">
                                <asp:TextBox ID="TxtCompany" runat="server" Width="150px" CssClass="inputxt" />
                            </td>
                            <td style="width: 15%;" class="ok_tab">
                                <asp:Localize ID="Localize25" Text="<%$ Res: User_Info_ModifyInfo_Localize25,所属部门： %>"
                                    runat="server" />
                            </td>
                            <td style="width: 35%;">
                                <asp:TextBox ID="TxtDepartment" runat="server" Width="150px" CssClass="inputxt" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize26" Text="<%$ Res: User_Info_ModifyInfo_Localize26,职位： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:TextBox ID="TxtPosition" runat="server" Width="150px" CssClass="inputxt" />
                            </td>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize27" Text="<%$ Res: User_Info_ModifyInfo_Localize27,负责业务： %>"
                                    runat="server" />
                            </td>
                            <td>
                                <asp:TextBox ID="TxtOperation" runat="server" Width="150px" CssClass="inputxt" />
                            </td>
                        </tr>
                        <tr>
                            <td class="ok_tab">
                                <asp:Localize ID="Localize28" Text="<%$ Res: User_Info_ModifyInfo_Localize28,单位地址： %>"
                                    runat="server" />
                            </td>
                            <td colspan="3">
                                <asp:TextBox ID="TxtCompanyAddress" runat="server" Width="150px" CssClass="inputxt" />
                            </td>
                        </tr>
                    </table>
                    <table style="width: 100%; display: none" cellspacing="1" cellpadding="0" class="table_style"
                        id="Tabs4">
                        <pe:Company ID="Company1" runat="server" Visible="false" />
                    </table>
                    <asp:UpdatePanel ID="UpnlChildProducts" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <table style="width: 100%; table-layout: fixed; display: none" cellspacing="1" cellpadding="0"
                                class="table_style" id="Tabs5">
                                <asp:Repeater ID="RepModel" runat="server" OnItemDataBound="RepModel_OnItemDataBound">
                                    <ItemTemplate>
                                        <tr id='Tab' runat="server">
                                            <td class="ok_tab" style="width: 16%;">
                                                <%# Eval("FieldAlias")%>
                                                ：
                                            </td>
                                            <td>
                                                <pe:FieldControl ID="Field" runat="server" EnableNull='<%# (bool)Eval("EnableNull") %>' ModelId='<%# Eval("ModelId") %>'
                                                    FieldAlias='<%# Eval("FieldAlias")%>' Tips='<%# Eval("Tips") %>' FieldName='<%#Eval("FieldName")%>'
                                                    ControlType='<%# Eval("FieldType") %>' FieldLevel='<%# Eval("FieldLevel") %>'
                                                    Description='<%# Eval("Description")%>' Settings='<%# ((PowerEasy.Module.General.Model.CommonModel.FieldInfo)Container.DataItem).Settings %>'
                                                    Value='<%# Eval("DefaultValue") %>' IsAdminManage="false">
                                                </pe:FieldControl>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <table style="width: 100%; display: none" cellspacing="1" cellpadding="0" class="table_style"
                        id="Tabs6">
                        <asp:UpdatePanel ID="panCompany" runat="server">
                            <ContentTemplate>
                                <asp:Repeater ID="rptCompany" runat="server" OnItemDataBound="rptCompany_OnItemDataBound">
                                    <ItemTemplate>
                                        <tr id='Tab' runat="server">
                                            <td class="ok_tab" style="width: 17%; padding-left: 0px;">
                                                <%# Eval("FieldAlias")%>
                                                ：&nbsp;<br />
                                                <%# Eval("Tips") %>
                                            </td>
                                            <td>
                                                <pe:FieldControl ID="Field" runat="server" EnableNull='<%# (bool)Eval("EnableNull") %>'  ModelId='<%# Eval("ModelId") %>'
                                                    FieldAlias='<%# Eval("FieldAlias")%>' Tips='<%# Eval("Tips") %>' FieldName='<%#Eval("FieldName")%>'
                                                    ControlType='<%# Eval("FieldType") %>' FieldLevel='<%# Eval("FieldLevel") %>'
                                                    Description='<%# Eval("Description")%>' Settings='<%# ((PowerEasy.Module.General.Model.CommonModel.FieldInfo)Container.DataItem).Settings %>'
                                                    Value='<%# Eval("DefaultValue") %>' IsAdminManage="false">
                                                </pe:FieldControl>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </table>
                    <div id="Tabs7" style="display: none">
                        <asp:HiddenField ID="isModifyAvatars" runat="server" Value="false" />
                        <div>
                            <div>
                                <img class="bigAvatar" src="{PE.ViewData.UserBigAvatar/}" alt="{PE.ViewData.UserName/}" />
                                <img class="smallAvatar" src="{PE.ViewData.UserSmallAvatar/}" alt="{PE.ViewData.UserName/}" />
                            </div>
                            <span>
                                <input id="ModifyAvatar" type="button" class="input_button" value="修改头像" /></span>
                        </div>
                        <div id="AvatarModify" style="display: none">
                            <div id="AvatarModifyTitle">
                                <ul id="ModifyType">
                                    <li id="UploadAvatar">上传头像</li>
                                    <li id="CameraSnap" class="on">拍摄头像</li>
                                </ul>
                                <span id="CloseAvatarOverlay">
                                    <img src="<%=SkinPath%>User/Images/AvatarModify_close.jpg" /></span> </div>
                            <div id="AvatarModifyStage">
                                <div id="ImageType">
                                    <div id="ImageStage" style="display: none"></div>
                                    <div id="ImageUpload" style="display: none">
                                        <pe:FileUploadControl ID="ExtenFileUpload" runat="server" IsAdminManage="false" ModuleName="User"
                                            IsAddFileRecord="true" CustomReturnJSFunction="onImageUpload" />
                                    </div>
                                </div>
                                <div id="CameraType"></div>
                            </div>
                        </div>
                        <script type="text/javascript">
                            $("ul#ModifyType").tabs("div.#AvatarModifyStage > div", { tabs: 'li', current: 'on', event: 'click' });
                            var avatarControl = $('#AvatarModify').overlay({ api: true, onClose: function() { $('#ImageStage').html('') }, closeOnClick: false, expose: { closeOnClick: false} });

                            $('#ModifyAvatar,#UploadAvatar').click(function() {
                                if ($('#ImageStage').html() == '')
                                    $('#ImageUpload').show();
                                avatarControl.load();
                            })
                            
                            var onImageUpload = function(url) {
                                $('#ImageUpload').hide();
                                var imageURL = '<%=m_ImgPath %>' + url;
                                $('#ImageStage').html('<embed height="300" align="middle" width="590" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" allowscriptaccess="sameDomain" name="Avatars" quality="high" id="Avatars" flashvars="modeType=photo&amp;photoURL=' + imageURL + '&amp;avatarServer=<%=BasePath %>User/Accessories/AvatarUploadHandler.ashx&amp;userId={PE.ViewData.UserId/}" src="<%=SkinPath %>swf/avatars.swf" />');
                                $('#ImageStage').show();

                            }

                            var onAvatarError = function(msg) {
                                alert('保存头像失败！错误：' + msg);
                            }

                            var onAvatarSaved = function(msg) {
                                $('#<%=isModifyAvatars.ClientID %>').val('true');
                                forceReloadImage();
                                avatarControl.close();
                            }

                            $('#CameraSnap').click(function() {
                                $('#CameraType').html('<embed height="300" align="middle" width="590" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" allowscriptaccess="sameDomain" name="Avatars" quality="high" id="Avatars" flashvars="modeType=camera&amp;&amp;avatarServer=<%=BasePath %>User/Accessories/AvatarUploadHandler.ashx&amp;userId={PE.ViewData.UserId/}" src="<%=SkinPath %>swf/avatars.swf" />')
                            })

                            $('#CloseAvatarOverlay').click(function() {
                                avatarControl.close();
                            })
                            
<% if (RequestStringToLower("AvatarModify") == "true")
{
%>
                            $(document).ready(function(){
                            ShowTabs(7);
                            $('#ImageStage').html('');
                            $('#ModifyAvatar,#UploadAvatar').click();
                            });
<%
}
 %>
                        </script>
                    </div>
                </td>
            </tr>
        </table>
        <div class="ok_bottom">
            <asp:HiddenField ID="HdnContacterID" runat="server" />
            <pe:ExtendedButton ID="EBtnSubmit" Text="<%$ Res: User_Info_ModifyInfo_EBtnSubmit,保存会员信息 %>"
                OnClick="EBtnSubmit_Click" runat="server" IsShowTabs="true" CssClass="submit_button_six" />
        </div>
    </div>
    </form>
</body>
</html>
