<%@Page Language="C#" Inherits="IWMS.Admin.GatherUser" MasterPageFile="admin.master"%>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
	<script type="text/javascript">
	<!--
		function WriteProcess(full, part){
			var w = parseInt(part*200/full);
			var s = "<center style='font-size:12px;font-family:Arial;'><div style='width:200px; height:10px; border:1px #F7D4D4 solid;font-size:5px;' align='left'>";
				s += "<div style='width:"+ w +"px;height:10px;background:#4DADF4;'><\/div>";
				s += "<\/div>";
				s += parseInt(part*100/full) + "%<\/center>";
			return s;
		}
		
		function Refresh(){
			window.setTimeout("location.href=location.href;",4000);
		}
		//WriteProcess(308,20);
		
		function WriteState(){
			var s;
			if (<%=gState.Processing.ToString().ToLower()%>){
				s = "已添加 <%=gState.AddNum%> 位会员";
				if (<%=gState.Error.Length>0 ? "true" : "false"%>){
					s += ",　<a href=\"#\" title=\"<%=gState.Error.Replace("\"","&quot;").Replace("\r","&#10;").Replace("\n","&#13")%>\">错误<\/a>" ;
				}
				s += "　<a href=\"javascript:document.location=document.location.href\">刷新<\/a>";
				Refresh();
			}else{
				s = "上次添加 <%=gState.AddNum%> 位会员";
				if (<%=gState.Error.Length>0 ? "true" : "false"%>){
					s += ",　<a href=\"#\" title=\"<%=gState.Error.Replace("\"","&quot;").Replace("\r","&#10;").Replace("\n","&#13")%>\">错误<\/a>" ;
				}
			}
			document.getElementById("<%=myLabel.ClientID%>").innerHTML = s;
		}
	-->
	</script>
</asp:Content>
<asp:Content ContentPlaceHolderId="cphMain" runat="server">

	<asp:Label id="myLabel" class="msgBar" EnableViewState="false" runat="server"/>
	<form id="myForm" runat="server">
		<asp:ValidationSummary 
			 DisplayMode="BulletList" 
			 EnableClientScript="true"
			 ShowSummary="false"
			 ShowMessageBox="true"                        
			 HeaderText="请正确填写以下内容"
			 runat="server"/>
	
	<div class="mframe">
	<div class="tl"></div>
	<div class="rt"></div>
	<div class="tm">
		<span class="tt">会员数据采集规则</span>
	　<asp:Button id="stop" Onclick="stop_OnClick" Text="停止采集" Visible="false" CausesValidation="false" runat="server"/>
	</div>
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
		<ASP:DataGrid id="MyDataGrid" runat="server"
				Width="100%"
				align="center"
				ShowHeader="true"
				ShowFooter="false"
				AllowPaging="true"
				AutoGenerateColumns="false"
				DataKeyField="id"
				OnDeleteCommand="MyDataGrid_Delete"
				OnPageIndexChanged="MyDataGrid_Page"
				CssClass="grid"
				BorderColor="#cccccc"
				HeaderStyle-CssClass="gridHead"
				ItemStyle-CssClass="tdbg"
				PageSize="10"
				CellPadding="6"
				CellSpacing="0" >
			
			<Columns>
				<asp:TemplateColumn>
					<ItemTemplate>
						<input type="radio" name="rid" value='<%#Eval("id")%>'/>
					</ItemTemplate>
					<ItemStyle Width="20" HorizontalAlign="center" />
				</asp:TemplateColumn>
				<asp:TemplateColumn
					HeaderText="采集名称"
					>
					<ItemTemplate>
						<a href="admin_gatherUserRuleAdd.aspx?id=<%#Eval("id")%>"><%#Eval("name")%></a>
					</ItemTemplate>
					<ItemStyle HorizontalAlign="left"/>
				</asp:TemplateColumn>
				<asp:BoundColumn
					HeaderText="表名"
					DataField="tableName"
					>
					<ItemStyle Width="100" HorizontalAlign="center" />
				</asp:BoundColumn>
				<asp:ButtonColumn
					ButtonType="LinkButton"
					CommandName="Delete"
					Text="删除" >
					<ItemStyle Width="40" HorizontalAlign="center" />
				</asp:Buttoncolumn>
			</Columns>
		</ASP:DataGrid>
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>
	
	<asp:PlaceHolder id="phGather" runat="server">
	<div class="mframe">
	<div class="tl"></div>
	<div class="rt"></div>
	<div class="tm">
		<span class="tt">开始采集</span>
	</div>
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
		<table width="100%">
		<tr><td>
			<div style="position:relative; float:left; width:100px">
			sql条件语句：
			</div>
			<div style="position:relative;">
			<asp:TextBox id="filter" TextMode="MultiLine" Columns="50" rows="3" runat="server"/>
			</div>
		</td>
		</tr>
		<tr>
		<td>
			<asp:Button id="Submit" Onclick="Submit_OnClick" Text="开始采集" runat="server"/>
			&nbsp; <input type="button" onclick="document.location.href=document.location.href;" value="刷新"/>
		</td>
		<td>
		</td>
		</tr>
		</table>
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>
	</asp:PlaceHolder>
	</form>

</asp:Content>