<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<%@ Page CodeBehind="search_user.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.search_user" %>
<%@ 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 -->
         <uc1:usertop runat="server" ID="usertop" />
    <uc1:userleft runat="server" ID="userleft" />
    <!-- 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/users.gif" width="16" height="16" align="absMiddle">&nbsp;&nbsp;&nbsp;&nbsp;<h5><b>查找用户（点击表头可升降排序，点击用户名查看详细信息）</b></h5></div>
					<form id="Form1" method="post" runat="server">
						 <div class="<%=Webdisk.DAL.Config.IsMobile %>">
<div class="tip" id="dlock" runat="server"><img src="pics/tip.gif" align="absMiddle">&nbsp;请在需要选择目的路径的用户左侧点击“列出目录”链接，仅显示有权限的目录，然后直接点击目标目录</div>
                                       <div class="<%=Webdisk.DAL.Config.IsMobile %>">
											<asp:datagrid id="DataGrid" runat="server" AutoGenerateColumns="False" Width="100%" PageSize="20"
												AllowSorting="True" CssClass="table-hover" BorderStyle="None" BorderWidth="0px" GridLines="None" AlternatingItemStyle-CssClass="GridMove">

<ItemStyle CssClass="GridItem"></ItemStyle>
                                    <HeaderStyle CssClass="GridHead"></HeaderStyle>

<Columns>
<asp:TemplateColumn HeaderText="选择">
	<HeaderStyle HorizontalAlign="Center" Width="5%"></HeaderStyle>
	<ItemStyle HorizontalAlign="Center"></ItemStyle>
	<HeaderTemplate>
		<div class="custom-control custom-checkbox mr-0">
												<input type="checkbox" class="custom-control-input" id="customCheckAll">
												<label class="custom-control-label" for="customCheckAll"></label>
											</div>
	</HeaderTemplate>
	<ItemTemplate>
         <div class="custom-control custom-checkbox mr-0">
		<INPUT id=chkSelect<%# Eval("id") %> class='custom-control-input' onclick=AddRemoveValues(this) type=checkbox value='<%#DataBinder.Eval(Container.DataItem,"uusername")%>' name=checkbox>
              <label class="custom-control-label" for="chkSelect<%# Eval("id") %>"></label></div>
	</ItemTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="" HeaderText="列出目录" CancelText="取消查看" EditText="列出目录">
<HeaderStyle HorizontalAlign="Center" Width="10%">
</HeaderStyle>

<ItemStyle HorizontalAlign="Center">
</ItemStyle>
</asp:EditCommandColumn>
<asp:TemplateColumn HeaderText="用户名">
<HeaderStyle HorizontalAlign="Center" Width="15%">
</HeaderStyle>

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

<HeaderTemplate>
<%=uusername%>
</HeaderTemplate>

<ItemTemplate>
<asp:HyperLink id=HyperLink1 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.uusername") %>' NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.uusername", "userinfo.aspx?username={0}") %>'></asp:HyperLink>
</ItemTemplate>
<EditItemTemplate>
<div align=left><%# showdir(DataBinder.Eval(Container, "DataItem.uusername").ToString()) %></div>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="注册时间">
<HeaderStyle HorizontalAlign="Center" Width="15%">
</HeaderStyle>

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

<HeaderTemplate>
<%=regdate%>
</HeaderTemplate>

<ItemTemplate>
<%# DataBinder.Eval(Container, "DataItem.regdate", "{0:yyyy-MM-dd}") %>
</ItemTemplate>

</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="真实姓名">
<HeaderStyle HorizontalAlign="Center" Width="10%">
</HeaderStyle>

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

<HeaderTemplate>
<%=realname%>
</HeaderTemplate>

<ItemTemplate>
<%# DataBinder.Eval(Container, "DataItem.realname") %>
</ItemTemplate>

</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="性别">
<HeaderStyle HorizontalAlign="Center" Width="8%">
</HeaderStyle>

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

<HeaderTemplate>
<%=sex%>
</HeaderTemplate>

<ItemTemplate>
<%# DataBinder.Eval(Container, "DataItem.sex") %>
</ItemTemplate>

