<%@ Page CodeBehind="admin_ZYfile.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.admin.admin_ZYfile" %>

<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>
        <%=type%>
    </title>
    <link href="images/Site_Css.css" type="text/css" rel="stylesheet">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="images/Css.css" type="text/css" rel="stylesheet">
    <meta content="MSHTML 6.00.6000.16544" name="GENERATOR">
    <style type="text/css">
        .style4
        {
            color: #ff0000;
        }
        body,form
        {
            overflow:hidden;
            margin:0px;
            }
    </style>
	<script src="../js/calendar.js" type="text/javascript"></script>
    <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="../js/Common.js" type="text/javascript"></script>
    <script language="javascript" src="../js/function.js" type="text/javascript"></script>
    <script language="JAVASCRIPT">
        function Result() {
            Webdisk.admin.admin_file.GetBmAll(document.all.company.value, get_Result_CallBack);
        }

        function get_Result_CallBack(response) {
            if (response.value != null) {
                document.all("dept").length = 0;
                document.all("dept").options.add(new Option("全部部门", ""));
                var ds = response.value;
                if (ds != null && typeof (ds) == "object") {
                    for (var i = 0; i < ds.Rows.length; i++) {
                        var name = ds.Rows[i].knamem;
                        var id = ds.Rows[i].id;
                        document.all("dept").options.add(new Option(name, id));
                    }
                    document.all.hiddept.value = document.all.dept.value;
                }
            }
            return
        }
        function getUrlParam(paramName) {
            var s = location.search;
            if (s != null) {
                var sarr = s.substr(1).split("&");
                var tarr;
                for (i = 0; i < sarr.length; i++) {
                    tarr = sarr[i].split("=");
                    if (tarr.length == 2 && tarr[0].toLowerCase() == paramName) {
                        return tarr[1];
                    }
                }
                return "";
            }
        }
        function gosearch() {
            var str = "";
            if ((getUrlParam('page') != null) && (getUrlParam('page') != "")) str = str + "&page=" + getUrlParam('page');
            if ((getUrlParam('share') != null) && (getUrlParam('share') != "")) str = str + "&share=" + getUrlParam('share');
            if (document.all.filename.value != "") str = str + "&filename=" + document.all.filename.value;
            if (document.all.username.value != "") str = str + "&username=" + document.all.username.value;
            if (document.all.txttime1.value != "") str = str + "&txttime1=" + document.all.txttime1.value;
            if (document.all.txttime2.value != "") str = str + "&txttime2=" + document.all.txttime2.value;
            if (document.all.txtsize1.value != "") str = str + "&txtsize1=" + document.all.txtsize1.value;
            if (document.all.txtsize2.value != "") str = str + "&txtsize2=" + document.all.txtsize2.value;
            if (document.all.txttype.value != "") str = str + "&txttype=" + document.all.txttype.value;
            if (document.all.txtnote.value != "") str = str + "&txtnote=" + document.all.txtnote.value;
            if (document.all.hiddept.value != "") str = str + "&dept=" + document.all.hiddept.value;

            str = "?" + str.substring(1, str.length);
            window.location = 'admin_zyfile.aspx' + str;
        }
    </script>
