<%@ Page CodeBehind="allshare.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.allshare" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<%@ Register Src="~/userleft.ascx" TagPrefix="uc1" TagName="userleft" %>
<%@ Register Src="~/usertop.ascx" TagPrefix="uc1" TagName="usertop" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>全部共享文件</title>
     <link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/atlantis.css">
	
</head>
<body>
 <div class="wrapper">
<!-- begin::navigation -->
    <asp:PlaceHolder ID="phContro12" runat="server"></asp:PlaceHolder>
   <asp:PlaceHolder ID="phControl" runat="server"></asp:PlaceHolder>
<!-- end::navigation -->

 <div class="main-panel">

        <div class="content">
            <div class="page-inner">

        <div >

           <div class="card">
			    <div class="card-body">
							<div class="row">&nbsp;&nbsp;&nbsp;&nbsp;<img src="pics/folder2.gif" width="16" height="16" align="absMiddle">&nbsp;&nbsp;&nbsp;&nbsp;<h5><b>全部共享文件</b></h5></div>
					<div class="row align-items-center">
									  &nbsp;&nbsp;&nbsp;&nbsp;查看好友共享文件：
											<div class="col-auto my-1">
											<select class="form-control" name="friend" id="friend" runat="server" onChange="gosearch();">
									        </select>
                                                </div>
											查看大类：
											<div class="col-auto my-1">
											<select class="form-control" name="kind1" id="kind1" runat="server" onChange="gosearch();">
									        </select>
                                                </div>
											查看小类：
											<div class="col-auto my-1">
											<select class="form-control" name="kind2" id="kind2" runat="server" onChange="gosearch();">
											  <option selected>全部</option>
									        </select>
                                               </div>
										    <span id="showme" runat=server>
                                                 <div class="custom-control custom-checkbox mr-2">
                                                <input name="me" class='custom-control-input' type="checkbox" id="me" runat="server" onclick="gosearch();">
                  <label class="custom-control-label" for=me>只列出指定共享给我的文件</label></div>
										    </span></div>
                    <form id="Form1" method="post" runat="server">
						 <div class="<%=Webdisk.DAL.Config.IsMobile %>"><asp:datagrid id="DataGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False" Width="100%" CssClass="table-hover" EnableViewState="False" BorderStyle="None" BorderWidth="0px" GridLines="None" AlternatingItemStyle-CssClass="GridMove">
												<ItemStyle CssClass="GridItem"></ItemStyle>
                                    <HeaderStyle CssClass="GridHead"></HeaderStyle>
<Columns>
<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Center" Width="8%"></HeaderStyle>

<ItemStyle HorizontalAlign="Center"></ItemStyle>

<HeaderTemplate>
<%=FileExt%></HeaderTemplate>

<ItemTemplate>
<%# ShowType(DataBinder.Eval(Container.DataItem, "FileExt").ToString()) %></ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

<HeaderTemplate>
<%=FileName%></HeaderTemplate>

<ItemTemplate>
<%# ShowFileName(DataBinder.Eval(Container.DataItem, "FileName").ToString(),DataBinder.Eval(Container.DataItem, "UserName").ToString()+DataBinder.Eval(Container.DataItem, "Postion").ToString(),DataBinder.Eval(Container, "DataItem.top").ToString(),DataBinder.Eval(Container, "DataItem.good").ToString(),DataBinder.Eval(Container, "DataItem.note").ToString()) %></ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>

<ItemStyle HorizontalAlign="Center"></ItemStyle>

<HeaderTemplate>
<%=UserName%></HeaderTemplate>

<ItemTemplate>
<asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.UserName", "userinfo.aspx?username={0}") %>' Text='<%# DataBinder.Eval(Container, "DataItem.UserName") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Center" Width="10%"></HeaderStyle>

<ItemStyle HorizontalAlign="Right"></ItemStyle>

<HeaderTemplate>
<%=FileSize%></HeaderTemplate>

<ItemTemplate>
<%# ShowSize(DataBinder.Eval(Container.DataItem, "FileSize").ToString()) %></ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>

<ItemStyle HorizontalAlign="Center"></ItemStyle>

<HeaderTemplate>
<%=LastTime%></HeaderTemplate>

