<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="attchemntmanage.aspx.cs"
    Inherits="FangPage.Admin.attchemntmanage" %>

<%@ Register TagPrefix="cc1" Namespace="FangPage.Control" Assembly="FangPage.Control" %>
<%@ Import Namespace="FangPage.Common" %>
<!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="styles/bmsmanager.css" type="text/css" rel="stylesheet">
    <link href="styles/datagrid.css" type="text/css" rel="stylesheet">

    <script type="text/javascript" src="js/common.js"></script>

    <meta content="MSHTML 6.00.3790.0" name="GENERATOR">
</head>
<body leftmargin="5" topmargin="5" rightmargin="5" bottommargin="5">
    <form id="Form1" runat="server">
    <div class="Navbutton" style="width: 98%;">
        <table cellspacing="1" cellpadding="4" align="left" class="table1">
            <tbody>
                <tr>
                    <td width="60">
                    <input title="选中/取消选中" onclick="CheckAll(this.form)" type="checkbox" name="chkall"
                            id="chkall" />全选
                    </td>
                    <td align="left">
                        <cc1:Button ID="DeleteAttachment" runat="server" Text="删除选中" ButtonImgUrl="images/dell.gif"
                            OnClick="DeleteAttachment_Click"></cc1:Button>
                        <cc1:Button ID="DeleteAll" runat="server" Text="删除全部" ButtonImgUrl="images/del.gif"
                            OnClick="DeleteAll_Click"></cc1:Button>
                        <cc1:Button ID="Button1" runat="server" Text="清理垃圾" ButtonImgUrl="images/nav_icon9.gif"
                            OnClick="Button1_Click"></cc1:Button>&nbsp;
                        <button type="button" class="ManagerButton" onclick="window.location='attchmentsearch.aspx';">
                            <img src="images/search.gif" />搜索附件</button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <cc1:DataGrid ID="DataGrid1" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged"
        OnSortCommand="Sort_Grid" AllowPaging="true" PageSize="20">
        <Columns>
            <asp:TemplateColumn HeaderText="选择">
                <ItemTemplate>
                    <input id="aid" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.aid").ToString() %>"
                        name="aid" />
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="aid" SortExpression="aid" HeaderText="文件id" Visible="false">
            </asp:BoundColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="Left" HeaderText="文件原名">
                <ItemTemplate>
                    <a href="<%=webpath %>upload/<%# DataBinder.Eval(Container, "DataItem.filename").ToString() %>"
                        target="_blank"><img src="<%# GetFileTypeIco(DataBinder.Eval(Container, "DataItem.attachment").ToString())%>" style="vertical-align:middle" border=0 />&nbsp;
                        <%# DataBinder.Eval(Container, "DataItem.attachment").ToString()%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="center" HeaderText="大小">
                <ItemTemplate>
                    <%# Utils.FormatBytesStr(Utils.StrToInt(DataBinder.Eval(Container, "DataItem.filesize").ToString(),0))%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:BoundColumn DataField="downloads" SortExpression="downloads" HeaderText="下载">
            </asp:BoundColumn>
            <asp:BoundColumn DataField="postdatetime" SortExpression="postdatetime" HeaderText="上传时间">
            </asp:BoundColumn>
            <asp:BoundColumn DataField="username" SortExpression="username" HeaderText="上传者">
            </asp:BoundColumn>
            <asp:BoundColumn DataField="sortname" SortExpression="sortname" HeaderText="所在栏目">
            </asp:BoundColumn>
            <asp:TemplateColumn ItemStyle-HorizontalAlign="center" HeaderText="描述">
                <ItemTemplate>
                    <%#ShowDescription(Utils.StrToInt(DataBinder.Eval(Container, "DataItem.savetype").ToString(), 0), Utils.StrToInt(DataBinder.Eval(Container, "DataItem.sortid").ToString(), 0), Utils.StrToInt(DataBinder.Eval(Container, "DataItem.tid").ToString(), 0), Utils.StrToInt(DataBinder.Eval(Container, "DataItem.pid").ToString(), 0), DataBinder.Eval(Container, "DataItem.description").ToString().Trim())%></a>
                </ItemTemplate>
            </asp:TemplateColumn>
            <asp:TemplateColumn HeaderText="操作" ItemStyle-HorizontalAlign="center">
                <ItemTemplate>
                    <a href="<%=webpath %>tools/attchemnt.aspx?aid=<%# DataBinder.Eval(Container, "DataItem.aid").ToString() %>">[下载]</a>
                </ItemTemplate>
            </asp:TemplateColumn>
        </Columns>
    </cc1:DataGrid>
    </form>
</body>
</html>
