<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin_Log"  Title="查看系统日志" CodeBehind="KS.Log.aspx.cs" %>
<%@ Register TagPrefix="KS" Namespace="Kesion.Controls" Assembly="Kesion.APPCode" %>

<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
    <div class="listedit">
      <ul>
        <asp:LinkButton ID="delall" runat="server" OnClick="LinkButton1_Click" OnClientClick="return(confirm('此操作不可逆，确定删除选中的记录吗?'))" CssClass="button">执行删除</asp:LinkButton>
        <asp:LinkButton ID="LinkBtnOrder" runat="server" OnClick="LinkButton2_Click" CssClass="button">正序查看</asp:LinkButton>
        <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click1" CssClass="button">导出到Excel</asp:LinkButton>
      </ul>
    </div>     
     <div class="content-area mt20">    
     	<div class="myTitle">
            操作日志管理

            <script>
        function SetDate() {
                    var today = new Date();
                    if ($("#showdate").is(":hidden")) {
                        $("#showdate").show();
                        $('#<%=TxtBeginDate.ClientID%>').val(today.getFullYear() + '-' + (today.getMonth() + 1) + '-01');
                            $('#<%=TxtEndDate.ClientID%>').val(today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate());
                        }
                        else {
                            $("#showdate").hide();
                            $('#<%=TxtBeginDate.ClientID%>').val('');
                $('#<%=TxtEndDate.ClientID%>').val('');
                        }
                    }
                    function keyWordFocus() {
                        if (jQuery("#<%=this.KeyWord.ClientID %>").val() == '请输入关键字！') {
                jQuery("#<%=this.KeyWord.ClientID %>").val('');
            }
        }
       function keyWordBlur() {
        if (jQuery("#<%=this.KeyWord.ClientID %>").val() == '') {
                jQuery("#<%=this.KeyWord.ClientID %>").val('请输入关键字！');
            }
        }
       </script>
            <div class="SearchBox fr">
                搜索：
                <asp:DropDownList ID="DrpCondition" runat="server" style="margin-right:8px;">
                    <asp:ListItem Value="1">管理员名称</asp:ListItem>
                    <asp:ListItem Value="2">描述</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox onfocus="keyWordFocus();" onblur="keyWordBlur();" Style="color: #ccc" Text="请输入关键字！" CssClass="textbox" ID="KeyWord" runat="server" Width="180px"></asp:TextBox>
    
                <b onclick="SetDate()" class="link-color">日期范围？</b>
                <span id="showdate" <%if (this.TxtBeginDate.Text == "")
                                      { %>
                    style="display: none" <%} %>>
                    <asp:TextBox ID="TxtBeginDate" placeholder="格式：YYYY-MM-DD" Width="150px" runat="server" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;});" CssClass="textbox Wdate"></asp:TextBox>至
                   <asp:TextBox ID="TxtEndDate" placeholder="格式：YYYY-MM-DD" Width="150px" runat="server" onclick="WdatePicker({dateFmt:&#39;yyyy-MM-dd&#39;});" CssClass="textbox Wdate"></asp:TextBox>
                </span>
                <asp:Button ID="Button1" runat="server" Text="开始搜索" CssClass="button" OnClick="Button1_Click" />
            </div>

        </div>
        <KS:KSGV ID="LogListView"  cssclass="CTable" runat="server" AutoGenerateColumns="False" EmptyDataText="暂无操作日志！"
            OnRowDataBound="LogListView_RowDataBound" Width="100%" GridLines="None"  DataKeyNames="id">
            <Columns>
                <asp:TemplateField HeaderText="序号">
                <ItemStyle HorizontalAlign="Center"  Width="30" />
                <ItemTemplate>
                 <%# Container.DataItemIndex + 1 + (CurrPage - 1) * PageSize%>、   
                </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Username" HeaderText="操作员">
                 <ItemStyle HorizontalAlign="Center" Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="ActionIP" HeaderText="操作IP">
                 <ItemStyle Width="150px" />
                </asp:BoundField>
                <asp:BoundField DataField="actiontime" HeaderText="操作时间">
                <ItemStyle HorizontalAlign="Center" Width="200px" />
                </asp:BoundField>
                 <asp:TemplateField HeaderText="描述">
            <itemstyle horizontalalign="Left" Height="30px"/>
            <itemtemplate>
                <span class="tips"><%# Eval("description") %></span>
            </itemtemplate>
            </asp:TemplateField>
             
            </Columns>
            <HeaderStyle CssClass="CTitle" />
            <EmptyDataRowStyle CssClass="emptycss" />
           
        </KS:KSGV>
       

          <div class="message">
            <div class="Lheight36">
                <strong>特别提醒：</strong> 如果日志表记录太多，影响了系统性能，可以删除一定时间段前的记录以加快速度。
            </div>
            <div class="Lheight36">
                <strong>删除范围：</strong>
                <asp:RadioButtonList ID="RdbDelType" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                <asp:ListItem Value="1">6个月前</asp:ListItem>
                <asp:ListItem Value="2" Selected="True">1年前</asp:ListItem>
                <asp:ListItem Value="3">2年前</asp:ListItem>
                <asp:ListItem Value="4">3年前</asp:ListItem>
                <asp:ListItem Value="5">5年前</asp:ListItem>
                </asp:RadioButtonList>
            </div>
        </div>

     <KS:Page ID="Page1" runat="server" />
     
   </div>  
</asp:Content>
