<%@ Register tagPrefix="bbs" tagName="AdminFooter" src="controls/admin_footer.ascx"%>
<%@ Register tagPrefix="bbs" tagName="AdminHeader" src="controls/admin_header.ascx"%>
<%@ Register tagPrefix="Dvbbs" namespace="Dvbbs.Controls" assembly="Dvbbs.Web"%>
<%@ Page Inherits="Dvbbs.bbs.UI.Admin.admin_group" %>
<style>
.radio, .checkbox{border:none}
</style>
<script language="javascript">
function ChkSelected(Obj,Val)
{
	if (Obj)
	{
		for (i=0;i<Obj.length;i++)
		{
			if (Obj.options[i].value==Val)
			{
				Obj.options[i].selected=true;
				break;
			}
		}
	}
}

function chkradio(Obj,Val)
{
	if (Obj)
	{
		for (i=0;i<Obj.length;i++)
		{
			if (Obj[i].value==Val)
			{
				Obj[i].checked=true;
				break;
			}
		}
	}
}

</script>
<bbs:adminheader id="AdminHeader1" title="增加新版面" runat="server"></bbs:adminheader>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<tr>
		<th>
			论坛圈子管理</th>
	</tr>
	<tr>
		<td class="nf2"><div class="underline">功能说明：</div>
			<span>请在插件管理的菜单管理中添加一级菜单“个性圈子”。<br />
		用户圈子管理：您可以添加修改或者删除论坛圈子。</span></td>
	</tr>
	<tr>
		<td>
			<button onClick="window.location='admin_group.aspx?HtmlMark=new'" class="button" onFocus="IEvent('focus',this)"
				onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">添加圈子</button>&nbsp;&nbsp;
			<button onClick="window.location='admin_group.aspx'" class="button" onFocus="IEvent('focus',this)"
				onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">圈子管理</button>&nbsp;&nbsp;
			<button onClick="window.location='admin_group.aspx?HtmlMark=view'" class="button" onFocus="IEvent('focus',this)"
				onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">圈子用户管理</button>
		</td>
	</tr>
</table>
<br />
<%
	if( null != HtmlMark && "new" == HtmlMark){
	%>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<form method="POST" action="admin_group.aspx?HtmlMark=save" name="groupform">
		<tr>
			<th colspan="2">
				添加圈子</th>
		</tr>
		<tr>
			<td width="30%" class="left">圈子名称</td>
			<td width="70%" class="right">
				<input type="text" name="GroupName" size="50" value="" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)"
					onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
			</td>
		</tr>
		<tr>
			<td class="left">管理员名称</td>
			<td class="right">
				<input type="text" name="AppUserName" size="50" value="" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
			</td>
		</tr>
		<tr>
			<td class="left">圈子说明</td>
			<td class="right">
				<textarea rows="5" cols="50" name="GroupInfo" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)"
					onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"></textarea>
			</td>
		</tr>
		<tr>
			<td class="left">成员人数上限</td>
			<td class="right">
				<input type="text" name="LimitUser" size="20" value="" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)"
					onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
			</td>
		</tr>
		<tr>
			<td class="left">圈子状态</td>
			<td class="right">
				<input type="radio" class="radio" name="GroupStats" value="1" checked />正常&nbsp;&nbsp;
				<input type="radio" class="radio" name="GroupStats" value="2" />锁定&nbsp;&nbsp; <input type="radio" class="radio" name="GroupStats" value="3" />关闭
			</td>
		</tr>
		<tr>
			<td class="left">成员加入</td>
			<td class="right">
				<input type="radio" class="radio" name="locked" value="0" checked />自由加入&nbsp;&nbsp;
				<input type="radio" class="radio" name="locked" value="1" />需要审核
			</td>
		</tr>
		<tr>
			<td class="left">浏览设置</td>
			<td class="right">
				<input type="radio" class="radio" name="ViewFlag" value="0" checked />公开&nbsp;&nbsp;
				<input type="radio" class="radio" name="ViewFlag" value="1" />不公开&nbsp;&nbsp;
				<span>公开：任何人都可以浏览；不公开：只有成员能浏览</span>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="bottom" align="center">
				<input type="submit" class="button" name="AddNew" id="AddNew" value="添 加" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" /></td>
		</tr>
	</form>
	<script language="JavaScript">
	<!--
	chkradio(document.groupform.GroupStats,'1')
	chkradio(document.groupform.locked,'0')
	chkradio(document.groupform.viewflag,'1')
	//-->
	</script>
