<%@ Page language="c#" Codebehind="admin_user.aspx.cs" AutoEventWireup="True" Inherits="Typhoto.admin_user" %>
<%@ Register TagPrefix="webdiyer" Namespace="Wuqi.Webdiyer" Assembly="AspNetPager" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
		<title>网络硬盘后台管理</title>
		
		<script type="text/javascript" src="../js/calendar.js"></script>
		<script language="javascript">
   var CalendarWebControl = new atCalendarControl();
		</script>
		<link href="img/main.css" rel="stylesheet" type="text/css">
			<script language="JAVASCRIPT">
function checkAll()
{
   var a = document.getElementsByTagName("input");
   var check = document.getElementById("chkSelect");
   
   for (var i=0; i<a.length; i++)
   {
      if (a[i].type == "checkbox" && a[i].name=="checkbox") 
	    {
	  		a[i].checked = !check.checked;
	  		a[i].click();
	    }
	 }
}
function AddRemoveValues(oChk) { 
if(oChk.checked)
Form1.HdnSelectedValues.value += "," + oChk.value; 
else
Form1.HdnSelectedValues.value = Form1.HdnSelectedValues.value.replace("," + oChk.value,""); 
}
			</script>
			<style type="text/css">
.style1 { COLOR: #ffffff }
</style>
</HEAD>
	<body>
		<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>
<asp:datagrid id="DataGrid" runat="server" CssClass="GridBody"
					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" 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:TemplateColumn HeaderText="用户名">
        <ItemTemplate>
            <a href='admin_edituser.aspx?username=<%# Server.UrlEncode(Eval("uusername").ToString()) %>'><%# Eval("uusername") %></a>
        </ItemTemplate>
        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
            Width="15%" />
        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" />
    </asp:TemplateColumn>
<asp:BoundColumn DataField="regdate" SortExpression="regdate" HeaderText="注册时间" DataFormatString="{0:yyyy-MM-dd}">
<HeaderStyle HorizontalAlign="Center" Width="15%">
</HeaderStyle>

<ItemStyle HorizontalAlign="Center">
</ItemStyle>
</asp:BoundColumn>
<asp:TemplateColumn SortExpression="enddate" HeaderText="到期时间">
<HeaderStyle HorizontalAlign="Center">
</HeaderStyle>

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

<ItemTemplate>
								<asp:Label runat="server" Text='<%# showsj(DataBinder.Eval(Container, "DataItem.enddate", "{0:yyyy-MM-dd}").ToString()) %>'>
								</asp:Label>
							
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="level" SortExpression="[level]" HeaderText="等级">
<HeaderStyle HorizontalAlign="Center" Width="10%">
</HeaderStyle>

<ItemStyle HorizontalAlign="Center">
</ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="albumcount" SortExpression="albumcount" HeaderText="相册数">
<HeaderStyle HorizontalAlign="Center" Width="7%">
</HeaderStyle>

<ItemStyle HorizontalAlign="Center">
</ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="photocount" SortExpression="photocount" HeaderText="文件数">
<HeaderStyle HorizontalAlign="Center" Width="7%">
</HeaderStyle>

<ItemStyle HorizontalAlign="Center">
</ItemStyle>
</asp:BoundColumn>
    <asp:BoundColumn DataField="spacetotal" HeaderText="已用(M)" 
        SortExpression="spacetotal">
        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
            Width="7%" />
        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" />
    </asp:BoundColumn>
<asp:HyperLinkColumn Text="编辑" DataNavigateUrlField="uusername" DataNavigateUrlFormatString="admin_edituser.aspx?username={0}" HeaderText="编辑">
<HeaderStyle HorizontalAlign="Center" Width="5%">
</HeaderStyle>

<ItemStyle HorizontalAlign="Center">
</ItemStyle>
</asp:HyperLinkColumn>
<asp:HyperLinkColumn Text="管理" DataNavigateUrlField="uusername" DataNavigateUrlFormatString="admin_share_dir.aspx?user={0}" HeaderText="相册">
<HeaderStyle HorizontalAlign="Center" Width="5%">
</HeaderStyle>

<ItemStyle HorizontalAlign="Center">
</ItemStyle>
</asp:HyperLinkColumn>
</Columns>

<PagerStyle PageButtonCount="20" Mode="NumericPages">
</PagerStyle>
				</asp:datagrid>
			<div align="center">
				
				<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>
							&nbsp;&nbsp;
							<asp:button id="Button2" runat="server" Width="50px" class="formbutton" Text="查找" onclick="Button2_Click"></asp:button>
							<STRONG>（请输入用户名）
								<asp:CheckBox id="mo" runat="server" Text="模糊查找"></asp:CheckBox>
								<br>
								<br>
							</STRONG>
							<DIV align="center">勾选记录：
								<asp:button id="btnlock" runat="server" Width="50px" class="formbutton" Text="锁定" onclick="btnlock_Click"></asp:button>
								&nbsp;&nbsp;
								<asp:button id="btnunlock" runat="server" Width="50px" class="formbutton" Text="解锁" onclick="btnunlock_Click"></asp:button>
								&nbsp;&nbsp;
								<asp:button id="btnmark" runat="server" Width="50px" class="formbutton" Text="审核" onclick="btnmark_Click"></asp:button>
								&nbsp;&nbsp;
								<asp:button id="btnunmark" runat="server" Width="50px" class="formbutton" Text="未审" onclick="btnunmark_Click"></asp:button>
								&nbsp;&nbsp;
								<asp:button id="btndelete" runat="server" Width="50px" class="formbutton" Text="删除" onclick="btndelete_Click"></asp:button>
								&nbsp;&nbsp;
								<asp:button id="btnclear" runat="server" Width="50px" class="formbutton" Text="清空" onclick="btnclear_Click"></asp:button>
								&nbsp;&nbsp;
								<asp:button id="btnsend" runat="server" Width="87px" class="formbutton" Text="发短信/邮件" onclick="btnsend_Click"></asp:button>
								<asp:Panel id="Panel1" runat="server" Visible="False">
      <DIV align=center><BR>标题： <INPUT class=tableTdtext id=title type=text 
      name=title runat="server"> <asp:RequiredFieldValidator id=RequiredFieldValidator5 runat="server" ErrorMessage="请输入标题" Display="None" EnableViewState="False" ControlToValidate="title"></asp:RequiredFieldValidator></DIV>
      <DIV align=right>
      <DIV align=right>
      <DIV align=center>内容： <TEXTAREA class=tableTdtext id=Content name=Content rows=7 cols=50 runat="server"></TEXTAREA> 
<asp:RequiredFieldValidator id=RequiredFieldValidator6 runat="server" ErrorMessage="请输入内容" Display="None" EnableViewState="False" ControlToValidate="Content"></asp:RequiredFieldValidator></DIV></DIV>
      <DIV align=center><INPUT class=formbutton id=sendsms type=submit value=发短信 name=sendsms runat="server" onserverclick="sendsms_ServerClick"> 
      &nbsp;&nbsp; <INPUT class=formbutton id=sendmail type=submit value=发邮件 name=sendmail runat="server" onserverclick="sendmail_ServerClick"> 
      &nbsp;&nbsp; <asp:button id=Button12 runat="server" Width="70px" CssClass="formbutton" Text="取消发送" CausesValidation="False" onclick="Button12_Click"></asp:button><asp:ValidationSummary id=ValidationSummary2 runat="server" ShowSummary="False" ShowMessageBox="True" DisplayMode="List"></asp:ValidationSummary></DIV></DIV>
								</asp:Panel>
						  </DIV>
							<br>
							等级：
							<asp:DropDownList ID="level" runat="server"></asp:DropDownList>
							&nbsp;&nbsp;
							<asp:Button ID="Button3" runat="server" Width="70px" class="formbutton" Text="修改等级" onclick="Button3_Click"></asp:Button>
					    <br>
							<br>
							有效期至：
							<asp:TextBox ID="enddate" runat="server" CssClass="tableTdtext"></asp:TextBox>
							&nbsp;&nbsp;
							<asp:Button ID="Button6" runat="server" Width="80px" class="formbutton" Text="修改有效期" onclick="Button6_Click"></asp:Button>
							<br>
							<br>
							<asp:CheckBox ID="all" runat="server" Text="以上操作对列出的所有页用户都生效（不选此项则仅对勾选的用户生效）"></asp:CheckBox>
							<input id="HdnSelectedValues" type="hidden" name="HdnSelectedValues" runat="server"></td>
					</tr>
				</table>
			</div>
		</form>
	</body>
</HTML>
