<%@Page Language="C#" Inherits="IWMS.Admin.MemberMan" MasterPageFile="admin.master"%>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
	<%btDelete.Attributes["onclick"] = "return confirm_batch_delete()";%>
	<script type="text/javascript">
	<!--
	function initExport(){
		var o_link=document.getElementById("exp_link");
		var o_form=document.getElementById("exp_form");
		var o1=document.getElementById("sel_group");
		var o2=document.getElementById("exp_group");
		$(o2).empty();
		for(var i=0;i<o1.options.length;i++){
			var op = document.createElement("OPTION");
			o2.options.add(op);
			op.innerHTML=o1.options[i].innerHTML;
			op.value=o1.options[i].value;
		}
		
		o_link.style.display="none";
		o_form.style.display="inline";
	}
	
	function Export(){
		var gid = document.getElementById("exp_group").value;
		var ifm = document.getElementById("ifm_export");
		ifm.src = "admin_export.aspx?id="+gid+"&w=maillist";
		return false;
	}
	-->
	</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="cphMain" runat="server">
	
	<div class="mframe">
	<div class="tl"></div>
	<div class="rt"></div>
	<div class="tm">
		<table width="98%" cellpadding="0" cellspacing="0">
			<tr><td>
				<span class="tt">管理会员</span>
				&nbsp; <asp:Literal id="dropGroup" runat="server"/>
			</td><td align="right">
				<form action="" method="get">
				<input type="text" size="15" name="keyword"/>
				<select name="where" >
					<option value="name">会员名</option>
				</select>
				<input type="submit" value="搜索"/>
				</form>
			</td></tr>
		</table>
	</div>
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
		<asp:Label id="myLabel" class="msgBar" EnableViewState="false" runat="server"/>
		<form id="myForm" runat="server">
		<ASP:DataGrid id="MyDataGrid" runat="server"
				Width="100%"
				align="center"
				ShowHeader="true"
				ShowFooter="false"
				AutoGenerateColumns="false"
				DataKeyField="id"
				AllowPaging="false"
				OnEditCommand="MyDataGrid_Edit"
				OnCancelCommand="MyDataGrid_Cancel"
				OnUpdateCommand="MyDataGrid_Update"
				OnItemDataBound="MyDataGrid_ItemDataBound"
				HeaderStyle-CssClass="gridHead"
				ItemStyle-CssClass="tdbg"
				PageSize="15"
				CssClass="grid"
				BorderColor="#cccccc"
				CellPadding="6"
				CellSpacing="0" >
			<EditItemStyle CssClass="tdbg-dark" />
			<PagerStyle Mode="NumericPages" PageButtonCount="10" HorizontalAlign="Right" />
			
			<Columns>
				<asp:EditCommandColumn
					ButtonType="LinkButton"
					CancelText="取消"
					EditText="修改等级"
					UpdateText="更改" >
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="60"/>
				</asp:EditCommandColumn>
				<asp:TemplateColumn
					HeaderText="<input type=&quot;checkbox&quot; onclick=&quot;checkFormAll(this)&quot;/>"
					>
					<ItemTemplate>
						<asp:CheckBox id="chk" runat="server"/>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="20"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="会员名">
					<ItemTemplate>
						<a href="admin_memberAdd.aspx?id=<%#Eval("id")%>"><%#Eval("name")%></a>
						<%#Eval("realname").ToString().Length>0 ? "<br/><span class='gray'>("+Eval("realname")+")</span>" : ""%>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="80"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="email">
					<ItemTemplate>
						<div style="width:100px;overflow:hidden;"><a href="admin_sendMail.aspx?mailto=<%#Eval("email")%>" title="<%#Eval("email")%>"><%#Eval("email")%></a></div>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="100"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="会员组">
					<ItemTemplate>
						<%#GetGroup(Eval("groupid").ToString())%>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="70"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="等级">
					<ItemTemplate>
						<%#GetUserClass(Eval("flag")==DBNull.Value ? 0 : (int)Eval("flag"))%><br/>
						<%#GetPopeLink(Eval("adminid")==DBNull.Value ? 0 : (int)Eval("adminid"), Eval("flag")==DBNull.Value ? 0 : (int)Eval("flag"))%>
					</ItemTemplate>
					<EditItemTemplate>
						<asp:DropDownList id="UserClass"
							runat="server">
						</asp:DropDownList>
					</EditItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="70"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="备注">
					<ItemTemplate>
						<%#Eval("remarks")%>
					</ItemTemplate>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="添加数">
					<ItemTemplate>
						<a href="admin_article.aspx?where=memberid&amp;keyword=<%#Eval("id")%>"><%#Eval("addNum")%></a>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="50"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="注册日期<br/>最后登录"
					>
					<ItemTemplate>
						<%#Eval("adddate","{0:yy-MM-dd}")%><br/>
						<%#Eval("lastlog","{0:yy-MM-dd}")%>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="60"/>
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="IP<br/>登录次数"
					>
					<ItemTemplate>
						<%#Eval("lastIp")%><br/>
						<%#Eval("logTimes")%>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="center" />
					<HeaderStyle Width="80"/>
				</asp:TemplateColumn>
					
			</Columns>
		</ASP:DataGrid>	
		<asp:Literal id="pageList" runat="server"/>
			
		<table>
		<tr><td>
			<asp:Button id="btDelete" OnClick="btDelete_OnClick" Text="删除" runat="server"/>
			　　　<a href="javascript:initExport();" id="exp_link">导出会员邮件列表</a>
			<div id="exp_form" style="display:none">
				　<select id="exp_group"><option/></select>　
				<button onclick="return Export();">导出TXT文件</button>
			</div>
		</td></tr>
		<tr><td>
			<br/><b>注：</b>点击“修改”设置会员等级，点击会员名修改会员资料及会员组
		</td></tr>
		</table>
		
		</form>
	
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>
	
	<iframe id="ifm_export" src="about:blank" height="0" width="0" style="visibility:hidden"></iframe>

</asp:Content>