<%@ Page Language="c#" Inherits="Web.User.manageaskAnswer" CodeBehind="manageaskAnswer.aspx.cs" %>
<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>Ask and Reply manageMent</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="../Editor/My97DatePicker/WdatePicker.js"></script>
    <!--#include file="../Css/userCssList.htm"-->
    <script type="text/javascript">
        jQuery(function($) { 
        
            /*列表高度*/
            $('.function-bd').height($(window).innerHeight() - 165);

            $(window).resize(function () {
                $('.function-bd').height($(window).innerHeight() - 165);
            });      
            
            $("#btnSave").click(function() {
                //return confirm("您确定要保存列表吗？");
                return GridSelectCheck('newsGrid', true);
            });
            
            $("#btnDel").click(function() {
                return GridSelectCheck('newsGrid',true);
            });
            
            $("#btnMove").click(function() {
            
                if (GridSelectCheck('newsGrid', false)) {
                    //改用弹出层，因为201409发布的最新ghome开始不支持showModalDialog()
                    $.fancybox({
                        'type': 'iframe',
                        'width': 400,
                        'height': 350,
                        'hideOnOverlayClick': false,
                        'href': 'MoveItem.aspx?templateID=<%=TemplateID %>&menuID=<%=menuId %>'
                    });
                }
                return false;
            });

        });
        
        //栏目移动确认小页面调用本方法 
        function CallMoveSubmit()
        {
            $("#btnMoveSave").click();
        }
    
    	function showDetail(pkId)
    	{
    	w=400;
    	h=370;
    	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no';
    	window.open("../MessageBoardDetail.aspx?pkId="+pkId ,"" ,settings);
    	
    	}
    	//选中背景特效
        $(function(){
            $('.txt-c input').click(function(){
	            $(this).parents('tr').toggleClass('active');
            })
            
            $('.title.txt-c input').click(function(){
	            
	            if($('.list-table tr:first').hasClass('active')){
		            $('.list-table tr').addClass('active');
	            }else{
		            $('.list-table tr').removeClass('active');
	            }
            })
            
            $('.list-table select').change(function(){
	            //背景选中
	            if($(this).parents('tr').hasClass('active')){
		            
	            }else{
		            $(this).parents('tr').toggleClass('active');
	            }
	            
	            //复选框选中
	            var checkbox = $(this).parents("tr").find("input");
                for (var i = 0; i < checkbox.length; i++) {
                    if (checkbox[i].type == 'checkbox') {
                        checkbox[i].checked = true;
                    }
                }
                
            })
        })
    </script>
