<%@ Page Language="C#" AutoEventWireup="true" Inherits="User_Info_InfoList, QianboCMS" EnableEventValidation="false" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!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 id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>投稿列表</title>
<link href="../Images/default.css" rel="stylesheet" type="text/css" />
<link href="../Images/model.css" rel="stylesheet" type="text/css" />
<style type="text/css">
a {
    text-decoration: none;
    color: #333;
}
a:hover {
    color: #cc0000;
    text-decoration: underline;
}
body, .wrapper {
    float: left;
    padding: 0;
    margin: 0;
    background: none;
}
.wrapper {
    width: 100%;
}
.user_main {
    background: none;
}
.p {
    padding: 3px 5px;
    background-color: #eef6fb;
}
th {
    font-weight: bold;
}
</style>
<script type="text/javascript" src="../../Js/Common.js"></script>
<script language="javascript" type="text/javascript">
function SetCheckBox(){
	if($("gvInfoList")==null)
	return;
	var s = $("gvInfoList").getElementsByTagName("input")
	for(var i=0;i<s.length;i++){
		if(s[i].type=="checkbox"&&s[i].disabled==false){
			s[i].checked=$("chkBoxChooseAll").checked;
		}
	}
}
function CheckDelete(){
	var s = $("gvInfoList").getElementsByTagName("input");
	var flag = false;
	for(var i=0;i<s.length;i++){
		if(s[i].type=="checkbox"){
			if(s[i].checked){
				flag = true;
			}
		}
	}
	if(!flag){
		alert("请选择删除项！");
		return false;
	}
	return confirm("是否确定将所有选择项放入回收站？");
}
</script>
</head>