<ItemTemplate>
<%# DataBinder.Eval(Container, "DataItem.LastTime", "{0:yyyy-MM-dd}") %></ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="查看目录">
<HeaderStyle HorizontalAlign="Center" Width="10%"></HeaderStyle>

<ItemStyle HorizontalAlign="Center"></ItemStyle>

<ItemTemplate>
<%# ShowOther(DataBinder.Eval(Container.DataItem, "UserName").ToString()+DataBinder.Eval(Container.DataItem, "Postion").ToString()) %></ItemTemplate>
</asp:TemplateColumn>
</Columns>

<PagerStyle PageButtonCount="20" Mode="NumericPages"></PagerStyle>
										</asp:datagrid><br></div>
										 <div class="hidden-sm hidden-md hidden-lg text-center"><%=sjinfo %><p></div>
                        <webdiyer:AspNetPager CssClass="paginator"  CurrentPageButtonClass="cpb" PagingButtonSpacing="0" id="Pager" runat="server" PageSize="20" HorizontalAlign="Right" AlwaysShow="True"
											ShowCustomInfoSection="Left" NumericButtonCount="5" UrlPaging="True" FirstPageText="|<" PrevPageText="<" NextPageText=">" LastPageText=">|" Height="20px" CustomInfoTextAlign="Left"></webdiyer:AspNetPager><br>
									 <div align="center"><button id="but" type="button" class="btn btn-outline-success" onClick="javascript:document.getElementById('search').style.display=(document.getElementById('search').style.display=='none' ? '' : 'none');document.getElementById('but').value=(document.getElementById('but').value=='↓高级查找↓' ? '↑高级查找↑' : '↓高级查找↓');">↓高级查找↓</button>
                                                     
                                                     <p>
												<div class="col-sm" id="search" style="DISPLAY:none">
													 <div class="form-group row">
														<label for="inputEmail3" class="col-sm-2 col-form-label">文件名</label>
														<div class="col-sm">
														  <input type="text" class="form-control" id="key" value='' runat="server" placeholder="可模糊输入，不填为不限">
														</div>
													  </div>
													   <div class="form-group row">
														<label for="inputEmail3" class="col-sm-2 col-form-label">用户名</label>
														<div class="col-sm">
														  <input type="text" class="form-control" id="user" value='' runat="server" placeholder="精确输入，不填为不限">
														</div>
													  </div>
													 <div class="form-group row">
														<label for="inputEmail3" class="col-sm-2 col-form-label">更新时间</label>
														  <div class="col">
														 <input type="text" id="txttime1" name="daterangepicker" class="form-control" placeholder="不选为不限" onFocus="new Calendar().show(this);" runat="server" value=''>
														</div>
														 <span>
															 -
															 </span>
														   <div class="col">
														 <input type="text" id="txttime2" name="daterangepicker" class="form-control" placeholder="不选为不限" onFocus="new Calendar().show(this);" runat="server" value=''>
														</div>
													  </div>
													<div class="form-group row" id="show1" runat="server">
														<label for="inputEmail3" class="col-sm-2 col-form-label">文件大小</label>
														  <div class="col">
														 <input type="text" id="txtsize1" class="form-control" placeholder="不填为不限"  runat="server"  value=''>
														</div>
														 <span>
															 KB－
															 </span>
														   <div class="col">
														 <input type="text" id="txtsize2" class="form-control" placeholder="不填为不限"  runat="server" value=''>
														</div><span>
															 KB
															 </span>
													  </div>
													 <div class="form-group row" id="show2" runat="server">
														<label for="inputEmail3" class="col-sm-2 col-form-label">文件类型</label>
														<div class="col-sm">
														  <input type="text" class="form-control" id="txttype" placeholder="输入扩展名，用半角,分隔，不填为不限"  runat="server" value=''>
														</div>
													  </div>
													 <div class="form-group row">
														<label for="inputEmail3" class="col-sm-2 col-form-label">文件注释</label>
														<div class="col-sm">
														  <input type="text" class="form-control" id="txtnote" placeholder="不填为不限"  runat="server" value=''>
														</div>
													  </div>
													
													<button type="button" class="btn btn-primary" onClick="gosearch();"> 查 找 </button>
												</div>
													 </div></form>
			    </div>
        </div>

    </div></div></div>
    <!-- end::main content -->
