<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="JuSNS.Web.system.blog.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>
<script language="javascript" type="text/javascript">
    <!--
   function Rec(t,id)
   {
        if(window.confirm('是否要推荐/取消推荐该日志?'))
        {
            var  options={
            method:'post',
            parameters:"Option=Rec&ts="+t+"&ID="+ id,
            onComplete:
            function(transport)
	            {
	                var retv =transport.responseText;
	                if(retv == '1')
	                {
	                    location.href = location.href;
	                }
	            } 
	        }
	        new  Ajax.Request('ajax.aspx',options);
	    }
   } 
   
    function LockIt(id)
    {
        if(window.confirm('是否要锁定该日志?'))
        {
            var  options={
            method:'post',
            parameters:"Option=Lock&ID="+ id,
            onComplete:
            function(transport)
	            {
	                var retv =transport.responseText;
	                if(retv == '1')
	                {
	                    location.href = location.href;
	                }
	            } 
	        }
	        new  Ajax.Request('ajax.aspx',options);
	    }
    }
    function UnLockIt(id)
    {
        if(window.confirm('是否要解除对该日志的锁定?'))
        {
            var  options={
            method:'post',
            parameters:"Option=UnLock&ID="+ id,
            onComplete:
            function(transport)
	            {
	                var retv =transport.responseText;
	                if(retv == '1')
	                {
	                    location.href = location.href;
	                }
	            } 
	        }
	        new  Ajax.Request('ajax.aspx',options);
	     }
    }
    function DelIt(id)
    {
        if(window.confirm('是否要删除该日志及其评论?数据将不能恢复!'))
        {
            var  options={
            method:'post',
            parameters:"Option=Delete&ID="+ id,
            onComplete:
            function(transport)
	            {
	                var retv =transport.responseText;
	                if(retv == '1')
	                {
	                    location.href = location.href;
	                }
	            } 
	        }
	        new  Ajax.Request('ajax.aspx',options);
	     }
    }
    //-->    
    </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></span> &nbsp;<a href="comment.aspx">评论管理</a>
   </div> 
   <div id="DivErr" runat="server"></div>
   <form id="form1" runat="server">
   <div id="mainbody">
            <asp:Repeater runat="server" ID="RptData">
                <HeaderTemplate>
                    <table width="100%" border="0" cellpadding="3" cellspacing="1" class="maintable">
                        <tr class="maintablehead">
                            <td align="center" style="width: 5%;">
                                编号</td>
                            <td align="center" style="width: 40%;">
                                日志标题</td>
                            <td align="center" style="width: 12%;">
                                发布者</td>
                            <td align="center" style="width: 15%;">
                                发布时间</td>
                            <td align="center" style="width: 10%;">
                                评论数</td>
                            <td align="center" style="width: 5%;">
                                状态</td>
                            <td align="center" style="width: 13%;">
                                操作</td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="maintablelist">
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "ID")%>
                        </td>
                        <td align="left">
                            <a href="../../home/blog/article.aspx?r=<%# DataBinder.Eval(Container.DataItem, "ID")%>" target="_blank"><%# JuSNS.Common.Input.HtmlEncode(DataBinder.Eval(Container.DataItem, "Title").ToString())%></a>
                        </td>
                        <td align="center">
                            <a href="../../user/?r=<%# DataBinder.Eval(Container.DataItem, "UserID")%>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "UserName")%></a>
                        </td>
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "PostTime")%>
                        </td>
                        <td align="center">
                            <%# DataBinder.Eval(Container.DataItem, "Comments")%>
                        </td>
                        <td align="center">
                            <%# ShowLock(DataBinder.Eval(Container.DataItem, "IsLock"))%>
                        </td>
                        <td align="center">
                         
                            <a href="javascript:DelIt(<%# DataBinder.Eval(Container.DataItem, "ID")%>);">删除</a> |<%# ShowLock(DataBinder.Eval(Container.DataItem, "IsLock"), DataBinder.Eval(Container.DataItem, "ID"))%>|<%# ShowRec(DataBinder.Eval(Container.DataItem, "isRec"), DataBinder.Eval(Container.DataItem, "ID"))%> 
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
            <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="left">
                            搜索
                            <asp:DropDownList runat="server" ID="Condtion">
                                <asp:ListItem Value="1">按作者姓名</asp:ListItem>
                                <asp:ListItem Value="2" Selected="true">按日志标题</asp:ListItem>
                            </asp:DropDownList>
                            <asp:TextBox ID="Key" runat="server" Width="200"></asp:TextBox>
                            排序方式
                            <asp:DropDownList runat="server" ID="Order">
                                <asp:ListItem Value="1">按发表日期</asp:ListItem>
                                <asp:ListItem Value="2">按作者姓名</asp:ListItem>
                                <asp:ListItem Value="3">按评论数</asp:ListItem>
                            </asp:DropDownList>
                            <asp:Button ID="BtnSearch" runat="server" Text=" 搜索 " OnClick="BtnSearch_Click" /></div>
                        
                    </td>
                </tr>
            </table>
        </div>
    </form>
    </td>
  </tr>
</table>
</body>
</html>
