<%@ Page language="c#" Inherits="Discuz.ForumPage.Admin.detachtable" Codebehind="global_detachtable.aspx.cs" %>
<%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
<HTML>
  <HEAD>
		<title>detachtable</title>
		<link href="../styles/datagrid.css" type="text/css" rel="stylesheet">
	    <script language="javascript" src="../js/common.js"></script>
	    <link href="../styles/dntmanager.css" type="text/css" rel="stylesheet">  
	    <link href="../styles/modelpopup.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="../js/modalpopup.js"></script> 
</HEAD>
	<body>
	<form id="Form1" method="post" runat="server">
<script>
	showhint(0, '帖子分表可以提高查看帖子的速度,但频繁分表也会带来用户使用上的不便. 一般以30-50万条帖子后另建新的分表为宜. <br />添加新分表后, 新主题的帖子将添加到新分表');
	showhint(0, '系统当前使用的帖子分表是: <b><%=currentpost_tablename%></b>');
</script>

&nbsp;&nbsp;<cc1:Button id="StartFullIndex" runat="server" Text="为选择的分表填充全文索引"></cc1:Button>  <br /><br />
 
<cc1:datagrid id="DataGrid1" runat="server" OnCancelCommand="DataGrid_Cancel" OnEditCommand="DataGrid_Edit"
	OnPageIndexChanged="DataGrid_PageIndexChanged" OnSortCommand="Sort_Grid" OnUpdateCommand="DataGrid_Update">
  <Columns>
	<asp:BoundColumn Visible="false" DataField="id" HeaderText="分表id"></asp:BoundColumn>
		<asp:TemplateColumn HeaderText="选择">
		<ItemTemplate>
			<INPUT id="id" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.id").ToString() %>"	name="id">
		</ItemTemplate>
	</asp:TemplateColumn>
	<asp:TemplateColumn HeaderText="分表名称">
		<ItemTemplate>
				<%=Discuz.Config.BaseConfigs.GetTablePrefix%>posts<%# DataBinder.Eval(Container, "DataItem.id").ToString()%>
		</ItemTemplate>
	</asp:TemplateColumn>
	<asp:BoundColumn DataField="description" HeaderText="分表描述"></asp:BoundColumn>
	<asp:TemplateColumn HeaderText="帖子表当前记录数">
	
		<ItemTemplate>
				<%# CurrentPostsCount(DataBinder.Eval(Container, "DataItem.id").ToString())%> 
		</ItemTemplate>
	</asp:TemplateColumn>
	<asp:TemplateColumn HeaderText="主题TID">
	
		<ItemTemplate>
				<%# DisplayTid(DataBinder.Eval(Container, "DataItem.mintid").ToString(),DataBinder.Eval(Container, "DataItem.maxtid").ToString())%> 
		</ItemTemplate>
	</asp:TemplateColumn>
	
	<asp:BoundColumn DataField="createdatetime" ReadOnly="True" HeaderText="分表时间"></asp:BoundColumn>
  </Columns>
</cc1:datagrid>
<div class="ManagerForm">
<fieldset>
		<legend style="background:url(../images/icons/icon10.jpg) no-repeat 6px 50%;">添加分表</legend>
    <table class="table1" cellspacing="0" cellpadding="4" width="99%" align="center" class="tabledatagrid">
    <tr> 
      <td width="20%" class="td2">描述:</td>
      <td class="td2"> <cc1:TextBox id="detachtabledescription" runat="server" HintInfo="长度少于50字" HintTitle="提示" RequiredFieldType="暂无校验" Width="288px" ></cc1:TextBox> 
      </td>
    </tr>
    <tr><td colspan="2" align="center"><cc1:Button id="SaveInfo" runat="server" Text=" 添 加 "></cc1:Button></td></tr>
  </table>
  </fieldset>
  <cc1:Hint id="Hint1" runat="server" HintImageUrl="../images"></cc1:Hint>
  </div>
		</form>
		<%=footer%>
	</body>
</HTML>
