<%@ Page Title="" Language="C#" MasterPageFile="~/whir_system/master/SystemMasterPage.master"
    AutoEventWireup="true" CodeFile="OnLineCustomer.aspx.cs" Inherits="Whir_System_Plugin_OnLineCustomer_OnLineCustomer"
    ValidateRequest="false" %>

<%@ Import Namespace="Whir.Language" %>
<%@ Import Namespace="Whir.Framework" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="content-wrap">
        <div class="space15">
        </div>
        <div class="panel">
            <div class="panel-heading">
                <%="在线客服".ToLang()%></div>
            <div class="panel-body">
                <div class="form_center">
                    <form id="formEdit" class="form-horizontal" form-url="<%=SysPath%>Handler/Plugin/OnLineCustomer.aspx">
                    <div class="form-group">
                        <div class="col-md-2 text-right" for="OnLineServiceEnable">
                            <%="是否启用：".ToLang()%>
                        </div>
                        <div class="col-md-10 ">
                            <ul class="list" id="text1">
                                <li>
                                    <input type="radio" id="OnLineServiceEnable_True" name="OnLineServiceEnable" value="1" />
                                    <label for="OnLineServiceEnable_True"><%="启用：".ToLang()%></label>
                                </li>
                                <li>
                                    <input type="radio" id="OnLineServiceEnable_False" name="OnLineServiceEnable" value="0" />
                                    <label for="OnLineServiceEnable_False"><%="不启用：".ToLang()%></label>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-2 control-label" for="Enable">
                            <%="引用代码：".ToLang()%>
                        </div>
                        <div class="col-md-10 ">
                            <textarea id="OnLineServicContent" name="OnLineServicContent" rows="5" maxlength="10000" class="form-control"><%=ToolsConfig.OnLineServicContent%></textarea>
                                <span class="note_gray"><%="允许输入多个客服代码，以回车换行隔开".ToLang()%></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-offset-2 col-md-10 ">
                            <input type="hidden" name="_action" value="Save" />
                             <%if (IsCurrentRoleMenuRes("318"))
                               { %>
                            <button type="button" form-action="submit" form-success="refresh" class="btn btn-info btn-block">
                                <%="保存".ToLang()%></button>
                                <%} %>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
     <script type="text/javascript">
         var enable = "<%=ToolsConfig.OnLineServiceEnable.ToStr().ToLower()%>";
         if (enable == "true") {
             enable = "1";
         } else {
             enable = "0";
         }
         $("[name='OnLineServiceEnable'][value='" + enable + "']").prop("checked", "checked");
         $('#formEdit').Validator(null,
             function() {
                 var actionSuccess = $(this).attr("form-success");
                 var $form = $("#formEdit");
                 $form.post({
                     success: function(response) {
                         if (response.Status == true) {
                             whir.toastr.success(response.Message);
                         } else {
                             whir.toastr.error(response.Message);
                         }
                         whir.loading.remove();
                     },
                     error: function(response) {
                         whir.toastr.error(response.Message);
                         whir.loading.remove();
                     }
                 });
                 return false;
             });
     </script>
</asp:Content>