<body>
<form id="form1" runat="server">
  <div class="wrapper">
    <div class="user_main_all">
      <div class="user_main">
        <!-- 主体内容开始 -->
        <div class="user_summary">
          <div class="user_sitepath">您现在的位置：<span id="YourPosition"><span>
            <asp:HyperLink ID="hylnkIndex" runat="server">首页</asp:HyperLink>
            </span><span>&gt;&gt; </span><span>会员中心</span><span> &gt;&gt; </span><span>会员稿件列表管理</span><span> &gt;&gt; </span><span>[<%=ChannelModel.ChName %>]稿件</span></span></div>
          <div class="model_info_list">
            <table width="99%" cellspacing="1" cellpadding="0" class="border" align="center">
              <tr>
                <td class="p"><asp:HyperLink ID="hylnkSetInfo" runat="server">添加稿件</asp:HyperLink> | <a href="InfoList.aspx?ChId=<%=ChId %>&ColId=<%=ColId %>&Status=all">所有稿件</a> | <a href="InfoList.aspx?ChId=<%=ChId %>&ColId=<%=ColId %>&Status=rec">草稿箱</a> | <a href="InfoList.aspx?ChId=<%=ChId %>&ColId=<%=ColId %>&Status=wait">待审核的内容</a> | <a href="InfoList.aspx?ChId=<%=ChId %>&ColId=<%=ColId %>&Status=yes">已审核</a> | <a href="InfoList.aspx?ChId=<%=ChId %>&ColId=<%=ColId %>&Status=no">未被采纳</a></td>
              </tr>
            </table>
            <asp:GridView ID="gvInfoList" runat="server" AutoGenerateColumns="False" Width="99%" GridLines="None" class="border" align="center" CellSpacing="1" OnRowDataBound="gvInfoList_RowDataBound" OnRowDeleting="gvInfoList_RowDeleting" DataKeyNames="Id" OnRowCommand="gvInfoList_RowCommand">
              <Columns>
              <asp:TemplateField HeaderText="全选">
                <ItemTemplate>
                  <asp:CheckBox ID="chkBoxChooseInfo" runat="server" BackColor="White" BorderStyle="None" Enabled='<%# GetDeleteAndPublishStatus(Eval("Status"))%>' />
                </ItemTemplate>
                <ItemStyle Width="32px" />
                <HeaderTemplate>
                  <asp:Label ID="lbChooseAll" runat="server" Text="全选"></asp:Label>
                </HeaderTemplate>
              </asp:TemplateField>
              <asp:BoundField HeaderText="ID" DataField="Id">
                <ItemStyle Width="38px" />
              </asp:BoundField>
              <asp:TemplateField>
                <ItemTemplate>
                  <asp:HyperLink ID="hlkTitle" runat="server" Text='<%# InfoTitle(Eval("Title"),Eval("TitleType")) %>' ToolTip='<%#Eval("Title") %>'></asp:HyperLink>
                </ItemTemplate>
                <ItemStyle />
              </asp:TemplateField>
              <asp:TemplateField HeaderText="发布时间">
                <ItemTemplate><%#Eval("AddTime","{0:yyyy-MM-dd HH:ss}") %></ItemTemplate>
              </asp:TemplateField>
              <asp:TemplateField HeaderText="审核状态">
                <ItemTemplate>
                  <asp:Label runat="server" ID="lbShowStatus" Text='<%#Eval("Status") %>' Visible="false"></asp:Label>
                  <asp:Label ID="lbStatus" runat="server" Text='<%# ChangeStatus(Eval("Status")) %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle Width="60px" />
              </asp:TemplateField>
              <asp:TemplateField HeaderText="功能操作" ShowHeader="False">
                <ItemTemplate><%# IsAllowUpdate(Eval("Status"), Eval("Id"),Eval("ChId"),Eval("ColId"))%>
                  <asp:LinkButton ID="lkBtnDelete" runat="server" CausesValidation="False" CommandName="Delete" Visible='<%# GetDeleteAndPublishStatus(Eval("Status"))%>' Text="删除" OnClientClick="return confirm('是否确定删除该稿件草稿？')"></asp:LinkButton>
                  <asp:LinkButton ID="lkBtnSet" runat="server" CausesValidation="false" CommandName="UserPublished" CommandArgument='<%#Eval("Id") %>' Text="发布" Visible='<%# GetDeleteAndPublishStatus(Eval("Status"))%>' OnClientClick="return confirm('是否确定发布此草稿？')"></asp:LinkButton>
                </ItemTemplate>
                <ItemStyle Width="90px" />
              </asp:TemplateField>
              </Columns>
              <HeaderStyle CssClass="title" Width="20px" />
              <PagerStyle />
              <RowStyle CssClass="tdbg" />
            </asp:GridView>
            <table width="99%" cellspacing="1" cellpadding="0" class="border" align="center">
              <tr>
                <td class="p"><input type="checkbox" onclick="SetCheckBox()" id="chkBoxChooseAll" />
                  <label for="chkBoxChooseAll">全选</label>
                  <asp:Button ID="btnDeleteAll" runat="server" Text="批量删除" OnClick="btnDeleteAll_Click" OnClientClick="return CheckDelete()" CssClass="submit_button" UseSubmitBehavior="true" />
                  <div id="dvDeleteTotal" runat="server" class="fl"></td>
              </tr>
            </table>
            <table width="99%" cellspacing="1" cellpadding="0" class="border" align="center">
              <tr>
                <td class="p"><webdiyer:AspNetPager ID="AspNetPager" runat="server" AlwaysShow="True" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" OnPageChanging="AspNetPager_PageChanging" PageSize="20" PrevPageText="上一页" ShowCustomInfoSection="Left" ShowInputBox="Never" CustomInfoSectionWidth="25%" ShowNavigationToolTip="True" Width="99%" HorizontalAlign="Right"></webdiyer:AspNetPager></td>
              </tr>
            </table>
            <table width="99%" cellspacing="1" cellpadding="0" class="border" align="center">
              <tr>
                <td class="p"><strong>文章搜索：</strong>
                  <asp:DropDownList ID="ddlUserCate" runat="server"></asp:DropDownList>
                  <asp:DropDownList ID="ddlsortName" runat="server">
                    <asp:ListItem Value="Title"></asp:ListItem>
                    <asp:ListItem Value="AdminUName">审核人</asp:ListItem>
                    <asp:ListItem Value="AddTime">添加时间</asp:ListItem>
                  </asp:DropDownList>
                  <asp:TextBox ID="txtKeyword" runat="server" Height="22px" MaxLength="50"></asp:TextBox>
                  <asp:Button ID="btnSearch" runat="server" CommandName="SearchNews" CssClass="submit_button" OnClick="btnSearch_Click" Text="搜索" OnClientClick="javascript:if($('txtKeyword').value==''){alert('请输入搜索关键字！');$('txtKeyword').focus();return false;}" /></td>
              </tr>
            </table>
            <asp:Label ID="lbMessageBox" runat="server" Visible="False"></asp:Label>
          </div>
          <!-- 主体内容结束 -->
          <div class="clear"></div>
        </div>
      </div>
    </div>
  </div>
</form>
</body>
</html>