</asp:TemplateColumn>
<asp:BoundColumn DataField="recommend" HeaderText="空间介绍" ReadOnly="True" >
<HeaderStyle HorizontalAlign="Center">
</HeaderStyle>
</asp:BoundColumn>
</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" AlwaysShow="True" ShowCustomInfoSection="Left"
											 HorizontalAlign="Right" NumericButtonCount="5" UrlPaging="True" FirstPageText="|<" PrevPageText="<" NextPageText=">" LastPageText=">|" Height="20px" CustomInfoTextAlign="Left"></webdiyer:aspnetpager><br>
											<table width="100%" border="0">
                                              <tr>
                                                <td id="showpro" runat="server"><div class="row align-items-center justify-content-center">&nbsp;&nbsp;&nbsp;&nbsp;对勾选用户：
                                                  <input class="btn btn-outline-light" id="butfriend" type="button" value="加为好友" name="butfriend" runat="server" onserverclick="butfriend_ServerClick">&nbsp;&nbsp;
                                              
                                                  <input name="butadd" type="button" class="btn btn-outline-light" onclick="adduser();" value="添加用户">&nbsp;&nbsp;
                                           
                                                  <INPUT id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server">
                                                   <div id="showshare" class="row" >
                                                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;权限：<div class="custom-control custom-checkbox mr-3"><input type="checkbox" name="ShareSee" id="ShareSee" class="custom-control-input">
                                                  <label class="custom-control-label" for="ShareSee">列表</label></div>
                                                 <div class="custom-control custom-checkbox mr-3"> <input type="checkbox" name="ShareAdd" id="ShareAdd" class="custom-control-input">
                                                    <label class="custom-control-label" for="ShareAdd">添加</label></div>
                                                    <div class="custom-control custom-checkbox mr-3"><input type="checkbox" name="ShareEdit" id="ShareEdit" class="custom-control-input">
                                                    <label class="custom-control-label" for="ShareEdit">修改</label></div>
                                                    <div class="custom-control custom-checkbox mr-3"><input type="checkbox" name="ShareDel" id="ShareDel" class="custom-control-input">
                                                    <label class="custom-control-label" for="ShareDel">删除</label></div>

                                                 <div class="custom-control custom-checkbox mr-3"> <input type="checkbox" name="ShareDown" id="ShareDown" class="custom-control-input">
												<label class="custom-control-label" for="ShareDown">下载</label></div>                                                
                                                 </div></div></td>
                                              </tr>
                                              <tr>
                                                <td id="showpro3" runat="server">&nbsp;</td>
                                              </tr>
                                              <tr>
                                                <td id="showpro2" runat="server"><div class="row align-items-center justify-content-center">&nbsp;&nbsp;&nbsp;&nbsp;查找用户：
                                                  <input name="key" class="form-control" style="width:20%" id="key" value='<%if (Request["key"]!=null) Response.Write(Request["key"].ToString());%>' onkeydown="EnterKey('Submit2')" placeholder="输入用户名">&nbsp;&nbsp;
                                                  <input class="btn btn-outline-light" id="Submit2" type="button" value=" 查 找 " name="submit2" onclick="gosearch();">&nbsp;&nbsp;
                                                   &nbsp;
                                                    <div class="custom-control custom-checkbox mr-3">
                                                  <input name="mo" type="checkbox" class="custom-control-input" id="mo" value="1"  <%if ((Request["mo"]!=null) && (Request["mo"].ToString()=="true")) Response.Write("checked");%>/>
                                                <label class="custom-control-label" for="mo">模糊查找</label> </div></div></td>
                                              </tr>
                                            </table></form>
			    </div>
			    </div>

   </div></div></div>
    <!-- end::main content -->
</body>
</html>			
<!-- Plugin scripts -->
 <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>
<script src="js/function.js"></script>
			<script>
                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 ((getUrlParam('addtype') != null) && (getUrlParam('addtype') != "")) str = str + "&addtype=" + getUrlParam('addtype');
                    if ((getUrlParam('sel') != null) && (getUrlParam('sel') != "")) str = str + "&sel=1";
                    window.location = 'search_user.aspx?key=' + document.all.key.value + '&mo=' + document.all.mo.checked + str;
                }
                function adduser() {
                    window.opener.document.getElementById("Hidden1").value = document.getElementById("HdnSelectedValues").value;
                    window.opener.document.getElementById("type").value = document.getElementById("ShareSee").checked + "," + document.getElementById("ShareAdd").checked + "," + document.getElementById("ShareEdit").checked + "," + document.getElementById("ShareDel").checked + "," + document.getElementById("ShareDown").checked;
                    window.opener.setopt();
                   // window.opener.document.getElementById("Form1").submit();
                    window.opner = null;
                    window.close();
                }
                function setvalue(str) {
                    window.opener.setvalue(str);
                    window.opner = null;
                    window.close();
                }
                if (getUrlParam('addtype') != "") {
                    document.getElementById("butfriend").style.display = 'none';
                    document.getElementById("ShareSee").checked = true;
                    switch (getUrlParam('addtype')) {
                        case "2":
                            document.getElementById("ShareAdd").checked = true;
                            break;
                        case "3":
                            document.getElementById("ShareEdit").checked = true;
                            break;
                        case "4":
                            document.getElementById("ShareDel").checked = true;
                            break;
                        case "5":
                            document.getElementById("ShareDown").checked = true;
                            break;
                    }
                }
                else {
                    document.getElementById("butadd").style.display = 'none';
                    document.getElementById("showshare").style.display = 'none';
                }
                function EnterKey(ButtonId) {
                    if (event.keyCode == 13) {
                        document.all(ButtonId).focus();
                    }
                }
            </script>