<%@ Page CodeBehind="admin_share_file.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="Webdisk.admin_share_file" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>共享管理</title>
		<% @ Import Namespace="Webdisk" %>
		<link href="img/main.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" language="javascript" src="../js/function.js"></script>
			<style type="text/css">
.style1 { FONT-WEIGHT: bold; COLOR: #ffffff }
</style>
			<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;
				}

				}
				}
			}
			</script>
	</HEAD>
	<body>
		<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"></DIV>
		<STRONG><FONT style="BACKGROUND-COLOR: #ffffff"></FONT></STRONG><STRONG><FONT style="BACKGROUND-COLOR: #ffffff">
			</FONT></STRONG>
		<form id="Form1" method="post" runat="server">
			<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" id="brb"
				height="27">
				<tr>
					<td colSpan="3" class="td_title">共享文件（点击表头可升降排序）
					</td>
				</tr>
			</table>
			<div align="center">
				<asp:datagrid id="DataGrid" runat="server" CssClass="GridBody" GridLines="None" AutoGenerateColumns="False"
					Width="100%" PageSize="20" AllowSorting="True">
					<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" id="CheckBox2" onClick="checkAll()">
							</HeaderTemplate>
							<ItemTemplate>
								<INPUT id=chkSelect onclick=AddRemoveValues(this) type=checkbox value='<%#DataBinder.Eval(Container.DataItem,"id")%>' name=checkbox>
							</ItemTemplate>
						</asp:TemplateColumn>
						<asp:BoundColumn Visible="False" DataField="id"></asp:BoundColumn>
						<asp:TemplateColumn SortExpression="filename" HeaderText="共享文件">
							<ItemTemplate>
								<%# ShowFileName(DataBinder.Eval(Container.DataItem, "FileName").ToString(),DataBinder.Eval(Container.DataItem, "UserName").ToString()+DataBinder.Eval(Container.DataItem, "Postion").ToString(),DataBinder.Eval(Container, "DataItem.note").ToString()) %>
							</ItemTemplate>
						</asp:TemplateColumn>
						<asp:HyperLinkColumn Text="用户名" DataNavigateUrlField="username" DataNavigateUrlFormatString="admin_edituser.aspx?username={0}"
							DataTextField="username" SortExpression="username" HeaderText="用户名">
							<HeaderStyle HorizontalAlign="Center" Width="15%"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
						</asp:HyperLinkColumn>
						<asp:TemplateColumn SortExpression="Share" HeaderText="共享类型">
							<HeaderStyle HorizontalAlign="Center" Width="20%"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
							<ItemTemplate>
								<asp:Label runat="server" Text='<%# showtype(DataBinder.Eval(Container, "DataItem.Share").ToString()) %>'>
								</asp:Label>
							</ItemTemplate>
						</asp:TemplateColumn>
						<asp:TemplateColumn SortExpression="[top]" HeaderText="固顶">
							<HeaderStyle HorizontalAlign="Center" Width="5%"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
							<ItemTemplate>
								<asp:Label id=Label1 runat="server" Text='<%# showtop(DataBinder.Eval(Container, "DataItem.top").ToString()) %>'>
								</asp:Label>
							</ItemTemplate>
						</asp:TemplateColumn>
						<asp:TemplateColumn SortExpression="good" HeaderText="精华">
							<HeaderStyle HorizontalAlign="Center" Width="5%"></HeaderStyle>
							<ItemStyle HorizontalAlign="Center"></ItemStyle>
							<ItemTemplate>
								<asp:Label runat="server" Text='<%# showtop(DataBinder.Eval(Container, "DataItem.good").ToString()) %>' ID="Label2">
								</asp:Label>
							</ItemTemplate>
						</asp:TemplateColumn>
					</Columns>
					<PagerStyle PageButtonCount="20" Mode="NumericPages"></PagerStyle>
				</asp:datagrid>
				<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
					<tr>
						<td height="25"><webdiyer:AspNetPager id="Pager" runat="server" PageSize="20" AlwaysShow="True" ShowCustomInfoSection="Left"
								NumericButtonCount="15" HorizontalAlign="Right" ShowBoxThreshold="21" 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" CssClass="page" onpagechanged="Pager_PageChanged"></webdiyer:AspNetPager></td>
					</tr>
					<tr>
						<th height="25">
							操作区</th>
					</tr>
					<tr>
						<td align="center"><strong>查找文件：</strong>
							<asp:TextBox ID="key" runat="server" CssClass="tableTdtext"></asp:TextBox>
							<asp:Button ID="Button2" runat="server" CssClass="formbutton" Width="50px" Text="查找" onclick="Button2_Click"></asp:Button>
							<input id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server">
							<br>
							<br>
							勾选记录：
							<asp:Button ID="btnlock" runat="server" Width="50px" CssClass="formbutton" Text="固顶" onclick="btnlock_Click"></asp:Button>
							&nbsp;&nbsp;
							<asp:Button ID="btnunlock" runat="server" Width="50px" CssClass="formbutton" Text="解固" onclick="btnunlock_Click"></asp:Button>
							&nbsp;&nbsp;
							<asp:Button ID="btnmark" runat="server" Width="50px" CssClass="formbutton" Text="精华" onclick="btnmark_Click"></asp:Button>
							&nbsp;&nbsp;
							<asp:Button ID="btnunmark" runat="server" Width="50px" CssClass="formbutton" Text="解精" onclick="btnunmark_Click"></asp:Button>
							&nbsp;&nbsp;
							<asp:Button ID="btndelete" runat="server" Width="50px" CssClass="formbutton" Text="取消" onclick="btndelete_Click"></asp:Button>
							&nbsp;&nbsp;
							<asp:Button ID="btndel" runat="server" Width="50px" CssClass="formbutton" Text="删除" onclick="btndel_Click"></asp:Button></td>
					</tr>
				</table>
			</div>
		</form>
	</body>
</HTML>
