<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="JuSNS.Web.system.news.index" %>

<!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 id="ptitle" runat="server">新闻管理</title>
<link href="../images/css/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="../../js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="../../js/public.js"></script>

</head>
<body>
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="1">
  <tr>
    <td width="120" align="center" valign="top">
        <div class="menu">
            <ul>
        	<%=this.GetSystemMenu(sort)%>
        	</ul>
      </div>
    </td>
    <td valign="top">
   <div class="navip">
    <span class="Blue"><a href="index.aspx">新闻管理</a> <a href="add.aspx">增加新闻</a> <a href="class.aspx">分类管理</a></span> 
   </div> 
   <div style="padding:6px 8px 0px 8px;" runat="server" id="ClassList"></div>
   <div id="DivErr" runat="server"></div>
   <form id="form1" runat="server">
   <div id="mainbody">
            <asp:Repeater runat="server" ID="Rpt_NewsrList">
                <HeaderTemplate>
                    <table width="100%" border="0" cellpadding="3" cellspacing="1" class="maintable">
                        <tr class="maintablehead">
                            <td align="center" style="width: 6%;">
                                编号</td>
                            <td style="width: 35%;">
                                标题</td>
                            <td style="width: 13%;">
                                分类</td>
                            <td style="width: 15%;">
                                发布日期
                            </td>
                            <td align="center" style="width: 12%;">
                                状态</td>
                            <td align="center" style="width: 8%;">
                                系统公告</td>
                            <td align="center" style="width: 10%;">
                                操作</td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="maintablelist">
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "ID")%>
                        </td>
                        <td>
                            <a href="../../home/news/content.aspx?nid=<%# DataBinder.Eval(Container.DataItem, "ID")%>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "title")%></a>
                        </td>
                        <td align="left">
                            <%# DataBinder.Eval(Container.DataItem, "CName")%>
                        </td>
                        <td align="left">
                            <%# DataBinder.Eval(Container.DataItem, "CreatTime")%>
                        </td>
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "isLock")%>
                        </td>
                        <td align="center">
                            <font color="red"><%# DataBinder.Eval(Container.DataItem, "isSys")%></font>
                        </td>
                        <td align="center">
                            <a href="add.aspx?r=<%# DataBinder.Eval(Container.DataItem, "id")%>">编辑</a> | <a href="javascript:del(<%# DataBinder.Eval(Container.DataItem, "ID")%>);">删除</a>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
            <div style="text-align:right;padding:10px;"><a href="javascript:delAll();">清空所有新闻</a></div>
            <div class="pagination" runat="server" id="DivPage" align="center"></div>
            <table width="100%" border="0" cellpadding="3" cellspacing="1">
                <tr class="maintablepage">
                    <td>
                        <div align="center">
                            输入新闻标题或者内容
                            <asp:TextBox ID="Key" runat="server" Width="200"></asp:TextBox><asp:Button ID="Button1" runat="server" Text=" 搜索 " OnClick="Button1_Click" /></div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
    </td>
  </tr>
</table>
</body>
</html>
<script language="javascript" type="text/javascript">
function del(id)
{
    if(confirm('你确认删除此新闻吗?'))
        self.location="?Type=del&id="+id;
}
function delAll()
{
    if(confirm('你确认删除所有新闻吗?此操作不可逆！'))
        self.location="?Type=delAll";
}
function Recommended(id,flag,p)
{
    var str="你确定要锁定此新闻吗？";
    if(flag==2)
    {
        str="你确定要取消锁定此新闻吗？";
    }
    if(confirm(str))
        self.location="?Type=isLock&pg="+p+"&id="+id+"&flag="+flag;
}

</script>
