<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="Config.aspx.cs" Inherits="OAWeb.SMSEmail.Config" ValidateRequest="false" %>

<%@ Register Src="../UserControls/SMSEmailNav.ascx" TagName="SMSEmailNav" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlace" runat="server">
    <script src="/js/jquery.form.js" type="text/javascript"></script>
    <style type="text/css">
        .tab_content
        {
            border: solid 1px #cccccc;
            border-top: none;
            padding: 10px;
        }
        .table_form .right
        {
            width: 60px;
        }
        .list .table_list th, .list .table_list td
        {
            line-height: 14px;
            height: 14px;
        }
    </style>
    <!--主体左侧-->
    <table id="plc_profile" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td class="main_left">
                <uc1:SMSEmailNav ID="SMSEmailNav1" runat="server" />
            </td>
            <td class="main_center">
                <!--主体-->
                <div class="page_main">
                    <div class="page_content">
                        <div class="tabs">
                            <div class="tab_handles">
                                <span type="1">发货提醒</span> <span type="2">序列号当天到期提醒</span> <span type="3">序列号将到期提醒</span> <span type="5">会员注册通知</span>
                            </div>
                            <div class="tab_contents">
                                <div class="tab_content">
                                    <table cellpadding="0" cellspacing="0" border="0" class="table_form">
                                        <tr>
                                            <td class="title" colspan="2">
                                                <h1>
                                                    短信提醒</h1>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="right">
                                                启用:
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="rdoSMSEnabled" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="0">禁用</asp:ListItem>
                                                    <asp:ListItem Selected="True" Value="1">启用</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="right">
                                                模板:
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlTemp" runat="server">
                                                </asp:DropDownList> <a href="javascript:void(0)"  class="red underline smstemplate">模板设置</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="right">
                                                模板内容:
                                            </td>
                                            <td>
                                                <span class="temp_content"></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="right">
                                                签名:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtSignatory" CssClass="text width200" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="title" colspan="2">
                                                <h1>
                                                    邮件提醒</h1>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="right">
                                                启用:
                                            </td>
                                            <td>
                                                <asp:RadioButtonList ID="rdoEmailEnabled" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
                                                    <asp:ListItem Value="0">禁用</asp:ListItem>
                                                    <asp:ListItem Selected="True" Value="1">启用</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="right">
                                                模板:
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlEmailTemp" runat="server">
                                                </asp:DropDownList> <a href="javascript:void(0)"  class="red underline emailtemplate">模板设置</a>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="right" style=" border-bottom: #345974 1px solid">
                                                发送人:
                                            </td>
                                            <td style=" border-bottom: #345974 1px solid">
                                                <asp:TextBox ID="txtFromName" CssClass="text width200" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <asp:Panel ID="pnlSnExpire" runat="server" Visible="false">
                                            <tr>
                                                <td class="right">
                                                </td>
                                                <td>
                                                    自动加载距离<asp:TextBox ID="txtExpireDay" CssClass="text width40" runat="server"></asp:TextBox>天到期的序列号
                                                </td>
                                            </tr>
                                        </asp:Panel>
                                        <asp:Panel ID="pnlDayExpire" runat="server" Visible="false">
                                            <tr>
                                                <td class="right">
                                                    属性:
                                                </td>
                                                <td>
                                                    <asp:CheckBox ID="chkIsAgent" runat="server" Text="过滤代理商序列号" />
                                                </td>
                                            </tr>
                                        </asp:Panel>
                                        <tr>
                                            <td colspan="2">
                                                <asp:HiddenField ID="hdfTempContent" runat="server" />
                                                <input id="btnSave" type="button" value=" 保 存 " class="btn_77px" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        $(document).ready(function () {
            var smsSelect = $("#<%=ddlTemp.ClientID %> option:selected");
            $(".temp_content").text(smsSelect.attr("content"));
            $("#<%=hdfTempContent.ClientID %>").val(smsSelect.attr("content"));
            $("#<%=ddlTemp.ClientID %>").change(function () {
                var selectContent = $("#<%=ddlTemp.ClientID %> option:selected").attr("content");
                $(".temp_content").text(selectContent);
                $("#<%=hdfTempContent.ClientID %>").val(selectContent);
            })
            $("#btnSave").click(function () { return FormPostAjax("/SMSEmail/Config.aspx?op=Save&type=<%=TempType %>", "ok", CloseReload); });

            var tabs = $(".tab_handles span");
            $.each(tabs, function () {
                if ($(this).attr("type") == "<%=TempType %>")
                    $(this).addClass("current");
            })
            $(".tab_handles span").click(function () {
                window.location.href = "Config.aspx?type=" + $(this).attr("type");
            })

            $(".smstemplate").click(function () { window.location.href = 'SMSTemplate.aspx?&ctl00$contentplace$ddltemptype=<%=TempType %>'; });
            $(".emailtemplate").click(function () { window.location.href = 'MailTemplate.aspx?&ctl00$contentplace$ddltemptype=<%=TempType %>'; });
        })
    </script>
</asp:Content>
