<%@ Page language="c#" Inherits="Discuz.ForumPage.Admin.advsgrid" Codebehind="global_advsgrid.aspx.cs" %>
<%@ Register TagPrefix="cc1" Namespace="Discuz.Control" Assembly="Discuz.Control" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>广告列表</title>
		<link href="../styles/datagrid.css" type="text/css" rel="stylesheet">
		<link href="../styles/dntmanager.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="../js/common.js"></script>
</head>

	<body>
		<form id="Form1" method="post" runat="server">
		<div class="Navbutton" style="width:98%;"> 
			<table cellspacing="1" cellpadding="4" align="center" class="table1">
				<TBODY>
					<tr>
						<td class="category" align="left"><input title="选中/取消选中 本页所有Case" onclick="CheckAll(this.form)" type="checkbox" name="chkall" id="chkall" />全选/取消全选
							<cc1:Button id="DelAds" runat="server" Text="删 除" ButtonImgUrl="../images/del.gif" ></cc1:Button>&nbsp;&nbsp;
							<cc1:Button id="SetAvailable" runat="server" Text="置为有效"></cc1:Button>&nbsp;&nbsp;
							<cc1:Button id="SetUnAvailable" runat="server" Text="置为无效"></cc1:Button>&nbsp;&nbsp;
							<button type="button" class="ManagerButton" onclick="javascript:window.location.href='global_addadvs.aspx';"><img src="../images/add.gif"/> 添加广告</button>	
						</td>
					</tr>
				</TBODY>
			</table>
		</div>
		<cc1:datagrid id="DataGrid1" runat="server" OnPageIndexChanged="DataGrid_PageIndexChanged" OnSortCommand="Sort_Grid" >
				<Columns>
				
				    <asp:TemplateColumn HeaderText="选择">
						<ItemTemplate>
							<INPUT id="advid" onclick="javascript:SH_SelectOne(this)" type="checkbox" value="<%# DataBinder.Eval(Container, "DataItem.advid").ToString() %>"	name="advid">							</asp:Label>
						</ItemTemplate>
					</asp:TemplateColumn>
					
					<asp:TemplateColumn HeaderText="">
						<ItemTemplate>
							<a href="global_editadvs.aspx?advid=<%# DataBinder.Eval(Container, "DataItem.advid").ToString()%>">编辑</a>
						</ItemTemplate>
					</asp:TemplateColumn>
					
					<asp:BoundColumn DataField="advid" SortExpression="advid" HeaderText="广告id [递增]" Visible="false" ></asp:BoundColumn>
					
					<asp:TemplateColumn HeaderText="是否有效" SortExpression="available">
						<ItemTemplate>
							<%# BoolStr(DataBinder.Eval(Container, "DataItem.available").ToString())%>
						</ItemTemplate>
					</asp:TemplateColumn>
					
					<asp:BoundColumn DataField="title" SortExpression="title" HeaderText="广告标题" ></asp:BoundColumn>
					<asp:BoundColumn DataField="displayorder" SortExpression="displayorder" HeaderText="显示顺序"></asp:BoundColumn>
				
					<asp:TemplateColumn HeaderText="广告类型" SortExpression="type">
						<ItemTemplate>
							<%# GetAdType(DataBinder.Eval(Container, "DataItem.type").ToString())%>
						</ItemTemplate>
					</asp:TemplateColumn>
				    <asp:TemplateColumn HeaderText="广告投放范围" SortExpression="targets">
						<ItemTemplate>
							<%# TargetsType(DataBinder.Eval(Container, "DataItem.targets").ToString())%>
						</ItemTemplate>
					</asp:TemplateColumn>
				
				  	
					<asp:TemplateColumn HeaderText="样式" SortExpression="parameters">
						<ItemTemplate>
							<%# ParameterType(DataBinder.Eval(Container, "DataItem.parameters").ToString())%>
						</ItemTemplate>
					</asp:TemplateColumn>
					
				    <asp:TemplateColumn HeaderText="生效时间" SortExpression="starttime">
						<ItemTemplate>
							<%# DataBinder.Eval(Container, "DataItem.starttime").ToString()== "1900-1-1 0:00:00" ? "" : Convert.ToDateTime(DataBinder.Eval(Container, "DataItem.starttime").ToString()).ToShortDateString()%>
						</ItemTemplate>
					</asp:TemplateColumn>
					
					<asp:TemplateColumn HeaderText="结束时间" SortExpression="endtime">
						<ItemTemplate>
							<%# DataBinder.Eval(Container, "DataItem.endtime").ToString()== "2555-1-1 0:00:00" ? "" : Convert.ToDateTime(DataBinder.Eval(Container, "DataItem.endtime").ToString()).ToShortDateString()%>
						</ItemTemplate>
					</asp:TemplateColumn>
					
				</Columns>
			</cc1:datagrid>
			
			
		
		</form>
		<%=footer%>
	</body>
</HTML>
