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

<%@ Import Namespace="Whir.Language" %>
<%@ Import Namespace="Whir.Config.Models" %>
<%@ 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="FlowEnable">
                            <%="是否启用：".ToLang()%>
                        </div>
                        <div class="col-md-10 ">
                            <ul class="list" id="text1">
                                <li>
                                    <input type="radio" id="FlowEnable_True" name="FlowEnable" value="1" />
                                    <label for="FlowEnable_True"><%="启用：".ToLang()%></label>
                                </li>
                                <li>
                                    <input type="radio" id="FlowEnable_False" name="FlowEnable" value="0" />
                                    <label for="FlowEnable_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="FlowContent" name="FlowContent" rows="5" maxlength="10000"
                                class="form-control"><%=ToolsConfig.FlowContent%></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-offset-2 col-md-10 ">
                            <input type="hidden" name="_action" value="Save" />
                            <%if (IsCurrentRoleMenuRes("319"))
                                { %>
                            <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.FlowEnable.ToStr().ToLower()%>";
        if (enable == "true") {
            enable = "1";
        } else {
            enable = "0";
        }
        $("[name='FlowEnable'][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>