</table>
<br />
<%
	}else if( null != HtmlMark && "edit" == HtmlMark){
	%>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<form method="POST" action="admin_group.aspx?HtmlMark=save&groupid=<%=Request.QueryString["groupid"]%>" name="groupform">
		<tr>
			<th colspan="2">
				修改圈子</th>
		</tr>
		<tr>
			<td width="30%" class="left">圈子名称</td>
			<td width="70%" class="right">
				<input type="text" name="GroupName" size="50" value="<%=mGroupName%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td class="left">管理员名称</td>
			<td class="right">
				<input type="text" name="AppUserName" size="50" value="<%=mAppUserName%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td class="left">圈子说明</td>
			<td class="right">
				<textarea rows="5" cols="50" name="GroupInfo" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"><%=Server.HtmlEncode(mGroupInfo.ToString())%></textarea>
			</td>
		</tr>
		<tr>
			<td class="left">成员人数上限</td>
			<td class="right">
				<input type="text" name="LimitUser" size="20" value="<%=mLimitUser%>" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td class="left">圈子状态</td>
			<td class="right">
				<input type="radio" class="radio" name="GroupStats" value="1" />正常&nbsp;&nbsp; <input type="radio" class="radio" name="GroupStats" value="2" />锁定&nbsp;&nbsp;
				<input type="radio" class="radio" name="GroupStats" value="3" />关闭
			</td>
		</tr>
		<tr>
			<td class="left">成员加入</td>
			<td class="right">
				<input type="radio" class="radio" name="Locked" value="0" />自由加入&nbsp;&nbsp; <input type="radio" class="radio" name="Locked" value="1" />需要审核
			</td>
		</tr>
		<tr>
			<td class="left">浏览设置</td>
			<td class="right">
				<input type="radio" class="radio" name="ViewFlag" value="0" />公开&nbsp;&nbsp; <input type="radio" class="radio" name="ViewFlag" value="1" />不公开&nbsp;&nbsp;
				<span>公开：任何人都可以浏览；不公开：只有成员能浏览</span>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="bottom" align="center">
				<input type="submit" class="button" name="Save" id="Save" value="保 存" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)"></td>
		</tr>
	</form>
</table>
<br />
<script language="JavaScript">
	<!--
	chkradio(document.groupform.GroupStats,'<%=mStat%>')
	chkradio(document.groupform.Locked,'<%=mLocked%>')
	chkradio(document.groupform.ViewFlag,'<%=mViewFlag%>')
	//-->
</script>
<%
	}
	if( null != HtmlMark && "view" == HtmlMark){
%>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<tr>
		<th colspan="4">
			圈子成员搜索</th>
	</tr>
	<form method="post" action="admin_group.aspx?HtmlMark=<%=Request.QueryString["HtmlMark"]%>&groupid=<%=Request.QueryString["groupid"]%>" name="searchform">
		<tr>
			<td>
				成员名称搜索关键字：<input name="S_keyword" type="text" value="<%=Request["S_keyword"]%>" size="15" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
				&nbsp;&nbsp;所属圈子名称：<input name="S_GroupName" type="text" value="<%=Request["S_GroupName"]%>" size="15" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
				&nbsp;&nbsp;<input name="Submit" type="submit" class="button" value="搜索" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />
			</td>
		</tr>
	</form>
</table>
<br />
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<form name="theform" method="post" action="admin_group.aspx?HtmlMark=<%=Request.QueryString["HtmlMark"]%>&groupid=<%=Request.QueryString["groupid"]%>">
		<tr align="center">
			<td width="5%"></td>
			<td>用户名称</td>
			<td>用户备注</td>
			<td>所属圈子名称</td>
			<td>用户状态</td>
		</tr>
		<asp:Repeater enableviewstate="false" id="list2" runat="server">
			<ItemTemplate>
				<tr onMouseOver="this.bgColor='#ffffff'" onMouseOut="this.bgColor=''" align="center">
					<td><Dvbbs:Span id="lid" runat="server" /></td>
					<td><Dvbbs:Anchor id="UserName" runat="server" /></td>
					<td><Dvbbs:Span id="Intro" runat="server" /></td>
					<td><Dvbbs:Span id="GroupName" runat="server" /></td>
					<td><Dvbbs:Span id="IsLock" runat="server" />
					</td>
				</tr>
			</ItemTemplate>
		</asp:Repeater>
		<tr>
			<td colspan="5">
				&nbsp;&nbsp;<input type="checkbox" class="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)">全选/取消&nbsp;&nbsp;
				<input type="submit" class="button" name="act" value="批量删除" onclick="{if(confirm('您确定要删除所选的全部圈子成员吗?')){this.document.theform.submit();return true;}return false;}" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">&nbsp;&nbsp;
				<input type="submit" class="button" name="act1" value="批量更改" onclick="{if(confirm('您确定要更改所选的记录吗?')){this.document.theform.submit();return true;}return false;}" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)">
			</td>
		</tr>
		<tr>
			<td class="title" colspan="5"><Dvbbs:Pager id="pager2" per="30" runat="server" /></td>
		</tr>
	</form>
