<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="True" Inherits="Kesion.NET.WebSite.Admin_LogEnSms"  Title="查看短信发送记录" Codebehind="KS.TcSmsLog.aspx.cs" %>
<%@ Import Namespace="Kesion.BLL" %>
<%@ Import Namespace="Kesion.Publics" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">

  <div class="listedit">
      <ul>
        <div class="floatLeft allCheck">
                <label><input name="" type="checkbox" value="" id="selectAll" />全选</label>
         </div>
        <asp:LinkButton ID="delall" runat="server" OnClick="LinkButton1_Click" OnClientClick="return(confirm('此操作不可逆，确定删除全部短信发送记录吗?'))" CssClass="button">删除全部</asp:LinkButton>
        <asp:LinkButton ID="LinkButton2" runat="server" OnClientClick="return(confirm('此操作不可逆，确定删除选中的短信发送记录吗?'))" OnClick="Button2_Click" CssClass="button">删除选中</asp:LinkButton>
        <asp:Button ID="BtnDel" runat="server" Text="执行删除"  CssClass="button" OnClick="BtnDel_Click"/>
      </ul>
  </div>     
  <div class="content-area mt20">

    <asp:Panel ID="Panel1" runat="server">
        <div class="myTitle">
          手机短信发送管理
        </div>
        <div class="quickSearch clearfix">
             <div class="fr liwrap">
             	 <li id='p7' class="fl"><asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click1" CssClass="button">导出到Excel</asp:LinkButton></li>
            	 <li id='p1' class="fl ml15"><asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkButton3_Click" CssClass="button">查看购买记录</asp:LinkButton></li>
             </div>
             <div class="SearchBox fl">
                 <asp:TextBox ID="TxtKeyWord" runat="server" CssClass="textbox" Width="200px" />
                 <asp:DropDownList ID="DrpSearchType" runat="server">
                     <asp:ListItem Value="0">手机号码</asp:ListItem>
                     <asp:ListItem Value="1">发送内容</asp:ListItem>
                     <asp:ListItem Value="2">IP地址</asp:ListItem>
                 </asp:DropDownList>
                 <asp:RadioButtonList ID="RdbStatus" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                      <asp:ListItem Value="0" Selected="True">所有</asp:ListItem>
                      <asp:ListItem Value="1">成功</asp:ListItem>
                      <asp:ListItem Value="2">失败</asp:ListItem>
                 </asp:RadioButtonList>
                 <asp:Button ID="BtnSearch" runat="server" CssClass="button" Text="搜索" OnClick="BtnSearch_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="<input type='checkbox' name='chkall' id='chkall' onclick='CheckAll(this.form);'/>">
                <ItemStyle HorizontalAlign="Center"  Width="30"/>
                <ItemTemplate>
                <input type="checkbox"  name="ids" value="<%#Eval("id") %>" />
                </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="用户">
                <itemstyle horizontalalign="Center" />
                <itemtemplate>
                   <%# string.IsNullOrEmpty(Convert.ToString(Eval("username")))?"-":Eval("username") %>
                </itemtemplate>
            </asp:TemplateField>
                <asp:BoundField DataField="UserIP" HeaderText="操作IP">
                 <ItemStyle Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="adddate" HeaderText="发送时间">
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="mobile" HeaderText="接收手机">
                <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                 <asp:TemplateField HeaderText="状态">
                <itemstyle horizontalalign="center" Height="30px"/>
                <itemtemplate>
                   <%# Eval("IsSuccess").ToString().Equals("1")?"<span style='color:green'>成功</span>":"<span style='color:red'>失败</span>" %>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="发送内容">
                <itemstyle horizontalalign="center" Height="30px"/>
                <itemtemplate>
                    <%# Eval("content") %>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="发送内容长度">
                <itemstyle horizontalalign="center" Height="30px"/>
                <itemtemplate>
                    <%# Eval("ContentLeng") %>
                </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="扣除短信条数">
                <itemstyle horizontalalign="center" Height="30px"/>
                <itemtemplate>
                    <%# Eval("num") %>
                </itemtemplate>
            </asp:TemplateField>
                 <asp:TemplateField HeaderText="返回信息">
                <itemstyle horizontalalign="center"/>
                <itemtemplate>
                    <%# Kesion.Publics.Utils.ClearHtml(Convert.ToString(Eval("remark"))) %>
                </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">10天前</asp:ListItem>
                  <asp:ListItem Value="2">1个月前</asp:ListItem>
                  <asp:ListItem Value="3">2个月前</asp:ListItem>
                  <asp:ListItem Value="4">3个月前</asp:ListItem>
                  <asp:ListItem Value="5">6个月前</asp:ListItem>
                  <asp:ListItem Value="6" Selected="True">1年前</asp:ListItem>
                </asp:RadioButtonList>
                
             </div>
        </div>
              </asp:Panel>
             <asp:Panel ID="Panel2" runat="server" Visible="false"> 
                 <div class="myTitle">手机短信购买记录</div>
                    <asp:Repeater ID="Repeater1" runat="server">
                        <HeaderTemplate>
                    <table width="100%"border="0" cellpadding="1" cellspacing="1" class="CTable">
                           <tr align="center" class="CTitle"> 
				               <td  width="6%" align="center">购买时间</td>
                               <td  width="12%" align="center">购买用户</td>					
                               <td width="12%" align="center">购买数量</td>   
                               <td width="6%"align="center" >备注信息</td>						
                          </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                    <tr onmouseover="this.className=&#39;CtrMouseOver&#39;" onmouseout="this.className=&#39;CtrMouseOut&#39;" onclick="chk(this)">
                            <td align="center"><%# Eval("adddate") %></td>
                            <td align="center"><%# Eval("username") %></td>
                            <td align="center"><%# Eval("num") %></td>
                            <td align="center"><%# Eval("remark") %></td>
                        </tr>
                        </ItemTemplate>
                        <FooterTemplate> 
                           </table>
                        </FooterTemplate>
                    </asp:Repeater> 
        </asp:Panel>
     <KS:Page ID="Page1" runat="server" />
    
</div>

 
</div>

</asp:Content>