</head>
<body bgcolor="#ffffff" topmargin="5" marginheight="0" marginwidth="0">
    <form id="Form1" name="Form1" method="post" runat="server">
    <div>
    </div>
    <div>
        <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
            <tbody>
                <tr>
                    <td class="menubar_title">
                        <img hspace="3" src="images/default.gif" align="absMiddle" vspace="3" border="0">&nbsp;
                        <%=type%>
                    </td>
                    <td class="menubar_readme_text" valign="bottom">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="menubar_function_text" height="1">
                        &nbsp;
                    </td>
                    <td class="menubar_menu_td" align="right">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="2" height="5">
                    </td>
                </tr>
            </tbody>
        </table>
        <table cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
            <tbody>
                <tr>
                    <td background="images/tab_top_bg.gif" height="22">
                        <table cellspacing="0" cellpadding="0" border="0">
                            <tbody>
                                <tr>
                                    <!--按钮　Start-->
                                    <td>
                                        <table height="22" cellspacing="0" cellpadding="0" border="0">
                                            <tbody>
                                                <tr>
                                                    <td width="3">
                                                        <img id="tabImgLeft__0" height="22" src="images/tab_unactive_left.gif" width="3">
                                                    </td>
                                                    <td class="tab" id="tabLabel__0" onclick="javascript:tabClick(0,2)" background="images/tab_unactive_bg.gif"
                                                        unselectable="on">
                                                        文件查看
                                                    </td>
                                                    <td width="3">
                                                        <img id="tabImgRight__0" height="22" src="images/tab_unactive_right.gif" width="3">
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                    <td>
                                        <table height="22" cellspacing="0" cellpadding="0" border="0">
                                            <tbody>
                                                <tr>
                                                    <td width="3">
                                                        <img id="tabImgLeft__1" height="22" src="images/tab_unactive_left.gif" width="3">
                                                    </td>
                                                    <td class="tab" id="tabLabel__1" onclick="javascript:tabClick(1,2)" background="images/tab_unactive_bg.gif"
                                                        unselectable="on">
                                                        搜索文件
                                                    </td>
                                                    <td width="3">
                                                        <img id="tabImgRight__1" height="22" src="images/tab_unactive_right.gif" width="3">
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#ffffff">
                        <table cellspacing="0" cellpadding="0" width="100%" border="0">
                            <tbody>
                                <tr>
                                    <td width="1" background="images/tab_bg.gif">
                                        <img height="1" src="images/tab_bg.gif" width="1">
                                    </td>
                                    <td class="borderstyle" valign="top" height="100">
                                        <div id="tabContent__0">
                                            <div style="overflow:auto;" id="dgFiles">
                                            <asp:DataGrid ID="DataGrid" runat="server" AllowSorting="True" PageSize="20" Width="100%"
                                                AutoGenerateColumns="False" CssClass="GridBody">
                                                <AlternatingItemStyle CssClass="GridLine"></AlternatingItemStyle>
                                                <ItemStyle CssClass="GridItem"></ItemStyle>
                                                <HeaderStyle CssClass="GridHead"></HeaderStyle>
                                                <Columns>
                                                    <asp:TemplateColumn HeaderText="选择">
                                                        <HeaderStyle HorizontalAlign="Center" Width="3%"></HeaderStyle>
                                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                        <HeaderTemplate>
                                                            <input type="checkbox" name="chkSelect" id="chkSelect" onclick='checkAll();' />
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <input id="chkSelect" onclick="AddRemoveValues(this)" type="checkbox" value='<%#DataBinder.Eval(Container.DataItem,"id")%>'
                                                                name="checkbox">
                                                        </ItemTemplate>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn SortExpression="filename" HeaderText="文件名">
                                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                                        <ItemTemplate>
                                                            <%# showfile(DataBinder.Eval(Container, "DataItem.username").ToString()+DataBinder.Eval(Container, "DataItem.postion").ToString()+DataBinder.Eval(Container, "DataItem.filename").ToString(),DataBinder.Eval(Container, "DataItem.filename").ToString()) %>
                                                        </ItemTemplate>
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn SortExpression="filesize" HeaderText="大小">
                                                        <HeaderStyle HorizontalAlign="Center" Width="10%"></HeaderStyle>
                                                        <ItemStyle HorizontalAlign="Right"></ItemStyle>
                                                        <ItemTemplate>
                                                            <%# showsize(DataBinder.Eval(Container, "DataItem.filesize").ToString()) %>
                                                        </ItemTemplate>
                                                    </asp:TemplateColumn>
                                                    <asp:HyperLinkColumn Text="用户名" DataNavigateUrlField="username" DataNavigateUrlFormatString="admin_edituser.aspx?username={0}"
                                                        DataTextField="username" SortExpression="username" HeaderText="用户名">
                                                        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                    </asp:HyperLinkColumn>
                                                    <asp:BoundColumn DataField="lasttime" SortExpression="lasttime" HeaderText="上传时间">
                                                        <HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
                                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                    </asp:BoundColumn>
                                                    <asp:TemplateColumn SortExpression="userrole" HeaderText="资源">
                                                        <ItemTemplate>
                                                            <%# showzy(Eval("iszy").ToString()) %>
                                                        </ItemTemplate>
                                                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                            Font-Underline="False" HorizontalAlign="Center" Width="5%" />
                                                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                            Font-Underline="False" HorizontalAlign="Center" />
                                                    </asp:TemplateColumn>
                                                    <asp:TemplateColumn SortExpression="markzy" HeaderText="已审核">
                                                        <ItemTemplate>
                                                            <%# showzy(Eval("markzy").ToString())%>
                                                        </ItemTemplate>
                                                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                            Font-Underline="False" HorizontalAlign="Center" Width="8%" />
                                                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                            Font-Underline="False" HorizontalAlign="Center" />
                                                    </asp:TemplateColumn>
                                                     <asp:TemplateColumn SortExpression="userrole" HeaderText="是否推荐">
                                                        <ItemTemplate>
                                                            <%# showzy(Eval("IsRecommendZY").ToString())%>
                                                        </ItemTemplate>
                                                        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                            Font-Underline="False" HorizontalAlign="Center" Width="5%" />
                                                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
                                                            Font-Underline="False" HorizontalAlign="Center" />
                                                    </asp:TemplateColumn>
                                                </Columns>
                                                <PagerStyle PageButtonCount="20" Mode="NumericPages"></PagerStyle>
                                            </asp:DataGrid>
                                            </div><br>
                                            <div align="right">
                                                <webdiyer:AspNetPager ID="Pager" runat="server" PageSize="20" CssClass="page" Height="20px"
                                                    LastPageText="<font face=webdings>:</font>" NextPageText="<font face=webdings>4</font>"
                                                    PrevPageText="<font face=webdings>3</font>" FirstPageText="<font face=webdings>9</font>"
                                                    ShowBoxThreshold="21" HorizontalAlign="Right" NumericButtonCount="15" ShowCustomInfoSection="Left"
                                                    AlwaysShow="True" OnPageChanged="Pager_PageChanged">
                                                </webdiyer:AspNetPager>
                                            </div>
                                            勾选记录：
                                            
                                                        <asp:button class="formbutton" id="btnAllowzy" runat="server" Text="允许资源发布" 
                                                        onclick="btnAllowzy_Click" ></asp:button>
                                                        <asp:button class="formbutton" id="btnRefusezy" runat="server" Text="拒绝资源发布" 
                                                        onclick="btnRefusezy_Click" ></asp:button>
                                        </div>
                                        <div id="tabContent__1">
                                            <table cellspacing="1" cellpadding="3" width="100%" align="center" border="0">
                                                <tbody>
                                                    <tr>
                                                        <td class="table_body" width="22%">
                                                            <font face="宋体">用户名</font>
                                                        </td>
                                                        <td class="table_none" width="78%">
                                                            <font face="宋体">
                                                                <input class="tableTdtext" id="username" type="text" size="20" name="username" runat="server">
                                                                （可模糊输入，不填为不限）</font>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body" width="22%">
                                                            文件名
                                                        </td>
                                                        <td class="table_none" width="78%">
                                                            <input class="tableTdtext" id="filename" type="text" size="20" name="filename" runat="server">
                                                            （精确输入，不填为不限）
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            上传时间
                                                        </td>
                                                        <td class="table_none">
                                                            <input id="txttime1" type="text" size="20" name="txttime1" style="border-color:#ddd;" class="tableTdtext"
                                                                runat="server" onfocus="new Calendar().show(this)">&nbsp;
                                                            －&nbsp;&nbsp;<input id="txttime2" type="text" size="20" name="txttime2" class="tableTdtext"
                                                                runat="server" onfocus="new Calendar().show(this)">
                                                            （不填为不限）
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            文件大小
                                                        </td>
                                                        <td class="table_none">
                                                            <input class="tableTdtext" id="txtsize1" name="txtsize1" runat="server">
                                                            KB－
                                                            <input class="tableTdtext" id="txtsize2" name="txtsize2" runat="server">
                                                            KB（不填为不限）
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            文件类型
                                                        </td>
                                                        <td class="table_none">
                                                            <input class="tableTdtext" id="txttype" name="txttype" runat="server">
                                                            （输入扩展名，用半角,分隔，不填为不限）
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            文件注释
                                                        </td>
                                                        <td class="table_none">
                                                            <input class="tableTdtext" id="txtnote" name="txtnote" runat="server">
                                                            （不填为不限）
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            所属部门
                                                        </td>
                                                        <td class="table_none">
                                                            <select id="dept" onchange="javascript:document.all.hiddept.value=this.value;" name="dept"
                                                                runat="server">
                                                                <option value="" selected>全部部门</option>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td class="table_body">
                                                            &nbsp;
                                                        </td>
                                                        <td class="table_none">
                                                            <input class="btn" id="submit2" onclick="gosearch();" type="button" value=" 查 找 "
                                                                name="submit22">
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                        <!--内容框Start-->
                                    </td>
                                    <td width="1" background="images/tab_bg.gif">
                                        <img height="1" src="images/tab_bg.gif" width="1">
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td background="images/tab_bg.gif" bgcolor="#ffffff">
                        <img height="1" src="images/tab_bg.gif" width="1">
                    </td>
                </tr>
            </tbody>
        </table>
        <!--选项卡 End-->
    </div>
    <div>
        <div align="center">
        </div>
    </div>
    <input id="hiddept" type="hidden" name="hiddept" runat="server">
    <input id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server">
    </form>
    <script language="javascript">
        setTimeout(function () {
            $("#dgFiles").css("height", $(window).height() - 200 + "px"); 
        }, 100);
        function tabClick(idx, count) {

            for (i_tr = 0; i_tr < count; i_tr++) {
                if (i_tr == idx) {
                    var tabImgLeft = eval('document.all.tabImgLeft__' + idx);
                    var tabImgRight = eval('document.all.tabImgRight__' + idx);
                    var tabLabel = eval('document.all.tabLabel__' + idx);
                    var tabContent = eval('document.all.tabContent__' + idx);

                    tabImgLeft.src = 'images/tab_active_left.gif';
                    tabImgRight.src = 'images/tab_active_right.gif';
                    tabLabel.background = 'images/tab_active_bg.gif';
                    tabContent.style.visibility = 'visible';
                    tabContent.style.display = 'block';
                    continue;
                }
                var tabImgLeft = eval('document.all.tabImgLeft__' + i_tr);
                var tabImgRight = eval('document.all.tabImgRight__' + i_tr);
                var tabLabel = eval('document.all.tabLabel__' + i_tr);
                var tabContent = eval('document.all.tabContent__' + i_tr);

                tabImgLeft.src = 'images/tab_unactive_left.gif';
                tabImgRight.src = 'images/tab_unactive_right.gif';
                tabLabel.background = 'images/tab_unactive_bg.gif';
                tabContent.style.visibility = 'hidden';
                tabContent.style.display = 'none';
            }
        }
        tabClick(0, 2);
    </script>
    <br>
</body>
</html>
