<%@ Page Language="c#" Inherits="Web.User.auditMore" CodeBehind="auditMore.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>投稿批量审核</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/userCssList.htm" -->

    <script language="javascript" type="text/javascript">

        function openViewWin(flag) {
            //arr = window.open("viewAuditRemark.aspx?pkId="+flag +"","查看审核批注","scrollbars=yes,width=300,height=190");
            $.fancybox({
                'width': 400,
                'height': 200,
                'hideOnOverlayClick': false,
                'transitionIn': 'elastic',
                'transitionOut': 'fade',
                'type': 'iframe',
                'padding': '0',
                'href': 'viewAuditRemark.aspx?pkId=' + flag
            });
        }


        //审核状态判断
        function call(sid) {
            //        for (var i = 0; i < 4; i++) {
            //            if (document.getElementById("StateRadioButtonList_" + i).checked && document.getElementById("StateRadioButtonList_" + i).value == 1) {
            //            
            //                eval("submenu1.style.display=\"\";");
            //                eval("submenu2.style.display=\"\";");
            //                break;
            //            }
            //            else {
            //                eval("submenu1.style.display=\"none\";");
            //                eval("submenu2.style.display=\"none\";");

            //            }
            //        }

            try {
                for (var i = 0; i < 5; i++) {

                    if (document.getElementById("StateRadioButtonList_" + i).checked && document.getElementById("StateRadioButtonList_" + i).value == 1) {
                        eval("submenu1.style.display=\"\";");
                        eval("submenu2.style.display=\"\";");
                        eval("submenu3.style.display=\"none\";");
                        eval("submenu4.style.display=\"none\";");

                        break;
                    }
                    else if (document.getElementById("StateRadioButtonList_" + i).checked && (document.getElementById("StateRadioButtonList_" + i).value == 4 || document.getElementById("StateRadioButtonList_" + i).value == 3)) {

                        eval("submenu1.style.display=\"none\";");
                        eval("submenu2.style.display=\"none\";");

                        eval("submenu3.style.display=\"\";");
                        eval("submenu4.style.display=\"\";");
                        break;
                    }
                    else {

                        eval("submenu1.style.display=\"none\";");
                        eval("submenu2.style.display=\"none\";");
                        eval("submenu3.style.display=\"none\";");
                        eval("submenu4.style.display=\"none\";");

                    }
                }
            }
            catch (e) { }
        }

        //全选
        function checkall(check) {
            var theBox = check;
            xState = theBox.checked;
            elm = theBox.form.elements;
            for (i = 0; i < elm.length; i++) {
                if (elm[i].type == "checkbox" && elm[i].id != theBox.id) {
                    if (elm[i].checked != xState)
                        elm[i].click();
                }
            }
        }

        //在保存之前,验证输入是否正确；将有效日期值转换成相应的有效天数
        function checkAll() {
            //验证
            try {
                for (var i = 0; i < 5; i++) {

                    if (document.getElementById("StateRadioButtonList_" + i).checked && (document.getElementById("StateRadioButtonList_" + i).value == 4 || document.getElementById("StateRadioButtonList_" + i).value == 3)) {
                        var remarktxt = document.getElementById("<%= RemarkTextBox.ClientID%>").value;
                    if (remarktxt == "" || remarktxt == null) {
                        alert("退稿或锁定退稿时，请添加原因批注！");
                        return false;
                    }
                }
            }
        }
        catch (e) { }
        return true;
    }
    </script>

