<%@ Page Language="C#" AutoEventWireup="true" CodeFile="model_document.aspx.cs" Inherits="admin_model_article_list" %>

<%@ Register Src="../controls/FormPaging_Rep.ascx" TagName="FormPaging_Rep" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>文章管理</title>
      <link href="/images/css/inbox.css"rel="stylesheet" type="text/css" />
    <script language="javascript">
    function DelCheck()
    {
        if(!DocCheck())
        {
            return false;
        }
        else
        {
            if(confirm('确认删除所选文档吗?'))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
    //栏目移动
    function ColumnCheck()
    {
        var drop=document.getElementById("Drop_Col");
        if(drop.options[drop.options.selectedIndex].value=="0")
        {
            alert("请选择栏目!");
            return false;
        }
        else if(!DocCheck())
        {
            return false;
        }
        else
        {
            return true;
        }
    }
    //文档选择验证
    function DocCheck()
    {
        var bo=false;
   
        var gv=document.getElementById("tabdocument");
        for(var i=1;i<gv.rows.length-1;i++)
        {
            if(gv.rows[i].cells[0].getElementsByTagName("input")[0].checked==true)
            {
                bo=true;
            } 
        }
        if(bo==false)
        {
            alert("请选择需要操作的文章!");
            return false;
        }
        else
        {
            return true;
        }
    }
    //全选/反选
    function Check(che)
    {
        var gv=document.getElementById("tabdocument");
        for(var i=1;i<gv.rows.length-1;i++)
        {
            gv.rows[i].cells[0].getElementsByTagName("input")[0].checked=che.checked; 
        }
    }
    //判断时间
    function ReturnTime()
    {
        var btime=document.getElementById("txt_time1").value;
        var etime=document.getElementById("txt_time2").value;
        if(btime=="")
        {
            alert("请选择开始日期!");
            return false;
        }
        else if(etime=="")
        {
            alert("请选择结束日期!");
            return false;
        }
        else
        {
            return true;
        }
    }
    //样式替换
    function BgCss(id,type)
    {
        if(type==0)
        {
            document.getElementById("css_"+id).className="upbg";
        }
        else
        {
            document.getElementById("css_"+id).className="unbg";
        }
    }
    </script>
    <style type="text/css">
    .upbg{
        background:#ccff33;
    }
    .unbg{
        background:#ffffff;
    }
    </style>
    <script language=javascript type="text/javascript" src="/images/DateTime/WdatePicker.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div >
        <div style="z-index: 101; left: 410px; width: 208px; position: absolute; top: 236px;
            height: 20px;color:Green;background-color:Gold;display:none" id="htmdiv">
            &nbsp;静态生成中.....</div>
    
        <table style="width: 100%" align=center class="Ibx_gTable_Con">
            <tr>
                <td>
                    <input id="Check_all" onclick="Check(this)" type="checkbox" />全选/反选&nbsp;
                    <asp:DropDownList ID="Drop_attribute" runat="server" AutoPostBack="True" OnSelectedIndexChanged="Drop_attribute_SelectedIndexChanged">
                        <asp:ListItem>按属性</asp:ListItem>
                        <asp:ListItem Value="head=1">头条</asp:ListItem>
                        <asp:ListItem Value="map=1">图文</asp:ListItem>
                        <asp:ListItem Value="flash=1">幻灯</asp:ListItem>
                        <asp:ListItem Value="commend=1">推荐</asp:ListItem>
                       
                    </asp:DropDownList>
                    <a href="model_document.aspx" class="bt_css">查看所有</a>
                    <asp:TextBox ID="keyword" runat="server"></asp:TextBox>
                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="查 询" />&nbsp;&nbsp;<asp:DropDownList
                        ID="Drop_Cn1" runat="server">
                    </asp:DropDownList>
                    <asp:Button ID="Button3" runat="server" OnClick="Button3_Click1" Text="按栏目查询" /></td>
            </tr>
            <tr>
                <td>
                    起始日期:<input id="txt_time1" type="text" onfocus="WdatePicker()" class="Wdate" runat="server" />→结束日期
                    <input id="txt_time2" type="text" onfocus="WdatePicker()" class="Wdate" runat="server" />
                    <asp:Button ID="Button2" runat="server" Text="查 询" OnClientClick="return ReturnTime();" OnClick="Button2_Click" /></td>
            </tr>
            </table>
            <table style="width: 100%" id="tabdocument" align=center class="Ibx_gTable_Con">
            <tr class=bg align=center>
                <td align=center style="width: 103px;">选择</td>
                <td style="height: 20px">
                    标题</td>
                
                <td style="height: 20px">
                    
                    所属栏目</td>
                <td style="height: 20px">
                    发布人</td>
                <td style="height: 20px">
                    浏览</td>
                <td style="height: 20px">
                    审核</td>
                 <td style="height: 20px">
                    生成</td>
                <td style="height: 20px">
                    操作</td>
            </tr>
                 <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
                 <ItemTemplate>
               
            <tr id="css_<%#Container.ItemIndex %>" onmouseout="BgCss(<%#Container.ItemIndex %>,1)" onmouseover="BgCss(<%#Container.ItemIndex %>,0)">
                <td align=center><asp:CheckBox ID="Check_Select" runat="server" /></td>
                <td>
                <%#Eval("title") %>
                    
                 </td>
           
                <td align="center">

                    <asp:Label ID="Lab_cname" runat="server" Text='<%#Eval("colid") %>'></asp:Label>
                </td>
                <td align="center">
                <%#Eval("username") %>
                </td>
                <td align="center">
                <%#Eval("click") %>
                </td>
                <td align="center">
                <%#(Boolean)(Eval("audit"))?"<font color=green>√</font>":"<font color=red>×</font>" %>
                </td>
                <td align="center">
                <%#(Boolean)(Eval("html")) ? "<font color=green>√</font>" : "<font color=red>×</font>"%>
                </td>
                <td align="center">
                    <asp:HiddenField ID="Fielddocid" Value='<%#Eval("docid") %>' runat="server" />
                   <asp:LinkButton ID="del" runat="server" OnClientClick="return confirm('确认删除该文档吗?')" ToolTip='<%#Eval("docid") %>' OnClick="del_Click">删除</asp:LinkButton> | <asp:LinkButton ID="LinkButton1" ToolTip='<%#Eval("docid") %>' runat="server" OnClick="LinkButton1_Click">编辑</asp:LinkButton> |<asp:HyperLink ID="proview" runat="server" Target="_blank">预览</asp:HyperLink>
                </td>
            </tr>
              </ItemTemplate>
                </asp:Repeater>
            <tr>
                <td colspan="8" align="center">
                 <uc1:FormPaging_Rep ID="FormPaging_Rep1" runat="server" />
                
                </td>
            </tr>
            <tr>
                <td class="bg" colspan="8">
                    <input id="Check_all1" onclick="Check(this)" type="checkbox" />全选/反选
                    <asp:Button ID="delete" runat="server" OnClientClick="return DelCheck();" OnClick="delete_Click" Text="删 除" />
                    <asp:Button ID="bt_audit" runat="server" OnClick="bt_audit_Click" OnClientClick="return DocCheck();" Text="审 核" />
                    <asp:DropDownList ID="Drop_Col" runat="server">
                    </asp:DropDownList>
                    <asp:Button ID="Bt_ColUp" runat="server" Text="移动到所选栏目" OnClientClick="return ColumnCheck();" OnClick="Bt_ColUp_Click" />
                    <script language=javascript>
                    function HtmlWriter()
                    {
                        if(!DocCheck())
                        {
                            return false;
                        }
                        else
                        {
                            document.getElementById('htmdiv').style.display="inline";
                            return true;
                        }
                    }
                    </script>
                    <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" OnClientClick="return HtmlWriter();" Text="生 成" />&nbsp;<asp:Button
                        ID="Button5" runat="server" OnClientClick="return DocCheck();" Text="修改属性" OnClick="Button5_Click" /></td>
            </tr>
        </table>
    </div>
    <font color=""></font>
    </form>
</body>
</html>