</body>
</html>			
 <script type="text/javascript" src="js/calendar.js"></script>
<script src="js/jquery.3.2.1.min.js"></script>
	<script src="js/popper.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<!-- jQuery UI -->
	<script src="js/jquery-ui.min.js"></script>
	<script src="js/jquery.ui.touch-punch.min.js"></script>
	
	<!-- jQuery Scrollbar -->
	<script src="js/jquery.scrollbar.min.js"></script>
	<!-- Atlantis JS -->
	<script src="js/webfont.min.js"></script>
	<script src="js/atlantis.js"></script>

<!-- Dashboard scripts -->
<script src="js/function.js"></script>		<script language="javascript">
            var CalendarWebControl = new atCalendarControl();
        </script>	

<script language="JAVASCRIPT">
    function show(tips, flag, url) {
        var my_tips = document.all.mytips;
        if (flag) {
            if (my_tips.style.display == "none") {
                my_tips.style.display = "";
                if (url != null) { my_tips.innerHTML = "<div align=center><img src='" + url + "' width=100 height=100 onload=DrawImage(this)><br>" + tips + "</div>"; }
                else { my_tips.innerHTML = tips; }
            }
            my_tips.style.left = event.clientX + 10;
            my_tips.style.top = event.clientY + 10;
        }
        else {
            my_tips.style.display = "none";
        }
    }
    function DrawImage(ImgD) {
        var image = new Image();
        image.src = ImgD.src;
        if (image.width > 0 && image.height > 0) {
            flag = true;
            if (image.width / image.height >= 120 / 80) {
                if (image.width > 120) {
                    ImgD.width = 100;
                    ImgD.height = (image.height * 100) / image.width;
                } else {
                    ImgD.width = image.width;
                    ImgD.height = image.height;
                }

            }
            else {
                if (image.height > 100) {
                    ImgD.height = 100;
                    ImgD.width = (image.width * 100) / image.height;
                } else {
                    ImgD.width = image.width;
                    ImgD.height = image.height;
                }

            }
        }
    }

    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('type') != null) && (getUrlParam('type') != "")) str = "&type=" + getUrlParam('type');
        if ((getUrlParam('asc') != null) && (getUrlParam('asc') != "")) str = str + "&asc=" + getUrlParam('asc');
        if ((getUrlParam('page') != null) && (getUrlParam('page') != "")) str = str + "&page=" + getUrlParam('page');
        if (document.all.key.value != "") str = str + "&key=" + escape(document.all.key.value);
        if (document.all.friend.value != "未指定") str = str + "&friend=" + escape(document.all.friend.value);
        if (document.all.kind1.value != "全部") str = str + "&kind1=" + escape(document.all.kind1.value);
        if (document.all.kind2.value != "全部") str = str + "&kind2=" + escape(document.all.kind2.value);
        if (document.all.me.checked == true) str = str + "&me=1";
        if (document.all.user.value != "") str = str + "&user=" + escape(document.all.user.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=" + escape(document.all.txtnote.value);
        str = "?" + str.substring(1, str.length);
        window.location = 'allshare.aspx' + str;
    }
    if (getUrlParam('key') != "") $("#key").val(unescape(getUrlParam('key')));
    if (getUrlParam('user') != "") $("#user").val(unescape(getUrlParam('user')));
    if (getUrlParam('txttime1') != "") $("#txttime1").val(getUrlParam('txttime1'));
    if (getUrlParam('txttime2') != "") $("#txttime2").val(getUrlParam('txttime2'));
    if (getUrlParam('txtsize1') != "") $("#txtsize1").val(getUrlParam('txtsize1'));
    if (getUrlParam('txtsize2') != "") $("#txtsize2").val(getUrlParam('txtsize2'));
    if (getUrlParam('txttype') != "") $("#txttype").val(getUrlParam('txttype'));
    if (getUrlParam('txtnote') != "") $("#txtnote").val(unescape(getUrlParam('txtnote')));
    if ((getUrlParam('key') != "") || (getUrlParam('user') != "") || (getUrlParam('txttime1') != "") || (getUrlParam('txttime2') != "") || (getUrlParam('txtsize1') != "") || (getUrlParam('txtsize2') != "") || (getUrlParam('txttype') != "") || (getUrlParam('txtnote') != "")) document.getElementById("but").click();
</script>