<%@ page language="C#" autoeventwireup="true" masterpagefile="~/Manage/I/Default.master" inherits="Manage_I_Guest_TieList, App_Web_5ay3adzg" enableEventValidation="false" viewStateEncryptionMode="Never" %>
<asp:Content ContentPlaceHolderID="head" Runat="Server">
    <title>留言列表</title>
</asp:Content>
<asp:Content  ContentPlaceHolderID="Content" Runat="Server">
    <ZL:ExGridView ID="Egv1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" PageSize="20" OnPageIndexChanging="Egv_PageIndexChanging" IsHoldState="false" OnRowCommand="Lnk_Click" AllowPaging="True" AllowSorting="True" CssClass="table table-striped table-bordered table-hover" EnableTheming="False" EnableModelValidation="True" EmptyDataText="无相关数据">
        <Columns>
		    <asp:TemplateField HeaderStyle-CssClass="egv_chktd">                            
			    <ItemTemplate>
                    <input type="checkbox"  name="idchk" title="" value='<%#Eval("ID") %>' />
			    </ItemTemplate>
		    </asp:TemplateField>
		    <asp:BoundField DataField="ID" HeaderText="ID" HeaderStyle-CssClass="egv_chktd">
		    </asp:BoundField>                                           
		    <asp:TemplateField HeaderText="标题" HeaderStyle-CssClass="egv_title_mid">
			    <ItemTemplate>                                
			       [<a href="TieList.aspx?CateID=<%#Eval("CateID")%>"><%#Eval("CateName") %></a>]&nbsp <a style="<%#Eval("Style") %>" href="GuestTieShow.aspx?CateID=<%# Eval("CateID")%>&GID=<%# Eval("ID")%>"><%# Eval("Title")%></a>
			    </ItemTemplate>
			     <ItemStyle  HorizontalAlign="Left"/>
		    </asp:TemplateField>
            <asp:TemplateField HeaderText="状态">
			    <ItemTemplate>                                
                   <%#GetStatus() %>
			    </ItemTemplate>
			     <ItemStyle  CssClass="tdbg" HorizontalAlign="Center"/>
			     <HeaderStyle Width="6%"/>
		    </asp:TemplateField>
             <asp:TemplateField HeaderText="会员名">
			    <ItemTemplate>                                
                   <a href="javascript:;" onclick="ShowUserInfo(<%# Eval("CUser") %>)" data-toggle="modal" data-target="#userinfo_div" title="点击查看该用户详情"><%#GetUserName(Eval("CUser","{0}")) %></a>
			    </ItemTemplate>
			     <ItemStyle  CssClass="tdbg" HorizontalAlign="Center"/>
			     <HeaderStyle Width="6%"/>
		    </asp:TemplateField>  
		    <asp:TemplateField HeaderText="创建时间" HeaderStyle-CssClass="egv_datetd">
			    <ItemTemplate>                                
			       <%#Eval("CDate") %>
			    </ItemTemplate>
		    </asp:TemplateField>   
		    <asp:TemplateField HeaderText="留言IP">
			    <ItemTemplate>                                
			       <%#Eval("IP").ToString()==""?"无IP地址":Eval("IP") %>
			    </ItemTemplate>
			     <ItemStyle  CssClass="tdbg" HorizontalAlign="Center" />
			     <HeaderStyle Width="12%"/>
		    </asp:TemplateField>
            <asp:TemplateField HeaderText="帖子类型">
                <ItemTemplate>
                    <%#GetMsgPosition() %>
                </ItemTemplate>
                <ItemStyle Width="10%" />
                <HeaderStyle Width="8%" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="点击数" HeaderStyle-CssClass="egv_chktd">
                <ItemTemplate>
                   <%#GetHitCount() %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="操作">                
		    <ItemTemplate>
                <a href="<%#"/"+ZoomLa.BLL.B_Guest_Bar.CreateUrl(2,Convert.ToInt32(Eval("ID"))) %>" target="_blank">前台预览</a>                
			    <asp:LinkButton ID="LinkButton3" runat="server" CommandName="QList" CommandArgument='<%# Eval("ID")+"&CateID="+Eval("CateID") %>'>贴子内容</asp:LinkButton> 
		    </ItemTemplate>
		    <ItemStyle HorizontalAlign="Center"/>
		    <HeaderStyle Width="10%"/>
		    </asp:TemplateField>
	    </Columns>
        <PagerStyle CssClass="tdbg" HorizontalAlign="Center"  />
		<RowStyle Height="24px" HorizontalAlign="Center" />
    </ZL:ExGridView>
<div class="clearbox"></div>           
<table  class="TableWrap" id="sleall">
	<tr>
		<td style="height: 21px">                   
			<asp:Button ID="btndelete" runat="server" CssClass="btn btn-primary" OnClientClick="return confirm('确定要删除选中的项目吗？')" Text="批量删除" OnClick="btndelete_Click" />
            <asp:Button ID="Rels" runat="server" Visible="false" CssClass="btn btn-primary" OnClientClick="return confirm('确定要删除选中的项目吗？')" Text="批量还原" OnClick="Rels_Click"/>
            <asp:Button ID="DelAll" runat="server" Visible="false" CssClass="btn btn-primary" OnClientClick="return delAll()" Text="清空回收站" OnClick="btndelete_Click"/>
            <span id="Opiton_Span" runat="server" visible="false">
            <asp:Button ID="BtnSetTopPosation" runat="server" CssClass="btn btn-primary" Text="置顶" OnClick="BtnSetTopPosation_Click" />
            <asp:Button ID="BtnClosTopPosation" runat="server" CssClass="btn btn-primary" Text="取消置顶" OnClick="BtnClosTopPosation_Click" />
            <asp:Button ID="BtnSetRecomPosation" runat="server" CssClass="btn btn-primary" Text="精华" OnClick="BtnSetRecomPosation_Click" />
            <asp:Button ID="BtnCloseRecomPosation" runat="server" CssClass="btn btn-primary" Text="取消精华" OnClick="BtnCloseRecomPosation_Click" />
            <asp:Button ID="BtnSetDown" runat="server" CssClass="btn btn-primary" Text="沉底" OnClick="BtnSetDown_Click" />
            <asp:Button ID="BtnCloseDown" runat="server" CssClass="btn btn-primary" Text="取消沉底" OnClick="BtnCloseDown_Click" />
            <button type="button" onclick="ShowBarInfo()" class="btn btn-primary">移动版块</button>
            </span>
			<asp:HiddenField ID="HdnCateID" runat="server" />
		</td>
	</tr>                
</table>
    <div style="display:none;" id="barinfo">
        <div class="dropdown drop">
                <button class="btn btn-default dropdown-toggle text-left" type="button" id="dropdown1" runat="server" data-toggle="dropdown" aria-expanded="true">
                    <span id="dr_text">请选择版面</span>
                    <span class="caret pull-right" style="margin-top: 7px;"></span>
                    <asp:HiddenField ID="selected_Hid" runat="server" />
                </button>
                <ul id="PCate_ul" runat="server" class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1"></ul>
            </div>
        <asp:Button ID="MoveBar" CssClass="btn btn-primary drop" runat="server" OnClick="MoveBar_Click" Text="移动" />
    </div>
<style>
th{ text-align:center;}
.drop{display:inline;}
.drop .dropdown-toggle{width:200px;}
</style>
<script type="text/javascript" src="/JS/SelectCheckBox.js"></script>
<script type="text/javascript" src="/JS/ICMS/ZL_Common.js"></script>
<script type="text/javascript" src="/JS/Controls/ZL_Dialog.js"></script>
<script>
    var diag = new ZL_Dialog();
    var BarDiag = new ZL_Dialog();
    function ShowUserInfo(id) {
        diag.url = "../User/UserInfo.aspx?id=" + id;
        diag.title = "用户信息";
        diag.ShowModal();
    }
    function ShowBarInfo() {
        if (checkCH()) {
            BarDiag.width = 300;
            BarDiag.content = "barinfo";
            BarDiag.title = "请选择版面";
            BarDiag.ShowModal();
            $(".barli").click(function () {
                $("#selected_Hid").val($(this).data("barid"));
                $("#dr_text").text($(this).text());
            });
        } else {
            alert("请选择要转移的贴子！");
        }
        
    }
    function delAll() {
        var bl = false;
        if (confirm('确定要删除选中的项目吗？')) {
            $("[name=idchk]").click();
            return true;
        }
        return bl;
    }
    function checkCH() {
        var bl = false;
        $("[name=idchk]").each(function (i, d) {
            bl = d.checked;
            if (bl) {
                return false;
            }
        });
        return bl;
    }
    
</script>
</asp:Content>