<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Page language="c#" Codebehind="AD.aspx.cs" AutoEventWireup="false" Inherits="wqeshop.Admin.AD" validateRequest="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>AD</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<LINK href="inc/style.css" type="text/css" rel="stylesheet">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
<% if(Request.QueryString["ADID"] == null) {%>
<table width="97%" height="550" style="border:1px #619ADF solid; border-left:0;margin-top:6px; margin-right:7px;background:#F2F7FD;" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
<div class="top">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><span class="tt">营销管理 &gt;&gt;广告管理</span></td>
		<td class="tm2"><span class="tt"><a href="http://www.wangqi.com" target="_blank"><img src="Images/admin_help.gif" border="0" alt="帮助"></a></span></td>
		<td class="tr"></td>
	</tr>
</table>
</div>
<div class="mframe">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><div class="tt">&nbsp; 广告管理</div></td>
		<td class="tr"></td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td class="ml"></td>
    <td  class="mm" align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#EBF3FE" valign="top" style=" border-right:1px #77ABE5 solid;">
<table width="90%"  cellspacing="0" cellpadding="0">
	<tr>
		<td class="ml1"></td>
		<td class="mm1">
			<table cellSpacing="0" cellPadding="0" width="640" align="center" border="0">
				<tr>
					<td height="25" align="left">
						&nbsp;&nbsp; 固定广告管理</td>
				</tr>
			</table>
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="640" align="center" border="0">
				<tr>
					<td height="23" class="forumRowHighlight">
						<asp:datagrid id="dgList" runat="server" PageSize="15" PagerStyle-Mode="NumericPages" AutoGenerateColumns="False"
							DataKeyField="ADID" Width="100%" HorizontalAlign="Center" HeaderStyle-CssClass="summary-title">
							<HeaderStyle Font-Bold="True" CssClass="summary-title"></HeaderStyle>
							<Columns>
								<asp:TemplateColumn HeaderText="广告位置">
									<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									<ItemStyle HorizontalAlign="Left"></ItemStyle>
									<ItemTemplate>
										<%# DataBinder.Eval(Container.DataItem, "Name") %>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="开放/关闭" ItemStyle-Width="60" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<a href='Actions.aspx?Action=ChangeADInNav&ADID=<%# DataBinder.Eval(Container.DataItem, "ADID") %>&Status=<%# DataBinder.Eval(Container.DataItem, "IsOpen")%>'>
											<img src='images/publish_<%# DataBinder.Eval(Container.DataItem, "IsOpen")%>.png' border="0"></a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn>
									<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
									<ItemTemplate>
										<a href='AD.aspx?ADID=<%# DataBinder.Eval(Container.DataItem, "ADID") %>'>修改</a>
									</ItemTemplate>
								</asp:TemplateColumn>
							</Columns>
							<PagerStyle Mode="NumericPages"></PagerStyle>
						</asp:datagrid>
					</td>
				</tr>
			</table>
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="640" align="center" border="0">
				<tr>
					<td height="25" align="left">
						&nbsp;&nbsp; 侧边广告管理</td>
				</tr>
			</table>
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="640" align="center" border="0">
				<tr>
					<td height="23" class="forumRowHighlight">
						<asp:datagrid id="dgLeftAdList" runat="server" PageSize="15" PagerStyle-Mode="NumericPages" AutoGenerateColumns="False"
							DataKeyField="ADID" Width="100%" HorizontalAlign="Center" HeaderStyle-CssClass="summary-title">
							<HeaderStyle Font-Bold="True" CssClass="summary-title"></HeaderStyle>
							<Columns>
								<asp:TemplateColumn HeaderText="广告位置名称">
									<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									<ItemStyle HorizontalAlign="Left"></ItemStyle>
									<ItemTemplate>
										<%# DataBinder.Eval(Container.DataItem, "Name") %>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="开放/关闭" ItemStyle-Width="60" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<a href='Actions.aspx?Action=ChangeADInNav&ADID=<%# DataBinder.Eval(Container.DataItem, "ADID") %>&Status=<%# DataBinder.Eval(Container.DataItem, "IsOpen")%>'>
											<img src='images/publish_<%# DataBinder.Eval(Container.DataItem, "IsOpen")%>.png' border="0"></a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn>
									<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
									<ItemTemplate>
										<a href='AD.aspx?ADID=<%# DataBinder.Eval(Container.DataItem, "ADID") %>'>修改</a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
									CommandName="Delete">
									<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
								</asp:ButtonColumn>
							</Columns>
							<PagerStyle Mode="NumericPages"></PagerStyle>
						</asp:datagrid>
					</td>
				</tr>
			</table>
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="640" align="center" border="0">
				<tr>
					<td height="25" align="left">
						&nbsp;&nbsp; 自定义广告管理</td>
				</tr>
			</table>
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="640" align="center" border="0">
				<tr>
					<td height="23" class="forumRowHighlight">
						<asp:datagrid id="dgCustomADList" runat="server" AllowPaging="False" AutoGenerateColumns="False"
							DataKeyField="ADID" Width="100%" HorizontalAlign="Center" HeaderStyle-CssClass="summary-title">
							<HeaderStyle Font-Bold="True" CssClass="summary-title"></HeaderStyle>
							<Columns>
								<asp:TemplateColumn HeaderText="广告位置名称">
									<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									<ItemStyle HorizontalAlign="Left"></ItemStyle>
									<ItemTemplate>
										<%# DataBinder.Eval(Container.DataItem, "Name") %>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="广告页面代码">
									<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
									<ItemStyle HorizontalAlign="Left"></ItemStyle>
									<ItemTemplate>
										&lt;%=wqeshop.WebUtils.GetAD(<%# DataBinder.Eval(Container.DataItem, "ADID") %>)%&gt;
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="开放/关闭" ItemStyle-Width="60" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center">
									<HeaderStyle></HeaderStyle>
									<ItemTemplate>
										<a href='Actions.aspx?Action=ChangeADInNav&ADID=<%# DataBinder.Eval(Container.DataItem, "ADID") %>&Status=<%# DataBinder.Eval(Container.DataItem, "IsOpen")%>'>
											<img src='images/publish_<%# DataBinder.Eval(Container.DataItem, "IsOpen")%>.png' border="0"></a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn>
									<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
									<ItemTemplate>
										<a href='AD.aspx?ADID=<%# DataBinder.Eval(Container.DataItem, "ADID") %>'>修改</a>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
									CommandName="Delete">
									<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
								</asp:ButtonColumn>
							</Columns>
							<PagerStyle Mode="NumericPages"></PagerStyle>
						</asp:datagrid>
					</td>
				</tr>
			</table>
		</td>
		<td class="mr1"></td>
	</tr>
</table>
</td>
  </tr>
</table>


<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>
</td>
    <td  class="mr"></td>
  </tr>
</table>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>

</div>
    </td>
  </tr>
</table>
<% }else{%>
<table width="100%" height="550" style="border:1px #619ADF solid; border-left:0;margin-top:6px; margin-right:7px;background:#F2F7FD;" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
<div class="top">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><span class="tt">营销管理 &gt;&gt;  广告<asp:Literal Runat="server" ID="ltrAction" Text="修改"></asp:Literal></span></td>
		<td class="tm2"><span class="tt"><a href="http://www.wangqi.com" target="_blank"><img src="Images/admin_help.gif" border="0" alt="帮助"></a></span></td>
		<td class="tr"></td>
	</tr>
</table>
</div>
<div class="mframe">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><div class="tt">&nbsp; 广告修改</div></td>
		<td class="tr"></td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td class="ml"></td>
    <td  class="mm" align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#EBF3FE" valign="top" style=" border-right:1px #77ABE5 solid;">
<table width="90%"  cellspacing="0" cellpadding="0">
	<tr>
		<td class="ml1"></td>
		<td class="mm1">
			<table class="tableBorder" cellSpacing="0" cellPadding="0" width="640" align="center" border="0">
				<tr>
					<td class="summary-title" colspan="2">编辑广告内容</td>
				</tr>
				<tr>
					<td class="forumRowHighlight" width="100">广告位置描述：</td>
					<td class="forumRowHighlight">
						<asp:TextBox id="txtName" CssClass="input" runat="server"></asp:TextBox><FONT face="宋体">&nbsp;所属类别：</FONT>
						<asp:DropDownList id="ddlAdType" runat="server">
							<asp:ListItem Value="1">固定广告</asp:ListItem>
							<asp:ListItem Value="2">左侧广告位</asp:ListItem>
							<asp:ListItem Value="3">自定义广告</asp:ListItem>
						</asp:DropDownList></td>
				</tr>
				<tr>
					<td class="forumRowHighlight" width="100">开放：</td>
					<td class="forumRowHighlight">
						<asp:CheckBox id="cbOpen" runat="server" Text="开放广告请打勾"></asp:CheckBox>
					</td>
				</tr>
                <tr>
					<td class="forumRowHighlight" width="100" align="top">广告样式：</td>
					<td class="forumRowHighlight">
						<pre><xmp>无连接： <IMG src="广告图片位置">
有连接： <A href="连接地址" target="blank"><IMG src="广告图片位置"></A></xmp></pre>
					</td>
				</tr>
				<% if(Request.QueryString["ADID"] == "3") {%>
				<tr>
					<td class="forumRowHighlight" width="100">广告属性：</td>
					<td class="forumRowHighlight">
						长:<asp:TextBox id="txtWidth" CssClass="input" runat="server" Width="50px"></asp:TextBox>px&nbsp;&nbsp; 
						距离浏览器顶部:<asp:TextBox id="txtTop" CssClass="input"  runat="server" Width="50px"></asp:TextBox>px&nbsp;&nbsp;
						<br>
						高:<asp:TextBox id="txtHigth" runat="server" CssClass="input"  Width="50px"></asp:TextBox>px&nbsp;&nbsp; 
						距离浏览器左边:<asp:TextBox id="txtLeft" CssClass="input"  runat="server" Width="50px"></asp:TextBox>px&nbsp;&nbsp;
					</td>
				</tr>
				<% }%>
				<tr>
					<td class="forumRowHighlight" width="100">广告内容：</td>
					<td class="forumRowHighlight">
						<FTB:FREETEXTBOX id="ftbContent" runat="Server" ImageGalleryPath="Upload/" ToolbarType="OfficeXP"
							ButtonPath="images/ftb/officeXP/" ButtonDownImage="True" ButtonOverImage="True" Width="520"></FTB:FREETEXTBOX>
					</td>
				</tr>
				<tr height="35">
					<td colspan="2" class="forumRowHighlight" align="center">
		<asp:Button id="btnSave" CssClass="btn" runat="server" Text="保 存"></asp:Button><FONT face="宋体">&nbsp;</FONT>&nbsp;
		<asp:Button id="btnCancel" CssClass="btn" runat="server" Text="取消"></asp:Button></td>
				</tr>
			</table>
			
		</td>
		<td class="mr1"></td>
	</tr>
</table>
</td>
  </tr>
</table>


<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>
</td>
    <td  class="mr"></td>
  </tr>
</table>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>

</div>
    </td>
  </tr>
</table>
<% }%>	
		</form>
	</body>
</HTML>
