<%@ Page Language="C#" AutoEventWireup="true" Inherits="MyITJob.Admin_Admin_Article"
    CodeBehind="Admin_Article.aspx.cs" %>

<!DOCTYPE>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>
        <%=Application["PageTitle"] %>
        - 管理文章</title>
    <link href="../images/Admin_Style.css" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript" src="../js/tit.js"></script>
    <link rel="stylesheet" href="../kindeditor/themes/default/default.css" />
    <link rel="stylesheet" href="../kindeditor/plugins/code/prettify.css" />
    <script charset="utf-8" src="../kindeditor/kindeditor.js"></script>
    <script charset="utf-8" src="../kindeditor/lang/zh_CN.js"></script>
    <script charset="utf-8" src="../kindeditor/plugins/code/prettify.js"></script>
    <script>
        KindEditor.ready(function (K) {
            var editor1 = K.create('#editor_GG,#Article_Text', {
                cssPath: '../kindeditor/plugins/code/prettify.css',
                uploadJson: '../kindeditor/upload_json.ashx',
                fileManagerJson: '../kindeditor/file_manager_json.ashx',
                allowFileManager: true                
            });
            prettyPrint();
        });
    </script>
    <script language="javascript" src="../MyITJob.js" type="text/javascript"></script>
    <script language='javascript' type="text/javascript">
        function CheckAll(form) {
            for (var i = 0; i < form.elements.length; i++) {
                var e = form.elements[i];
                if (e.name != 'chkAll' && e.disabled == false && e.type == 'checkbox') {
                    e.checked = form.chkAll.checked;
                    if (e.checked)
                        hL(e);
                    else
                        dL(e);
                }
            }
        }

        function hL(E) {
            while (E.tagName != 'TR') { E = E.parentElement; }
            E.className = 'tdbg2';
        }
        function dL(E) {
            while (E.tagName != 'TR') { E = E.parentElement; }
            E.className = 'tdbg';
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btn btn-xs btn-success">
																	<i class="icon-ok"></i><span class="bigger-110">I don't accept</span>
																</div>
    <div>
        <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
            <tr class='topbg2'>
                <td width="100%" align='center'>
                    <strong class="Glow">文 章 管 理</strong>
                </td>
            </tr>
        </table>
        <asp:Panel ID="top_GG" runat="server" Width="100%" Visible="false" EnableViewState="false">
            <table width="100%" border="0" cellpadding="4" cellspacing="1" class="border">
                <tr>
                    <td width="15%" align="right" class="tdbg2">
                        标题内容：
                    </td>
                    <td width="85%" class="tdbg">
                        <textarea id="editor_GG" cols="100" rows="8" style="width: 700px; height: 200px;
                            visibility: hidden;" runat="server"></textarea>
                    </td>
                </tr>
            </table>
            <div align="center">
                <asp:Button ID="top_GG_Button" runat="server" Text="提 交" OnClick="top_GG_Button_Click"
                    EnableViewState="false" />
                <input id="Reset2" type="reset" value="重置" /></div>
        </asp:Panel>
        <asp:Panel ID="Add" runat="server" Width="100%" Visible="False">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <table width='100%' border='0' align='center' cellpadding='4' cellspacing='1' class='border'>
                            <tr class='tdbg'>
                                <td width="15%" class="tdbg2" align="right">
                                    所属栏目：
                                </td>
                                <td>
                                    <asp:DropDownList ID="Add_DDL" runat="server">
                                    </asp:DropDownList>
                                    所属地区：
                                    <asp:DropDownList ID="ArticleFrom" runat="server">
                                    </asp:DropDownList>
                                    <span class="style4">*请勿选择省，否则文章不会显示；添加到地区时，文章同样会显示在主页。</span>
                                </td>
                            </tr>
                            <tr class='tdbg'>
                                <td class="tdbg2" align="right">
                                    文章标题：
                                </td>
                                <td>
                                    &nbsp;<asp:DropDownList ID="TitleColor" runat="server">
                                        <asp:ListItem style="background-color: #000000; color: #FFFFFF" Value="">默认</asp:ListItem>
                                        <asp:ListItem style="background-color: #FF0000; color: #FFFFFF" Value="#FF0000">红色</asp:ListItem>
                                        <asp:ListItem style="background-color: #0000FF; color: #FFFFFF" Value="#0000FF">蓝色</asp:ListItem>
                                        <asp:ListItem style="background-color: #009900; color: #FFFFFF" Value="#009900">绿色</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:TextBox ID="Add_Title" runat="server" Width="290px" MaxLength="30" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Add_Title"
                                        ErrorMessage="文章标题不能为空"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr class='tdbg'>
                                <td class="tdbg2" align="right">
                                    文章作者：
                                </td>
                                <td>
                                    <asp:TextBox ID="Add_User" runat="server" Width="290px" MaxLength="12" />
                                </td>
                            </tr>
                            <tr class='tdbg'>
                                <td class="tdbg2" align="right">
                                    文章来源：
                                </td>
                                <td>
                                    <asp:TextBox ID="Add_laiyuan" runat="server" Width="290px" MaxLength="20" />
                                </td>
                            </tr>
                            <tr class='tdbg'>
                                <td class="tdbg2" align="right">
                                    文章设置：
                                </td>
                                <td>
                                    <input type="checkbox" name="top_checkbox" id="top_checkbox" <%=_top%> /><label for="top_checkbox">设为置顶</label>
                                    <input type="checkbox" name="gd_checkbox" id="gd_checkbox" <%=_marquee%> /><label
                                        for="gd_checkbox">设为滚动</label>
                                </td>
                            </tr>
                            <tr class='tdbg'>
                                <td class="tdbg2" align="right">
                                    发布时间：
                                </td>
                                <td>
                                    <asp:TextBox ID="Add_Time" runat="server" Width="290px" MaxLength="20" />
                                </td>
                            </tr>
                            <tr class='tdbg'>
                                <td align="right" valign="top" class="tdbg2">
                                    文章内容：
                                </td>
                                <td>
                                    <textarea id="Article_Text" rows="30" cols="100" style="visibility: hidden;" runat="server"></textarea>
                                </td>
                            </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td style="height: 22px">
                                    <div align="center">
                                        <asp:Button ID="Button1" runat="server" Text="添加" OnClick="Button1_Click" />
                                        <input id="Reset1" type="reset" value="重置" />
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <asp:Panel ID="Manage_Article" runat="server" Height="376px">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td style="height: 21px">
                        <span style="height: 20px">
                            <!--筛选新闻类型:-->
                            <asp:DropDownList ID="DDL_Look" runat="server" Visible="true">
                            </asp:DropDownList>
                            <asp:Button ID="Look_NewsType" runat="server" Text="查 看" OnClick="Look_NewsType_Click" />
                            <asp:TextBox ID="SearchText" runat="server"></asp:TextBox>
                            <asp:Button ID="Search_Button" runat="server" Text="搜 索" OnClick="Search_Button_Click" /></span>
                    </td>
                </tr>
            </table>
            <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
                <tr class='topbg2'>
                    <td width="4%" align='center'>
                        <span class="Glow"><strong>选中</strong></span>
                    </td>
                    <td width="4%" align='center'>
                        <span class="Glow"><strong>序号</strong></span>
                    </td>
                    <td width="42%" align='center'>
                        <span class="Glow"><strong>新闻标题</strong></span>
                    </td>
                    <td width="6%" align='center'>
                        <span class="Glow"><strong>点击量</strong></span>
                    </td>
                    <td width="6%" align='center'>
                        <span class="Glow"><strong>所属地区</strong></span>
                    </td>
                    <td width="9%" align='center'>
                        <span class="Glow"><strong>文章作者</strong></span>
                    </td>
                    <td width="12%" align='center'>
                        <span class="Glow"><strong>加入时间</strong></span>
                    </td>
                    <td width="17%" align='center'>
                        <span class="Glow"><strong>常规操作</strong></span>
                    </td>
                </tr>
                <asp:Repeater ID="Manage_News" runat="server">
                    <ItemTemplate>
                        <tr class='tdbg' onMouseOut="this.className='tdbg'" onMouseOver="this.className='tdbgmouseover'">
                            <td align='center'>
                                <asp:CheckBox ID="CheckBox1" runat="server" ToolTip='<%#Eval("id") %>' />
                            </td>
                            <td align='center'>
                                <%# Eval("id") %>
                            </td>
                            <td>
                                <a href="../LookNews.aspx?id=<%#Eval("id")%>" target="_blank" title="<%#Eval("Title") %>">
                                    <%#FormatLeft( Eval("Title").ToString() ,24 ,24) %>
                                </a><span style="color: #FF0000;">
                                    <%# (int)Eval("orders") == 0 ? "" : "[已置顶]"%>
                                </span><span style="color: #3E9C53;">
                                    <%# (int)Eval("marquee") == 0 ? "" : "[已滚动]"%>
                                </span>
                            </td>
                            <td>
                                <%#Eval("LookCount")%>
                            </td>
                            <td>
                                <%#Eval("ArticleFromName")%>
                            </td>
                            <td>
                                <%#Eval("UserName")%>
                            </td>
                            <td>
                                <%#Eval("AddTime")%>
                            </td>
                            <td align='center'>
                                <a href="Admin_Article.aspx?Action=Edit&id=<%# Eval("id")%>">修改</a> | <a href="Admin_Article.aspx?Action=Del&id=<%# Eval("id")%>"
                                    onclick="return confirm('确定要删除此项吗？此操作不可逆。')">删除</a> |
                                <div id="sure<%#Eval("id") %>" class="YnEnter">
                                    <a href="Admin_Article.aspx?Action=orders&id=<%# Eval("id")%>&sure=1">设置置顶</a> <a
                                        href="Admin_Article.aspx?Action=orders&id=<%# Eval("id")%>&sure=0">取消置顶</a></div>
                                <a href="#" onClick="YnEnterDiv('sure<%#Eval("id") %>')">
                                    <%# (int)Eval("orders") == 0 ? "未置顶" : "已置顶"%>
                                </a>|
                                <div id="marquee<%#Eval("id") %>" class="YnEnter">
                                    <a href="Admin_Article.aspx?Action=marquee&id=<%# Eval("id")%>&sure=1">设置滚动</a>
                                    <a href="Admin_Article.aspx?Action=marquee&id=<%# Eval("id")%>&sure=0">取消滚动</a></div>
                                <a href="#" onClick="YnEnterDiv('marquee<%#Eval("id") %>')">
                                    <%# (int)Eval("marquee") == 0 ? "未滚动":"已滚动" %>
                                </a>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <input name='chkAll' type='checkbox' onclick='CheckAll(this.form)' value='checkbox' />&nbsp;<!--<asp:Button
                ID="CRHTML_Button" runat="server" OnClick="CRHTML_Button_Click" Text="生成HTML文件" />-->
            &nbsp;&nbsp;
            <asp:Button ID="DelNews_Button" runat="server" OnClick="DelNews_Button_Click" Text="删除选定文章" /><br />
            <table width="100%" height="18" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="669" height="18">
                        <div id="paging" runat="server">
                        </div>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
