<%@ Page CodeBehind="allshare.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.allshare" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
		<% @ Import Namespace="Webdisk" %>
		<link href="<%=xml.GetStyle()%>" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="js/calendar.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 over(obj){
obj.className=(obj.className == "GridMove" ? "GridItem" : "GridMove")
}

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="+document.all.key.value;
	if (document.all.friend.value!="未指定") str=str+"&friend="+document.all.friend.value;
	if (document.all.kind1.value!="全部") str=str+"&kind1="+document.all.kind1.value;
	if (document.all.kind2.value!="全部") str=str+"&kind2="+document.all.kind2.value;
	if (document.all.me.checked == true) str=str+"&me=1";
	if (document.all.user.value!="") str=str+"&user="+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="+document.all.txtnote.value;
	str="?"+str.substring(1,str.length);
	window.location='allshare.aspx'+str;
}
			</script>
            <style type="text/css">
.STYLE1 { COLOR: #0000ff }
</style>
</HEAD>
	<body topMargin="0">
		<DIV id="mytips" style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; DISPLAY: none; FONT-SIZE: 9pt; FILTER: progid: DXImageTransform.Microsoft.Shadow(color=#999999,direction=135,strength=3); BORDER-LEFT: gray 1px solid; WIDTH: 150px; COLOR: red; BORDER-BOTTOM: gray 1px solid; POSITION: absolute; HEIGHT: 16px; BACKGROUND-COLOR: #ffffff">
			<p>&nbsp;</p>
			<p>&nbsp;</p>
		</DIV>
		<form id="Form1" method="post">
			<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 background="pics/wenbenkuan_05.gif" class="tablebg"><TABLE width="100%">
								<TR>
									<TD width="100%" class="tabletop"><img src="pics/folder2.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 class="tablebg">
									<TD height=23><div align="center">
									  查看好友共享文件：
											
											<select name="friend" id="friend" runat="server" onChange="gosearch();">
									        </select>
											查看大类：
											
											<select name="kind1" id="kind1" runat="server" onChange="gosearch();">
									        </select>
											查看小类：
											
											<select name="kind2" id="kind2" runat="server" onChange="gosearch();">
											  <option selected>全部</option>
									        </select>
										    <span id="showme" runat=server><INPUT name=me type=checkbox id=me runat="server" onClick="gosearch();">
                  <label for=me><span class="STYLE1">只列出指定共享给我的文件</span></label>
										    </span>
									</div>									</TD>
								</TR>
								<TR class="tablebg">
									<TD><asp:datagrid id="DataGrid" runat="server" AllowSorting="True" AutoGenerateColumns="False" Width="100%" CssClass="GridBody" EnableViewState="False">
<AlternatingItemStyle CssClass="GridLine"></AlternatingItemStyle>

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

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

<Columns>
<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Center" Width="5%"></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>
										<webdiyer:AspNetPager id="Pager" runat="server" PageSize="20" HorizontalAlign="Right" AlwaysShow="True"
											ShowCustomInfoSection="Left" NumericButtonCount="15" ShowBoxThreshold="21" 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>
									  <div align="center">
									    <p> <input class="btn" id="but" type="button" value="↓高级查找↓" name="but" onClick="javascript:document.getElementById('search').style.display=(document.getElementById('search').style.display=='none' ? '' : 'none');document.getElementById('but').value=(document.getElementById('but').value=='↓高级查找↓' ? '↑高级查找↑' : '↓高级查找↓');">
									    <table width="100%" border="0" id="search" style="DISPLAY:none">
                                          <tr>
                                            <td><div align="right">文件名：</div></td>
                                            <td><input name="key" class="kuan" id="key" value='<%if (Request["key"]!=null) Response.Write(Request["key"].ToString());%>'>
                                            （可模糊输入，不填为不限）</td>
                                          </tr>
                                          <tr>
                                            <td width="31%"><div align="right">用户名：</div></td>
                                            <td width="69%"><input name="user" class="kuan" id="user" value='<%if (Request["user"]!=null) Response.Write(Request["user"].ToString());%>'>
                                            （精确输入，不填为不限）</td>
                                          </tr>
                                          <tr>
                                            <td><div align="right">更新时间：</div></td>
                                            <td><input name="txttime1" class="kuan" id="txttime1" value='<%if (Request["txttime1"]!=null) Response.Write(Request["txttime1"].ToString());%>' onfocus=CalendarWebControl.show(this,this.value);>
－
  <input name="txttime2" class="kuan" id="txttime2" value='<%if (Request["txttime2"]!=null) Response.Write(Request["txttime2"].ToString());%>' onfocus=CalendarWebControl.show(this,this.value);>（不填为不限）</td>
                                          </tr>
                                          <tr>
                                            <td><div align="right">文件大小： </div></td>
                                            <td><input name="txtsize1" class="kuan" id="txtsize1" value='<%if (Request["txtsize1"]!=null) Response.Write(Request["txtsize1"].ToString());%>'>
KB－
  <input name="txtsize2" class="kuan" id="txtsize2" value='<%if (Request["txtsize2"]!=null) Response.Write(Request["txtsize2"].ToString());%>'>
  KB（不填为不限）</td>
                                          </tr>
                                          <tr>
                                            <td><div align="right">文件类型： </div></td>
                                            <td><input name="txttype" class="kuan" id="txttype" value='<%if (Request["txttype"]!=null) Response.Write(Request["txttype"].ToString());%>'>（输入扩展名，用半角,分隔，不填为不限）</td>
                                          </tr>
                                          <tr>
                                            <td><div align="right">文件注释：</div></td>
                                            <td><input name="txtnote" class="kuan" id="txtnote" value='<%if (Request["txtnote"]!=null) Response.Write(Request["txtnote"].ToString());%>'>（不填为不限）</td>
                                          </tr>
                                          <tr>
                                            <td>&nbsp;</td>
                                            <td><input class="btn" id="submit2" type="button" value=" 查 找 " name="submit22" onClick="gosearch();"></td>
                                          </tr>
                                        </table></p>
									  </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>
<script>
if ((getUrlParam('key')!="") || (getUrlParam('user')!="") || (getUrlParam('txttime1')!="") || (getUrlParam('txttime2')!="") || (getUrlParam('txtsize1')!="") || (getUrlParam('txtsize2')!="") || (getUrlParam('txttype')!="") || (getUrlParam('txtnote')!="")) document.getElementById("but").click();
</script>
	</body>
</HTML>
