<%@ page title="" language="VB" masterpagefile="~/blank.master" autoeventwireup="false" inherits="WebExam.Web.cms_admin_checkupCMS, App_Web_ayyvfveb" %>

<%@ MasterType VirtualPath="~/blank.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHead" runat="Server">
    <style type="text/css">
        dd
        {
            float: left;
        }
        dt
        {
            font-weight: bold;
        }
    </style>
    <script type="text/javascript">
        function CheckAll() {
            $("input[name='select']").attr("checked", true);


        };
        function unCheck() {
            $("input[name='select']").each(function (i) {
                this.checked = !this.checked;
            }); 
        };
        function unCheckAll() {
            $("input[name='select']").each(function (i) {
                this.checked = false;
            }); 
        }
        function checkWait() {
            $("input[name='select']").each(function (i) {
                var u = $(this).parent().next().next().children().attr("src");
                this.checked = (u.indexOf("/waiting.gif") != -1)
            });
        };
        function checkDeny() {
            $("input[name='select']").each(function (i) {
                var u = $(this).parent().next().next().children().attr("src");
                this.checked = (u.indexOf("/standard_msg_error.gif") != -1)
            });
        };
        function checkAllow() {
            $("input[name='select']").each(function (i) {
                var u = $(this).parent().next().next().children().attr("src");
                this.checked = (u.indexOf("/standard_msg_ok.gif") != -1)
            });
        };
        function checkSelect() {
            var c = false;
            $("input[name='select']").each(function (i) {
               if (this.checked)c = true;
            });
            if (!c) {alert("请至少选择一项！") }
            return c;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h3><script type ="text/javascript">
            var catalog = $.url.param("catalog");
            switch (catalog) {
                case "4":
                    document.write("练习卷列表"); break;
                case "5":
                    document.write("文章列表"); break;

            };
                </script>
                   </h3>
    <asp:GridView ID="GridView1" runat="server" EnableModelValidation="True" AutoGenerateColumns="False"
        CellPadding="4" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:TemplateField HeaderText="选择">
                <ItemTemplate>
                    <input type="checkbox" value='<%# DataBinder.Eval(Container.DataItem, "id") %>' name="select"
                         />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ItemStyle-Width="0">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "status") %>' Visible="False"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:ImageField HeaderText="状态" ReadOnly="True" DataImageUrlFormatString="~/images/waiting.gif"
                DataImageUrlField="status">
            </asp:ImageField>
            
            <asp:BoundField DataField="topic" HeaderText="标题" />
            <asp:BoundField DataField="adm" HeaderText="发布者" />
            <asp:BoundField DataField="updateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="发布时间"
                ReadOnly="True"></asp:BoundField>
            <asp:HyperLinkField Text="打开" DataNavigateUrlFields="path,defaultFile" DataNavigateUrlFormatString="{0}{1}"
                Target="_blank" />
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <EmptyDataTemplate>
            <p>
                无数据</p>
        </EmptyDataTemplate>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
    </asp:GridView>
    <pagers:PageNumbersPager ID="PageNumbersPager1" runat="server" />
    <p>
    选择:
<a href="javascript:checkWait()">等待</a>
<a href="javascript:checkDeny()">拒绝</a>
<a href="javascript:checkAllow()">许可</a>
    <a href="javascript:CheckAll()">全选</a>
    <a href="javascript:unCheck()">反选</a>
     <a href="javascript:unCheckAll()">不选</a>
    </p>
    <div>
               
    <asp:Button ID="Btn_Delete" runat="server" Text="删除所选" 
            OnClientClick="if(checkSelect())return confirm('确定要删除吗？');else return false;" />
    <asp:Button ID="Btn_allow" runat="server" Text="允许发布" OnClientClick="return checkSelect();"/>
    <asp:Button ID="Btn_Deny" runat="server" Text="拒绝发布" OnClientClick="return checkSelect();" />
    </div>
    <div>
        <dl>
            <dt>状态说明</dt><dd><img src="/images/waiting.gif" />等待审核</dd><dd><img src="/images/standard_msg_ok.gif" />审核通过</dd><dd><img
                src="/images/standard_msg_error.gif" />被拒绝</dd></dl>
    </div>
    
    
</asp:Content>
