<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.Shop.Admin_ShopCouponSetPacketMsg" Codebehind="KS.CouponSetPacketMsg.aspx.cs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="server">
    <script type="text/javascript">
    jQuery(document).ready(function () {
          $("#sendmobile").show();
		  $("#sendemail").hide();
		  $("#sendsite").hide();
		  $("#title").hide();
		});
    function show(id) {

        if (id == 1) {
            if (document.getElementById("<%= CKB1.ClientID%>").checked) {
                $("#sendemail").show();
                $("#title").show();
            }
            else {
                if (document.getElementById("<%= CKB2.ClientID%>").checked == false) {
                    $("#sendemail").hide();
                    $("#title").hide();
                }
                $("#sendemail").hide();
            }
        }
        else if (id == 2) {
            if (document.getElementById("<%= CKB2.ClientID%>").checked) {
                $("#sendsite").show();
                $("#title").show();
            }
            else {
                if (document.getElementById("<%= CKB1.ClientID%>").checked == false) {
                    $("#sendsite").hide();
                    $("#title").hide();
                }
                $("#sendsite").hide();

            }
        }
        else if (id == 5) {
            if (document.getElementById("<%= CKB5.ClientID%>").checked) {
                $("#sendmobile").show();
            }
            else {
                $("#sendmobile").hide();
            }
        } else if (id == 6) {
                if (document.getElementById("<%= CKB6.ClientID%>").checked) {
                   $("#title").show();
                }
                else {
                    $("#title").hide();
                }
            }
    }
        function showType(v) {
            $.ajax({
                type: 'Post',
                dataType: 'text',
                url: '?action=change&messageid=' + v,
                data: {},
                success: function (msg) {
                var msgArr = msg.split('@@@');
                $("#<%=this.txtTitle.ClientID%>").val(msgArr[3]);
                editor1.setContent(msgArr[0]);
                editor2.setContent(msgArr[1]);
                $("#<%=this.TxtSendMobile.ClientID%>").val(msgArr[2]);

            }
            });
    }
		
	</script>    
    <div class="content-area">
<table   width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable">
                      <tr >
                          <td  class="lefttd"  height="30" align="right" style="width: 198px"><strong>待发送优惠券ID：</strong></td>
                         
                          <td class="righttd" style="height: 30px"><asp:TextBox CssClass="textbox" ID="IDS" runat="server" Width="365px" ReadOnly="true"></asp:TextBox>
<span class='tips'>如果不填的话，默认为发送全部<font color="red">（未使用）</font>优惠券的用户</span>
                          </td>
                      </tr>
   <tr>
              <td align="right" class="lefttd" height="30" style="width: 198px" __designer:mapid="84"><strong __designer:mapid="85">模板：</strong></td>
              <td class="righttd" __designer:mapid="86">
                  <asp:DropDownList ID="DropDownList1" runat="server">
                  </asp:DropDownList>
              </td>
                      </tr>

    <tr>
            <td class="lefttd" height="30" align="right" style="width: 198px"><strong>发送方式：</strong></td>
           <td class="righttd">
            
            <asp:CheckBox ID="CKB1" Text="发送Email邮件通知"  runat="server"  onclick="show(1)" /><br />
             <asp:CheckBox ID="CKB2" Text="发送站内短消息通知"  runat="server" onclick="show(2)"/><br />
                 <%
       if (Kesion.Cache.MyCache.GetCacheConfig(32) == "1")
        {  
      %>
              <asp:CheckBox ID="CKB5" Text="发送手机短消息通知"  runat="server"  onclick="show(5)" Checked="true"/><br />
        <%} %>
             <asp:CheckBox ID="CKB6" Text="发送微信信息通知"  runat="server"  onclick="show(6)"/><br />
           </td>
          </tr>
              <tr id="title">
              <td  align="right" class="lefttd" height="30" style="width: 198px" __designer:mapid="4d3">
                  <strong __designer:mapid="4d4">消息标题模板：</strong></td>
              <td class="righttd" __designer:mapid="4d5">
                  <asp:TextBox ID="txtTitle" runat="server" CssClass="textbox"></asp:TextBox>
                  <span class="tips" __designer:mapid="4d7">如：恭喜您在科汛网站获得5元购物红包。</span></td>
                      </tr>
             <tr id="sendemail">
                   <td align="right" class="lefttd" height="30" style="width: 198px">
                       <div>
                           <strong>发放成功发送一封邮件给用户：</strong>
                           <div class="tips" >
                               标签：
                               {$GetSiteName}：网站名称<br />
                               {$UserName}：用户名<br />
                               {$BeginDate}：使用时间<br />
                               {$EndDate}：过期时间<br />
                               {$FaceValue}：面值<br />
                               {$CouponNum}：优惠券号<br />
                           </div>
                          
                       </div>
                   </td>
             <td class="righttd">
                       <asp:TextBox  Height="120" Width="650" ID="TxtRegSuccMail" runat="server"  TextMode="MultiLine"></asp:TextBox>
                 <% Kesion.APPCode.EditorAPI.EchoEditor("editor1", this.TxtRegSuccMail.ClientID, "Basic");%>
                       
                       <br /> Tips:内容留空将不发送！！！
                   </td>
               </tr>
             <tr id="sendsite">
                   <td align="right" class="lefttd" height="30" style="width: 198px">
                       <div>
                           <strong>发放成功发送一条站内给用户：</strong>
                           <div class="tips" >
                               标签：
                               {$GetSiteName}：网站名称<br />
                               {$UserName}：用户名<br />
                               {$BeginDate}：使用时间<br />
                               {$EndDate}：过期时间<br />
                               {$FaceValue}：面值<br />
                               {$CouponNum}：优惠券号<br />
                           </div>
                          
                       </div>
                   </td>
             <td class="righttd">
                       <asp:TextBox  Height="120" Width="650" ID="TxtSendSite" runat="server"  TextMode="MultiLine"></asp:TextBox>
                  <% Kesion.APPCode.EditorAPI.EchoEditor("editor2", this.TxtSendSite.ClientID, "Basic");%>
                      
                       <br /> Tips:内容留空将不发送！！！
                   </td>
               </tr>
             <tr id="sendmobile">
                   <td align="right" class="lefttd" height="30" style="width: 198px">
                       <div>
                           <strong>发放成功发送一条短信给用户：</strong>
                           <div class="tips" >
                               标签：
                              
                               {$UserName}：用户名<br />
                               {$BeginDate}：使用时间<br />
                             
                               {$FaceValue}：面值<br />
                              
                           </div>
                          
                       </div>
                   </td>
             <td class="righttd">
                       <asp:TextBox CssClass="textbox textarea" Height="120" Width="650" ID="TxtSendMobile" runat="server" Columns="60" Rows="6" TextMode="MultiLine"></asp:TextBox>
                       <a class="textarea_min" href="javascript:zoomtextarea(-5,'<%=this.TxtSendMobile.ClientID %>');"></a> 
                       <a class="textarea_max" href="javascript:zoomtextarea(5,'<%=this.TxtSendMobile.ClientID %>');"></a>
                       <br /> Tips:内容留空将不发送！！！
                   </td>
               </tr>

          <tr>
           <td colspan="2" class="lefttd" style="text-align:center">
              <div class="pop-botton">
           		<asp:Button ID="Button1" runat="server" CssClass="button" Text="确定" OnClick="Button1_Click" />
           	  </div>
           </td>
          </tr>

    </table>
  </div>

</asp:Content>
