<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Page language="c#" Codebehind="ActivityAdd.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.ActivityAdd" validateRequest="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
  <head>
		<!--#include file="../inc/head2.inc"-->
    <title>活动专场管理</title>
	<script type="text/javascript" src="../inc/PageBar.js"></script>
	<script type="text/javascript" src="../inc/commond.js"></script>
	<script type="text/javascript" src="../inc/jquery.easydrag.handler.beta2.js"></script>
	<script type="text/javascript" src="../inc/multi_popup.js"></script>
    <script type="text/javascript" src="inc/ActivityAdd.js"></script>
	<link type="text/css" rel="stylesheet" href="../style/multi_popup.css" />
	
    <style type="text/css">
	    .c1{ width:5%}
	    .c2{ width:25%}
	    .c3{ width:25%}
	    .c4{ width:15%}
	    .c5{ width:15%}
	    .c6{ width:15%}
	</style>
  </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"><asp:label id="lblTitleInfo" Runat="server" CssClass="tableHeaderText">活动专场添加</asp:label></div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title"><asp:Label ID="lbTitle" Runat="server" CssClass="tableHeaderText">专题添加</asp:Label></div>
		        <div class="frame_content">
			        <table cellSpacing="0" cellPadding="0" class="ptable" style="width:99%">
				        <tr>
					        <th class="tl">专场标题：</th>
					        <td class="tr">
					            <asp:textbox id="txtTitle" runat="server" Width="300px" MaxLength="250"></asp:textbox>
					            <asp:CheckBox id="cbxPublish" runat="server" Text="发布"></asp:CheckBox>
					        </td>
				        </tr>
				        <tr>
				            <th class="tl">专题类别：</th>
				            <td class="tr">
				                <asp:DropDownList ID="ddlCategory" runat="server"></asp:DropDownList>
				            </td>
				        </tr>
				        <tr>
				            <th class="tl">描述内容：</th>
				            <td class="tr">
				                <FTB:FREETEXTBOX id="ftbDescription" runat="Server" ImageGalleryPath="Upload/" ToolbarType="OfficeXP" ButtonPath="../images/ftb/officeXP/"
				                ButtonDownImage="True" ButtonOverImage="True" Width="800" Height="150"></FTB:FREETEXTBOX>
				                <br/>
				                <span id="ftbdescription_addwidth" class="hand">加宽</span>
				                <span id="ftbdescription_addheight" class="hand">加高</span>
				                <br />
				            </td>
				        </tr>
				        <tr>
				            <th class="tl">广告内容：</th>
				            <td class="tr">
				                <FTB:FREETEXTBOX id="ftbAD" runat="Server" ImageGalleryPath="Upload/" ToolbarType="OfficeXP" ButtonPath="../images/ftb/officeXP/" ButtonDownImage="True" ButtonOverImage="True" Width="800" Height="150"></FTB:FREETEXTBOX>
				                <br/>
				                <span id="ftbAD_addwidth" class="hand">加宽</span>
				                <span id="ftbAD_addheight" class="hand">加高</span>
				                <br />
				            </td>
				        </tr>
				        <tr>
				            <th class="tl">添加商品内容：</th>
				            <td class="tr">
				                <div class="cattemplate" id="cattemplate" style="display:none;">
				                    <div class="inputContainer">
				                        分类：<input type="text" name="txtCatName" /><input type="hidden" name="catID" value="0" /><input type="button" id="btnShowPop" name="btnShowPop" value="添加商品" class="inputbtn" /><input type="button" id="btnShowUpload" value="点击上传背景图片" class="inputbtn" /><input type="hidden" id="CatProductIDs" name="CatProductIDs" /><input type="button" id="DelCat" value="删除分类" class="inputbtn" />
				                    </div>
				                    <div>
				                        <table class="listresult dataContainer">
                                            <tr class="resulthead">
                                                <th></th>
                                                <th>商品名称</th>
                                                <th>商品编码</th>
                                                <th>排序</th>
                                            </tr>
                                        </table>
				                    </div>
				                </div>
				                <asp:Repeater id="rptCategory" runat="server">
				                    <ItemTemplate>
				                        <div class="cattemplate" id="cattemplate_<%# Container.ItemIndex %>">
				                            <div class="inputContainer">
				                                分类：<input type="text" name="txtCatName_<%# Container.ItemIndex %>" value="<%#DataBinder.Eval(Container.DataItem,"CatName")%>" /><input type="hidden" name="catID_<%# Container.ItemIndex %>" value="<%#DataBinder.Eval(Container.DataItem,"ActCatID")%>" /><input type="button" id="btnShowPop_<%# Container.ItemIndex %>" name="btnShowPop" value="添加商品" /><input type="button" id="btnShowUpload_<%# Container.ItemIndex %>" value="点击上传背景图片" /><input type="hidden" id="CatProductIDs_<%# Container.ItemIndex %>" name="CatProductIDs_<%# Container.ItemIndex %>" value="<%# GetCatPdtIDs((int)DataBinder.Eval(Container.DataItem,"ActCatID"))%>" /><input type="button" id="DelCat_<%# Container.ItemIndex %>" value="删除分类" />
				                            </div>
				                            <div>
				                                <table class="listresult dataContainer" style="width:800px;">
                                                    <tr class="resulthead">
                                                        <th width="50"></th>
                                                        <th>商品名称</th>
                                                        <th width="100">商品编码</th>
                                                        <th width="100">排序</th>
                                                    </tr>
                                                    <asp:Repeater runat="server" ID="rptProduct" DataSource='<%# BindProducts((int)DataBinder.Eval(Container.DataItem,"ActCatID")) %>'>
                                                        <ItemTemplate>
                                                            <tr>
                                                                <td class="delete"><img src="../images/x-gray.gif" alt="删除" /><input type="hidden" name="pid" value="<%#DataBinder.Eval(Container.DataItem,"ProductID")%>"></td>
                                                                <td><%#DataBinder.Eval(Container.DataItem,"ProductName")%></td>
                                                                <td><%#DataBinder.Eval(Container.DataItem,"ProductNo")%></td>
                                                                <td><input type="text" class="inputstyle" size="9" maxlength="10" name='sort_' value='<%#DataBinder.Eval(Container.DataItem,"Sort")%>' /></td>
                                                            </tr>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </table>
				                            </div>
				                        </div>
				                    </ItemTemplate>
				                </asp:Repeater>
				                <input type="button" id="btnAddCat" value="添加分类" class="inputbtn" />
				            </td>
				        </tr>
				        <tr>
				            <th class="tl">编辑样式：</th>
				            <td class="tr"><asp:TextBox ID="txtStyle" runat="server" TextMode="multiLine" Columns="110" Rows="20"></asp:TextBox><input type="hidden" id="tempFolder" name="tempFolder" value='<%=folder %>' /></td>
				        </tr>
				        <tr>
					        <td colSpan="2" class="center">
						        <asp:button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存" CssClass="inputbtn"></asp:button>
						        <input type="button" value="预览" id="btnPreview" class="inputbtn" />
						        <asp:button id="btnCancel" runat="server" Text="取消" CausesValidation="False" CssClass="inputbtn"></asp:button>
						        <input type="hidden" id="hidden_CatNum" name="hidden_CatNum" value="1" />
						    </td>
				        </tr>
			        </table>
		        </div>
	        </div>
		</form>
		
		<div id="uploadContent" class="popupContact" style="z-index:2;">
            <div id="uploadHead" class="popupHead">
                <div class="popupTitle">上传图片</div>
                <div class="popupClose" id="uploadClose" title="关闭">关闭</div>
                <div style="clear:both;"></div>
            </div>
            
            <div id="uploadcontainer" style="position:relative; padding:5px; text-align:center;">
                <iframe id="frmUpload" src='Upload.aspx?tempFolder=<%=folder %>' frameborder="0" width="100%" height="90%"></iframe>
                <div style="clear:both;"></div>
            </div>
        </div>
		
		</div>
		</div>
		</div>
		
        <div id="popupContact" class="popupContact" style="z-index:2;">
            <div id="popupHead" class="popupHead">
                <div class="popupTitle">高级搜索</div>
                <div class="popupClose" id="popupContactClose" title="关闭">关闭</div>
                <div style="clear:both;"></div>
            </div>
            <div style="position:relative; padding:0px; text-align:center;">
                <div id="content" style="width:98%; position:relative;">
                    <div>
                        <select id="sel_searchType" name="sel_searchType">
                            <option value="1">商品编号</option>
                            <option value="2">商品名称</option>
                            <option value="3">商品关键词</option>
                        </select>
                        <input type="text" id="txtKeyword" name="txtKeyword" />
                        <input type="button" id="btnSearch" name="btnSearch" value="搜索" class="inputbtn" />
                        <a id="showadvsearch" class="hand">高级搜索</a>
                    </div>
                    <div id="advsearch" style="display:none; position:absolute; top:30px; background:#fff;">
                        <select id="sel_category" name="sel_category" size="10" multiple="multiple">
                            <%=BindCategories() %>
                        </select>
                        <select id="sel_brand" name="sel_brand" size="10" multiple="multiple">
                            <%=BindBrand("1")%>
                        </select>
                    </div>
                    <div class="sub_container_listhead" style="padding:0px;">
                        <table cellSpacing="0" cellPadding="0" class="llist">
                            <tr id="listhead"><%--id="listhead"不能少--%>
                                <th class="c1"><input type="checkbox" id="chkAll" name="chkAll" /></th>
                                <th class="c2">商品名称</th>
                                <th class="c3">商品代码</th>
                                <th class="c4">商品类别</th>
                                <th class="c5">商品品牌</th>
                                <th class="c6">会员价格</th>         
                            </tr>
                        </table>
                    </div>
                    <div id="datacontainer" style="padding:0px;overflow-x:hidden;overflow-y:scroll;">
	                    <table id="datas" cellSpacing="0" cellPadding="0" class="llist">
		                    <tr id="template" style="display:none;"><%--id="template"不能少--%>
			                    <td class="c1 ccenter" id="checkbox"></td>
			                    <td class="c2" id="Name"></td>
			                    <td class="c3" id="ProductNo"></td>
			                    <td class="c4 ccenter" id="Category"></td>
			                    <td class="c5 ccenter" id="Brand"></td>
			                    <td class="c6 ccenter" id="MemberPrice"></td>
			                    <td style="display:none;" id="MarketPrice"></td>
			                    <td style="display:none;" id="Image"></td>
		                    </tr>
	                    </table>
                    </div>
                    <div class="sub_container_page" id="pageDataList1_Pager" style="position:relative;">
                        <!-- 翻页-->
                        <!-- 翻页结束-->
                    </div>
                    <div id="divsave" style=" text-align:center; position:relative;"><input type="button" id="btnSubmit" value="确认" class="inputbtn" /><input type="hidden" id="PIDs" name="PIDs" value="" /></div>
	            </div>
                <div style="clear:both;"></div>
            </div>
        </div>
        <div id="backgroundPopup" class="backgroundPopup"></div>
        
        <div style="display:none;">
            <form id="formpreview" method="post" action='<%=webSite %>ActivityPreview.aspx' target="_blank"></form>
        </div>
        
  </body>
</html>