</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div class="list-func-box func-box" style="min-width:1200px;">
        <div class="hd">
            <div class="breadcrumb">
                <asp:PlaceHolder ID="placeHead" runat="server"></asp:PlaceHolder>
            </div>
            <!--/breadcrumb-->
            <div class="user-service">
                <a class="help" href="#" title="帮助：【回复审核】字段中，待审和未回复在前台页面上均显示未回复。">帮助</a></div>
            <!--/user-service-->
        </div>
        <div class="bd">
            <div class="function-hd">
                <div class="search-box fr">
                编号：<asp:TextBox ID="txtID" runat="server" CssClass="input-txt" Width="45"></asp:TextBox>
                    留言：<asp:DropDownList ID="DDLpass" runat="server" CssClass="drop-txt" Width="70">
                    <asp:ListItem Text="<全部>" Value=""></asp:ListItem>
                    <asp:ListItem Text="待审" Value="0"></asp:ListItem>
                    <asp:ListItem Text="通过" Value="1"></asp:ListItem>
                    <asp:ListItem Text="不通过" Value="2"></asp:ListItem>
                    </asp:DropDownList>
                    回复：<asp:DropDownList ID="DDLrepass" runat="server" CssClass="drop-txt" Width="70">
                    <asp:ListItem Text="<全部>" Value=""></asp:ListItem>
                    <asp:ListItem Text="待审" Value="0"></asp:ListItem>
                    <asp:ListItem Text="通过" Value="1"></asp:ListItem>
                    <asp:ListItem Text="未回复" Value="2"></asp:ListItem>
                    </asp:DropDownList>
                    时间：<asp:TextBox ID="txtBegintime" runat="server" CssClass="input-txt" Width="80" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"></asp:TextBox>至<asp:TextBox ID="txtEndtime" runat="server" CssClass="input-txt" Width="80" MaxLength="19" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="btn1 btn" Width="60" OnClick="Btn_Click"/>&nbsp;
                        <asp:Button ID ="btnExport" runat="server" Text="导出" CssClass="btn1 btn" Width="60" OnClick="Btn_Click"/>
                </div>
                <!--/search-box-->
                <div class="action-field">
                    <asp:Button ID="btnSave" class="btn" runat="server" Text="保 存" OnClick="Btn_Click"></asp:Button>
                    &nbsp;
                    <asp:Button ID="btnAdd" class="btn" runat="server" Text="添 加" OnClick="Btn_Click"></asp:Button>
                    &nbsp;
                    <asp:Button ID="btnMove" runat="server" class="btn" Text="移 动" ></asp:Button>
                    &nbsp;
                    <asp:Button ID="btnDel" class="btn" runat="server" Text="删 除" OnClick="Btn_Click"></asp:Button>
                    &nbsp;
                    <asp:HiddenField ID="MoveTargetBigClassID" runat="server" />
                    <asp:HiddenField ID="MoveTargetMenuID" runat="server" />
                    <asp:Button ID="btnMoveSave" class="btn" runat="server" Text="MoveSave" OnClick="Btn_Click" Style="display: none"></asp:Button>
                </div>
                <!--/action-field-->
            </div>
            <div class="function-bd" style="height: 580px; overflow: auto;">
            <!--[if lte IE 7]><div style="zoom:1"><![endif]-->
            <asp:HiddenField ID="hfidstr" runat="server" />
            <asp:HiddenField ID="hftitlestr" runat="server" />
            <asp:DataGrid ID="newsGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False" 
                class="list-table" onitemcommand="newsGrid_ItemCommand">
                <Columns>
                    <asp:TemplateColumn HeaderStyle-CssClass="title txt-c" ItemStyle-CssClass="txt-c" ItemStyle-Width="36px">
                            <HeaderTemplate>
                                <asp:CheckBox ID="cbAll" Text="" runat="server" onclick="GridSelectAll('newsGrid',this.checked)" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbthis" runat="server" Text=""></asp:CheckBox>
                            </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn DataField="pkId" HeaderText="编号" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="标题" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:HyperLink ID="intactTitle" onclick='<%#"javascript:showDetail("+DataBinder.Eval(Container, "DataItem.pkId")+")"%>' runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.title") %>' NavigateUrl="javascript:#">
                            </asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="留言人" HeaderStyle-CssClass="title">
                            <ItemTemplate>
                                <a href="#"><asp:Label ID="info" runat="server" Text='<%#Eval("author") %>' ToolTip='<%# "发布IP："+ Eval("updateIp") %>'></asp:Label></a>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="留言时间" HeaderStyle-CssClass="title">
                            <ItemTemplate>
                                <a href="#"><asp:Label ID="lbtime" runat="server" Text='<%# Eval("updateTime", "{0:yyyy-M-d}") %>' ToolTip='<%# Eval("updateTime") %>'></asp:Label></a>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="保密" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="isSecrecy" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.isSecrecy") %>' Enabled="False">
                                <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                <asp:ListItem Value="1">保密</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn HeaderText="点击量" DataField="click" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="固顶" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="isTop" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.isTop") %>'>
                                <asp:ListItem Value="0" Selected="True">取消</asp:ListItem>
                                <asp:ListItem Value="1">固顶</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="留言审核" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="pass" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.checked") %>'>
                                <asp:ListItem Value="0" Selected="True">待审</asp:ListItem>
                                <asp:ListItem Value="1">通过</asp:ListItem>
                                <asp:ListItem Value="2">不通过</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="显示等级" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="gradeDrop" runat="server" DataSource="<%# dv %>" DataTextField="name" DataValueField="pkId">
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="浏览权限" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="gate" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.gate") %>'>
                                <asp:ListItem Value="0" Selected="True">无限制</asp:ListItem>
                                <asp:ListItem Value="1">仅内网可见</asp:ListItem>
                                <asp:ListItem Value="2">仅登录可见</asp:ListItem>
                                <asp:ListItem Value="3">内网或登录可见</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <%--<asp:BoundColumn HeaderText="回复状态" HeaderStyle-CssClass="title"></asp:BoundColumn>--%>
                    <asp:TemplateColumn HeaderText="回复审核" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="repass" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.reAudit") %>'>
                                <asp:ListItem Value="0" Selected="True">待审</asp:ListItem>
                                <asp:ListItem Value="1">通过</asp:ListItem>
                                <asp:ListItem Value="2">未回复</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="管理" HeaderStyle-CssClass="title" ItemStyle-CssClass="td-a">
                        <ItemTemplate>
                            <asp:LinkButton ID="edit" runat="server" CommandName="edit">编辑</asp:LinkButton>&nbsp;
                            <asp:LinkButton ID="forward" runat="server" CommandName="forward" Visible="<%#(IsForward == true) ? true :false %>">转发</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn Visible="False" DataField="grade" HeaderText="等级"></asp:BoundColumn>
<%--                    <asp:TemplateColumn Visible="False">
                        <ItemTemplate>
                                <asp:Label ID="ContentLabel" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.retime") %>'>
                                </asp:Label>
                        </ItemTemplate>
                    </asp:TemplateColumn>--%>
                </Columns>
            </asp:DataGrid>
            <!--[if lte IE 7]></div><![endif]-->
            </div>
        </div>
        <!--/bd-->
        <div class="ft">
            <div class="pagination">
                <asp:Label ID="showPage" runat="server"></asp:Label>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
