<%@ Page Language="C#" AutoEventWireup="false" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Controls" Assembly="Hishop.Web.Controls" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Management" Assembly="Hishop.Web.Management" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Validator" Assembly="Hishop.Web.Validator" %>
<%@ Register TagPrefix="Kindeditor" Namespace="kindeditor.Net" Assembly="kindeditor.Net" %>
<%@ Import Namespace="Hishop.SystemServices" %>

<!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">
    <Hishop:HeadContainer ID="HeadContainer1" runat="server" />
    <Hishop:PageTitle ID="PageTitle1" runat="server" />
    <link rel="stylesheet" href="../../utility/validate/pagevalidator.css" type="text/css" />
    <link rel="stylesheet" href="../css/Hishopv5.css" type="text/css" />
    <script type="text/javascript" src="../../utility/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../../utility/validate/pagevalidator.js"></script>
    <script type="text/javascript" src="../js/Hishopv5.js"></script>
    <script type="text/javascript" src="../../utility/plugin.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            pluginContainer = $("#pluginContainer");
            templateRow = $(pluginContainer).find("[rowType=attributeTemplate]");
            dropPlugins = $("#ddlSms");
            selectedNameCtl = $("#smsSettings_txtSelectedName");
            configDataCtl = $("#smsSettings_txtConfigData");

            // 绑定短信类型列表
            $(dropPlugins).append($("<option value=\"\">-请选择发送方式-</option>"));
            $.ajax({
                url: "PluginMessageHandler.aspx?type=SMSSender&action=getlist",
                type: 'GET',
                async: false,
                dataType: 'json',
                timeout: 10000,
                success: function(resultData) {
                    if (resultData.qty == 0)
                        return;

                    $.each(resultData.items, function(i, item) {
                        if (item.FullName == $(selectedNameCtl).val())
                            $(dropPlugins).append("<option value=\"" + item.FullName + "\" selected=\"selected\">" + item.DisplayName + "</option>");
                        else
                            $(dropPlugins).append("<option value=\"" + item.FullName + "\">" + item.DisplayName + "</option>");
                    });
                }
            });

            $(dropPlugins).bind("change", function() { SelectPluginMessage("SMSSender"); });
            //alert("ww");
            if ($(selectedNameCtl).val().length > 0) {
                //alert("dd");
                SelectPluginMessage("SMSSender");
            }
        });

      function TestCheck() {
          if ($(dropPlugins).val() == "") {
              alert("请先选择发送方式并填写配置信息");
              return false;
          }
          return true;
      }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div class="PageTitleArea">
                <div class="PageTitle">
                     <asp:Literal ID="Literal1" runat="server" Text="手机短信配置" ></asp:Literal>
                </div>
                <div style="width: 80%;">
                    <asp:Literal ID="Literal2" runat="server" Text="配置您所获取手机短信平台的信息，系统将使用这些信息自动为客户发送手机短信。" ></asp:Literal>
                </div>
         </div>
    <Hishop:SMSSettings runat="server" ID="smsSettings">
       <SkinTemplate>
         <Hishop:StatusMessage ID="Status" runat="server" Visible="False" />
         <asp:HiddenField runat="server" ID="txtSelectedName" />
         <asp:HiddenField runat="server" ID="txtConfigData" />
         <div class="grdGroupFormList">
            <div class="grdGroupList">
                 <table id="pluginContainer" style="float:none; width:99%" cellspacing="0" cellpadding="0" class="formTableList">
                    <tr>
                       <td class="leftTD">发送方式：</td>
                       <td style="width:160px;" class="rightTD"><select id="ddlSms" name="ddlSms"></select></td>
                       <td class="rightTD"><a href="http://www.92hi.com/duanxin" target="_blank"><strong>点击此处</strong></a> 获取手机短信平台信息</td>
                    </tr>
                    <tr rowtype="attributeTemplate" style="display: none">
                       <td class="leftTD">$Name$：</td>
                       <td class="rightTD">$Input$</td>
                       <td class="rightTD">&nbsp;</td>
                    </tr>
                 </table>
             <div style="padding-left:136px;"><asp:Button ID="btnSaveSMS" runat="server" CssClass="inp_L1" Text="保 存"></asp:Button></div>
            </div>
            <div class="grdGroupList">
                <table class="formTableList" cellspacing="0" cellpadding="0" width="99%"> 
                   <tr>
                      <td class="leftTD">接收手机号：</td>
                      <td class="rightTD"><asp:TextBox ID="txtTestCellPhone" runat="server" CssClass="forminput"></asp:TextBox></td>
                      <td class="rightTD">&nbsp;</td>
                   </tr>
                   <tr>
                      <td class="leftTD">发送内容：</td>
                      <td class="rightTD"><asp:TextBox ID="txtTestSubject" runat="server" CssClass="forminput"></asp:TextBox></td>
                      <td class="rightTD">&nbsp;</td>
                   </tr>
                    <tr>
                      <td class="leftTD">&nbsp;</td>
                      <td class="rightTD"><asp:Button ID="btnTestSend" CssClass="inp_L1" runat="server" OnClientClick="return TestCheck();" Text="测试发送"></asp:Button>
                      <asp:LinkButton runat="server" CssClass="inp_L1" PostBackUrl="~/Admin/Shop/SendMessageTemplets.aspx" ID="lkbtnBack" Text="返回" />
                      </td>
                      <td class="rightTD">&nbsp;</td>
                   </tr>
                </table>
            </div>
         </div>
       </SkinTemplate>
    </Hishop:SMSSettings>
    </div>
    <br />
    <div class="botCopyInfo">
        <hr style="width: 500px;" />
        <Hishop:SiteCopyright ID="SiteCopyright1" runat="server" />
    </div>
    <br />
    <Hishop:ValidatorContainer runat="server" ID="ValidatorContainer" />
    </form>
</body>
</html>
