<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<%@ Page CodeBehind="search_user.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.search_user" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
		<% @ Import Namespace="Webdisk" %>
		<link href="<%=xml.GetStyle()%>" rel="stylesheet" type="text/css">
		<script type="text/javascript" language="javascript" src="js/function.js"></script>
			<script language="JAVASCRIPT">
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.Form1.Hidden1.value=document.all.HdnSelectedValues.value;
window.opener.document.Form1.type.value=document.getElementById("ShareSee").checked+","+document.getElementById("ShareAdd").checked+","+document.getElementById("ShareEdit").checked+","+document.getElementById("ShareDel").checked+","+document.getElementById("ShareDown").checked;
window.opener.document.Form1.submit();
window.opner=null;
window.close();
}
function setvalue(str){
　　window.opener.setvalue(str);
　　window.opner=null;
　　window.close();
}
</script>
  <title>查找用户</title></HEAD>
	<body topMargin="0">
		<form id="Form1" method="post" runat="server">
			<br>
			<div align="center">
				<TABLE cellSpacing="0" cellPadding="0" width="98%" align="center">
					<TR>
						<TD width="5" background="pics/wenbenkuan_02.gif"><IMG height="5" src="pics/wenbenkuan_01.gif" width="5"></TD>
						<TD width="874" background="pics/wenbenkuan_02.gif"><IMG height="5" src="pics/wenbenkuan_02.gif" width="5"></TD>
						<TD><IMG height="5" src="pics/wenbenkuan_03.gif" width="5"></TD>
					</TR>
					<TR>
						<TD background="pics/wenbenkuan_04.gif">&nbsp;</TD>
						<TD class="tablebg" background="pics/wenbenkuan_05.gif"><TABLE width="100%">
								<TR>
									<TD width="100%" class="tabletop"><img src="pics/users.gif" width="18" height="18" align="absmiddle"> 查找用户（点击表头可升降排序，点击用户名查看详细信息）&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1);"><img src="pics/link_back.gif" border="0" align="absmiddle"></a></TD>
								</TR>
								<TR class="tablebg">
									<TD><div class="tip" id="dlock" runat="server"><img src="pics/tip.gif" align="absMiddle">&nbsp;请在需要选择目的路径的用户左侧点击“列出目录”链接，仅显示有权限的目录，然后直接点击目标目录</div><div align="center">
											<asp:datagrid id="DataGrid" runat="server" AutoGenerateColumns="False" Width="100%" PageSize="20"
												AllowSorting="True" CssClass="GridBody">
<AlternatingItemStyle CssClass="GridLine">
</AlternatingItemStyle>

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

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

<Columns>
<asp:TemplateColumn HeaderText="选择">
	<HeaderStyle HorizontalAlign="Center" Width="5%"></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,"uusername")%>' name=checkbox>
	</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="5%">
</HeaderStyle>

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

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

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

</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="主页">
<HeaderStyle HorizontalAlign="Center">
</HeaderStyle>

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

<HeaderTemplate>
<%=url%>
</HeaderTemplate>

<ItemTemplate>
<a href="<%# DataBinder.Eval(Container, "DataItem.url") %>" target=_blank><%# DataBinder.Eval(Container, "DataItem.url") %></a>
</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>
											<webdiyer:aspnetpager id="Pager" runat="server" PageSize="20" AlwaysShow="True" ShowCustomInfoSection="Left"
												ShowBoxThreshold="21" HorizontalAlign="Right" NumericButtonCount="15" UrlPaging="True" FirstPageText="<font face=webdings>9</font>" PrevPageText="<font face=webdings>3</font>" NextPageText="<font face=webdings>4</font>" LastPageText="<font face=webdings>:</font>" Height="20px"></webdiyer:aspnetpager><br>
											<table width="100%" border="0">
                                              <tr>
                                                <td id="showpro" runat="server">对勾选用户：
                                                  <input class="btn" id="butfriend" type="button" value="加为好友" name="butfriend" runat="server" onserverclick="butfriend_ServerClick">
                                                  <STRONG>
                                                  <INPUT name="butadd" type="button" class="btn" onClick="adduser();" value="添加用户">
                                                  </STRONG>
                                                  <INPUT id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server">
                                                  <span id="showshare">
                                                  权限：<input type="checkbox" name="ShareSee" id="checkbox">
                                                  列表
                                                  <input type="checkbox" name="ShareAdd" id="checkbox2">
                                                    添加
                                                    <input type="checkbox" name="ShareEdit" id="checkbox3">
                                                    修改
                                                    <input type="checkbox" name="ShareDel" id="checkbox4">
                                                    删除

                                                  <input type="checkbox" name="ShareDown" id="checkbox5">
													下载                                                  </span></td>
                                                <td><div align="right"><strong>查找用户：</strong>
                                                  <input name="key" class="kuan" id="key" value='<%if (Request["key"]!=null) Response.Write(Request["key"].ToString());%>' onkeydown="EnterKey('Submit2')">
                                                  <input class="btn" id="Submit2" type="button" value=" 查 找 " name="submit2" onClick="gosearch();">
                                                    <strong>（请输入用户名）</strong>&nbsp;
                                                  <input name="mo" type="checkbox" id="mo" value="1"  <%if ((Request["mo"]!=null) && (Request["mo"].ToString()=="true")) Response.Write("checked");%>/>
                                                模糊查找 </div></td>
                                              </tr>
                                            </table>
										</div>
									</TD>
								</TR>
							</TABLE>
						</TD>
						<TD width="5" background="pics/wenbenkuan_06.gif"><IMG height="5" src="pics/wenbenkuan_06.gif" width="5"></TD>
					</TR>
					<TR>
						<TD background="pics/wenbenkuan_08.gif"><IMG height="5" src="pics/wenbenkuan_07.gif" width="5"></TD>
						<TD background="pics/wenbenkuan_08.gif"><IMG height="5" src="pics/wenbenkuan_08.gif" width="5"></TD>
						<TD><IMG height="5" src="pics/wenbenkuan_09.gif" width="5"></TD>
					</TR>
				</TABLE>
			</div>
		</form>
	</body>
</HTML>
<script>
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>