</head>
<body>
    <form method="post" runat="server">
        <div class="list-func-box func-box">
            <div class="hd b">
                <!--/breadcrumb-->
                <div class="user-service">
                    <a class="help" href="#" title="帮助：此页可通过多选方式完成批量审核">帮助</a>
                </div>
                <!--/user-service-->
            </div>
            <div class="bd">
                <div class="function-hd">
                    <div class="action-field">
                        批量审核列表:
                    </div>
                </div>
                <div class="function-bd" style="height: 320px; overflow: auto;">
                    <asp:DataGrid ID="newsGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False" CssClass="list-table" OnItemCommand="newsGrid_ItemCommand">
                        <Columns>
                            <asp:BoundColumn Visible="False" DataField="pkId" HeaderText="ID号" HeaderStyle-CssClass="title"></asp:BoundColumn>
                            <asp:TemplateColumn HeaderText="选中" HeaderStyle-CssClass="title">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chk" runat="server" />
                                </ItemTemplate>
                                <HeaderTemplate>
                                    <asp:CheckBox ID="CheckAll" runat="server" onclick="checkall(this)" Text="" TextAlign="Left" />
                                </HeaderTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn HeaderText="标题" HeaderStyle-CssClass="title">
                                <ItemTemplate>
                                    <asp:HyperLink ID="intactTitle" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.intactTitle") %>'
                                        Target="_blank" NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.pkId", "../ShwContribute.aspx?pkId={0}") %>'> 
                                    </asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="userName" HeaderText="发布人账号" HeaderStyle-CssClass="title"></asp:BoundColumn>
                            <asp:TemplateColumn HeaderText="发布人昵称" HeaderStyle-CssClass="title">
                                <ItemTemplate>
                                    <a href="#">
                                        <asp:Label ID="info" runat="server" Text='<%#Eval("fullName") %>' 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="state" runat="server" Visible="False">
                                    </asp:DropDownList>
                                    <asp:Label ID="LabelState" runat="server"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn HeaderText="投稿栏目" HeaderStyle-CssClass="title">
                                <ItemTemplate>
                                    <asp:Label ID="lbBCName" runat="server"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:TemplateColumn HeaderText="管理" HeaderStyle-CssClass="title" ItemStyle-CssClass="td-a">
                                <ItemTemplate>
                                    &nbsp;
                            <asp:LinkButton ID="audit" runat="server" CommandName="audit">审核</asp:LinkButton>
                                    &nbsp;
                                </ItemTemplate>
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="state" HeaderText="状态" Visible="False" HeaderStyle-CssClass="title"></asp:BoundColumn>
                            <asp:BoundColumn DataField="contributeId" HeaderText="" Visible="False"></asp:BoundColumn>
                        </Columns>
                    </asp:DataGrid>
                </div>
            </div>
            <div class="ft">
                <div class="pagination">
                    <asp:Label ID="showPage" runat="server"></asp:Label>
                </div>
            </div>
            <table class="edit-table" id="Table1">
                <tr>
                    <td colspan="8">
                        <div class="more-edit">
                            <div class="more-edit-fn">
                                <span class="fn-fl blue">审核状态：</span>
                                <asp:RadioButtonList ID="StateRadioButtonList" CssClass="fn-fl blue" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" onclick="javascript:call(4)">
                                </asp:RadioButtonList>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr id="submenu1" style="display: none;">
                    <th>所属专题：
                    </th>
                    <td>
                        <asp:DropDownList ID="special1" runat="server" DataTextField="name" DataValueField="pkId" class="drop-txt">
                        </asp:DropDownList>
                    </td>
                    <th>部门：
                    </th>
                    <td>
                        <asp:DropDownList ID="department" runat="server" DataTextField="name" DataValueField="pkId" class="drop-txt">
                        </asp:DropDownList>
                    </td>
                    <th>浏览权限：
                    </th>
                    <td>
                        <asp:DropDownList ID="gate" runat="server" class="drop-txt">
                            <asp:ListItem Value="0">无限制</asp:ListItem>
                            <asp:ListItem Value="1">仅内网可见</asp:ListItem>
                            <asp:ListItem Value="2">仅登录可见</asp:ListItem>
                            <asp:ListItem Value="3">内网或登录可见</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>显示等级：
                    </th>
                    <td>
                        <asp:DropDownList ID="grade" runat="server" DataTextField="name" DataValueField="pkId" class="drop-txt">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr id="submenu2" style="display: none;">
                    <th>文章模板：
                    </th>
                    <td>
                        <asp:DropDownList ID="itemType" runat="server" DataTextField="name" DataValueField="pkId" class="drop-txt">
                        </asp:DropDownList>
                    </td>
                    <th>文章固顶：
                    </th>
                    <td>
                        <asp:DropDownList ID="SetTop" runat="server" class="drop-txt">
                        </asp:DropDownList>
                    </td>
                    <th>文章推荐：
                    </th>
                    <td>
                        <asp:DropDownList ID="Setrecommand" runat="server" class="drop-txt">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr id="submenu3" style="display: none;">
                    <th>已有批注：
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlContributePostil" CssClass="drop-txt" runat="server" DataTextField="title" DataValueField="content" onchange="javascript:InitContributePostil(this.value)">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr id="submenu4" style="display: none;">
                    <th>投稿批注：
                    </th>
                    <td>
                        <asp:TextBox ID="RemarkTextBox" runat="server" TextMode="MultiLine" Width="550px" Height="70px"></asp:TextBox>
                    </td>
                </tr>
            </table>

            <div class="ft">
                <div class="action-field txt-c">
                    <asp:Button ID="save" class="btn" runat="server" Text="保 存" OnClientClick="return checkAll();" OnClick="save_Click"></asp:Button>
                    &nbsp;&nbsp;
                <input id="Button1" class="btn" type="button" value="关 闭" onclick="window.close()" />
                </div>
            </div>

            <script type="text/javascript" language="javascript">
                //判断页面是否加载完毕
                document.onreadystatechange = function () {
                    if (document.readyState == "complete") {
                        call(4);
                    }
                }

                function InitContributePostil(content) {
                    document.getElementById("<%= RemarkTextBox.ClientID%>").value = content;
        }
            </script>

        </div>
    </form>
</body>
</html>
