<%@ Page language="c#" Codebehind="TagImg.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.TagImg" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
		<title>标签图片</title> 
		<!--#include file="../inc/head2.inc"-->
		<script src="../inc/commond.js" type="text/javascript"></script>
		<script language="javascript">
		$(document).ready(function(){ 
			$("#btnSave").click(function(){
				if($("#ddlTagID").val()=="0"){
					alert("请选择标签!");
					return false;
				};
				if(getQueryStringRegExp('TagImgID') == ''&& $("#File1").val()==""){
					alert("请选择图片!");
					return false;
				};
			});
		});
		</script>
	</HEAD>
	<body>
		<div class="container">
			<div class="sub_container">
				<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height="9" width="8" align="absMiddle">
					<% if(Request.QueryString["Action"] == "Add") {%>
					标签图片添加<% }else{%>
					标签图片管理<% }%></div>
				<div class="sub_container_content">
					<form id="Form1" method="post" runat="server">
						<% if(Request.QueryString["Action"] == "Add") {%>
						<div class="frame">
							<div class="frame_title">标签图片添加</div>
							<div class="frame_content">
								<table class="tableBorder" cellSpacing="1" cellPadding="1" width="100%" align="center" border="0">
									<tr>
										<td>
											<table class="ptable" cellspacing="0" cellpadding="0">
												<tr>
													<th class="tl">标签：</t>
													<td class="tr">
														<asp:DropDownList ID="ddlTagID" AutoPostBack="False" Runat="server">
															<asp:ListItem Value="0">选择标签</asp:ListItem>
															<asp:ListItem Value="1">特价商品</asp:ListItem>
															<asp:ListItem Value="2">热卖商品</asp:ListItem>
															<asp:ListItem Value="3">推荐商品</asp:ListItem>
															<asp:ListItem Value="4">清仓商品</asp:ListItem>
															<asp:ListItem Value="5">限时抢购</asp:ListItem>
															<asp:ListItem Value="6">拍卖商品</asp:ListItem>
															<asp:ListItem Value="7">团购商品</asp:ListItem>
														</asp:DropDownList>
													</td>
												</tr>
												<tr>
													<th class="tl">图片：</th>
													<td class="tr"><INPUT id="File1" type="file" name="File1" class="file" runat="server"></td>
												</tr>
												<tr>
													<th class="tl"></th>
													<td class="tr"><asp:button id="btnSave" OnClick="btnSave_Click" Text="保存" Runat="server" CssClass="inputbtn"></asp:button>
													<asp:button id="btnCancel" OnClick="btnCancel_Click" runat="server" Text="取消" CausesValidation="False" CssClass="inputbtn"></asp:button></td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</div>
						</div>
						<% }else{%>
						<div class="frame">
							<div class="frame_title">
								标签图片管理</div>
							<div class="frame_content">
								<table class="tableBorder" cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
									<tr>
										<td class="forumRowHighlight" height="23">
											<asp:datagrid id="dgTagImg" runat="server" Width="100%" HeaderStyle-CssClass="summary-title" HorizontalAlign="Center"
												DataKeyField="TagImgID" AutoGenerateColumns="False" PagerStyle-Mode="NumericPages" PageSize="20"
												AllowPaging="True">
												<HeaderStyle Font-Bold="True" CssClass="summary-title"></HeaderStyle>
												<Columns>
													<asp:TemplateColumn HeaderText="标签图片">
														<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
														<ItemTemplate>
															<img src='../../Upload/TagImg/<%#DataBinder.Eval(Container.DataItem,"Img")%>' width="70">
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="所属标签">
														<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
														<ItemTemplate>
															<%#GetTagName(DataBinder.Eval(Container.DataItem,"TagID").ToString())%>
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn HeaderText="调用代码(双击选中,后面2位参数对应宽度和高度)">
														<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
														<ItemTemplate>
															<input type="text" value="&lt;%=GetTagImg(<%#DataBinder.Eval(Container.DataItem, "TagImgID")%>,0,0)%&gt;" disabled="false" style="width:200px;border:0px;font-size:14px;" />
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:TemplateColumn>
														<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
														<ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
														<ItemTemplate>
															<a href='TagImg.aspx?Action=Add&TagImgID=<%# DataBinder.Eval(Container.DataItem, "TagImgID") %>'>
																修改</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="50px"></ItemStyle>
													</asp:ButtonColumn>
												</Columns>
												<PagerStyle Mode="NumericPages"></PagerStyle>
											</asp:datagrid>
										</td>
									</tr>
								</table>
							</div>
						</div>
						<%}%>
					</form>
				</div>
			</div>
		</div>
	</body>
</HTML>