</table>
<%
}else{
%>
<table width="100%" class="maintable" cellpadding="0" cellspacing="1" border="0">
	<form method="post" action="admin_group.aspx?HtmlMark=save&groupid=<%=Request.QueryString["groupid"]%>" name="searchform">
		<tr>
			<th colspan="10">
				论坛圈子管理</th>
		</tr>
		<tr>
			<td colspan="10">
				个性圈子搜索：<input name="keyword" type="text" value="<%=keyword%>" size="15" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />&nbsp;&nbsp;
				<input name="Submit" type="submit" class="button" value="搜索" onFocus="IEvent('focus',this)"
					onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)" onMouseOut="IEvent('mouseout',this)" />&nbsp;&nbsp;
				<select name="orders" onchange='javascript:submit()'>
					<option value="0" selected>所有圈子</option>
					<option value="1">待审核圈子</option>
					<option value="2">最新圈子</option>
					<option value="3">发贴总数Top20</option>
					<option value="4">成员总数Top20</option>
				</select>
				<script language="javascript">
					function setorders(ordernum)
					{
						document.searchform.orders.options(ordernum).selected=1;
					}
					setorders(0);
				</script>
			</td>
		</tr>
	</form>
	<form method="post" action="admin_group.aspx?HtmlMark=edit2" name="batchform">
		<tr align="center">
			<td></td>
			<td>圈子名称</td>
			<td>圈子申请人名称</td>
			<td>用户总数</td>
			<td>帖子总数</td>
			<td>主题总数</td>
			<td>成员人数上限</td>
			<td>申请时间</td>
			<td>状态</td>
			<td>操作</td>
		</tr>
		<asp:Repeater enableviewstate="false" id="list" runat="server">
			<ItemTemplate>
				<tr onMouseOver="this.bgColor='#ffffff'" onMouseOut="this.bgColor=''" align="center">
					<td><Dvbbs:Span id="groupid" runat="server" /></td>
					<td><Dvbbs:Span id="GroupName" runat="server" /></td>
					<td><Dvbbs:Anchor id="AppUserName" runat="server" /></td>
					<td><Dvbbs:Span id="UserNum" runat="server" /></td>
					<td><Dvbbs:Span id="PostNum" runat="server" /></td>
					<td><Dvbbs:Span id="TopicNum" runat="server" /></td>
					<td><Dvbbs:Span id="LimitUser" runat="server" /></td>
					<td><Dvbbs:Span id="AppDate" runat="server" /></td>
					<td>
						<Dvbbs:Span id="stats" runat="server" />
					</td>
					<td><Dvbbs:Span id="edit" runat="server" /></td>
				</tr>
			</ItemTemplate>
		</asp:Repeater>
		<tr>
			<td class="title" colspan="10"><Dvbbs:Pager id="pager" per="30" runat="server" /></td>
		</tr>
		<tr>
			<td colspan="10" class="bottom">
				<input type="checkbox" name="chkall" value="on" onClick="CheckAll(this.form);" class="checkbox" />全选/取消&nbsp;&nbsp;
				<input type="submit" name="Submit" value="批量修改" onClick="return clicksubmit(this.form);"
					class="button" onFocus="IEvent('focus',this)" onBlur="IEvent('blur',this)" onMouseOver="IEvent('mouseover',this)"
					onMouseOut="IEvent('mouseout',this)" />
			</td>
		</tr>
	</form>
</table>
<%}%>
<script language="javascript">
function CheckAll(form)
{
	for (var i = 0; i < form.elements.length; i++)
	{
		var e = form.elements[i];
		if (e.name == 'lid')
		{
			e.checked = form.chkall.checked;
		}
		else if(e.name == 'groupid')
		{
			e.checked = form.chkall.checked;
		}
	}
}

function clicksubmit(form)
{
	if(confirm('您确定执行的操作吗?'))
	{
		this.document.batchform.submit();
		return true;
	}
	else
	{
		return false;
	}
}
function isDelete(url)
{
	if(confirm('您确定执行的操作吗?'))
	{
		window.location.href = url;
	}
}
</script>
<bbs:AdminFooter runat="server" id="AdminFooter1" />