<%@ Page language="c#" Codebehind="ProductAdd_Step2.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Supplier.ProductAdd_Step2" validateRequest="false"%>
<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
	<HEAD>
		<title>ProductAdd</title> 
		<!--#include file="../inc/head.inc"-->
		<script type="text/javascript" src="../inc/multi_popup.js"></script>
		<script type="text/javascript" src="../inc/jquery.json.js"></script>
		<script type="text/javascript" src="../inc/jquery.easydrag.handler.beta2.js"></script>
		<script type="text/javascript" src="../inc/commond.js"></script>
		<script type="text/javascript" src="../inc/SearchProduct.js"></script>
		<script type="text/javascript" src="../inc/PageBar.js"></script>
		<script type="text/javascript" src="../inc/ProductAdd.js"></script>
		<script type="text/javascript" src="../inc/ui.datepicker.cn.js"></script>
		<script type="text/javascript">
			var cid="<%=Request.Form["cid"] == null ? Request.QueryString["cid"] : Request.Form["cid"] %>";
			var pid="<%=Request.QueryString["ProductID"] == null ? "0" : Request.QueryString["ProductID"] %>";
			var gid="<%=Request.QueryString["group"] == null ? "0" : Request.QueryString["group"] %>";
		</script>
		<link type="text/css" rel="stylesheet" href="../style/ui.datepicker.css" />
		<link type="text/css" rel="stylesheet" href="../style/multi_popup.css" />
		<style type="text/css">
			html,body{overflow:hidden;}
		    .listresult{}
            .listresult th{width:150px; text-align:center;}
            .listresult td{width:150px; text-align:center;}
		</style>
	</HEAD>
	<body>
		<div id="JsContent" style="DISPLAY:none"></div>
		<!--loading start-->
		<div id="loadingContainer">
			<div class="panel">
				<div class="loadIcon">
					<div>正在加载...</div>
				</div>
			</div>
			<div id="loadingbackground"></div>
		</div>
		<!--loading end-->
		<div class="container">
			<div class="sub_container">
				<form id="Form1" method="post" runat="server">	
					<div class="sub_container_tabs">
						<div style="float:left;">
							商品分类：<span id="catname"><%=Request.Form["catname"]%></span>
							<input type="hidden" id="catpath" value="<%=Request.Form["catpath"]%>" />
							
							<input type="button" id="btnChangeCat" value="编辑分类" />
						</div>
						<div class="tabmenu">
							<ul>
								<li class="menuitem tabon">
								全部信息</li>
								<li class="menuitem tabout">
								基本信息</li>
								<li class="menuitem tabout">
								商品属性</li>
								<li class="menuitem tabout">
								商品参数</li>
								<li class="menuitem tabout">
								商品规格</li>
								<li class="menuitem tabout">
								商品图片</li>
								<li class="menuitem tabout">
								商品状态</li>
								<li class="menuitem tabout">
								附件</li>
								<li class="menuitem tabout">
								详细描述</li>
								<li class="menuitem tabout">
								商品标签</li>
								<li class="menuitem tabout">
								SEO优化</li>
								<li class="menuitem tabout">
									相关商品</li>
							</ul>
						</div>
					</div>
					
					<div class="sub_container_content" id="container">
						<div class="frame tab">
							<div class="frame_title">基本信息</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0" class="ptable">
									<tr>
										<th class="tl">商品名称：</th>
										<td class="tr">
											<asp:textbox id="txtName" runat="server"></asp:textbox><font color="red">*</font>
											<input type="hidden" id="cid" name="cid" value="<%=Request.Form["cid"]%>">
										</td>
									</tr>
									<tr>
										<th class="tl">商品编码：</th>
										<td class="tr"><asp:textbox id="txtProductNo" runat="server" Width="80pt"></asp:textbox>
											<asp:CheckBox id="cbxAutoCreate" runat="server" Text="自动生成"></asp:CheckBox></td>
									</tr>
									<tr>
										<th class="tl">商品品牌：</th>
										<td class="tr">
											<select id="ddlBrand" name="ddlBrand">
												
											</select>
										</td>
									</tr>
									<tr>
										<th class="tl">简单描述：</th>
										<td class="tr">
											<FTB:FREETEXTBOX id="ftbShortDesc" runat="Server" Width="520" height="100" ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" ImageGalleryPath="Upload/"></FTB:FREETEXTBOX>
										</td>
									</tr>
									<tr>
										<th class="tl">计量单位：</th>
										<td class="tr"><asp:textbox id="txtUnit" runat="server"></asp:textbox><FONT color="red">*</FONT></td>
									</tr>
									<tr>
										<th class="tl">单位重量：</th>
										<td class="tr"><asp:textbox id="txtWeight" runat="server">0</asp:textbox>克</td>
									</tr>
									<% if(config.MarkUnit == 1) {%>
									<tr>
										<th class="tl">积分点数：</th>
										<td class="tr"><asp:textbox id="txtScore" runat="server">0</asp:textbox><FONT color="red"></FONT></td>
									</tr>
									<% }%>
									<tr>
										<th class="tl">市场价格：</th>
										<td class="tr"><asp:textbox id="txtMarketPrice" runat="server">0</asp:textbox><FONT color="red">*</FONT></td>
									</tr>
									<tr>
										<th class="tl">会员价格：</th>
										<td class="tr"><asp:textbox id="txtMemberPrice" runat="server">0</asp:textbox><FONT color="red">*</FONT></td>
									</tr>
									<tr>
										<th class="tl">最低购买数量：</th>
										<td class="tr"><asp:textbox id="txtMin" runat="server">1</asp:textbox><FONT color="red">*</FONT></td>
									</tr>
									<!--
									<tr>
										<th class="tl">上架时间：</th>
										<td class="tr"><input type="text" id="startTime" runat="server" readonly="readonly" class="datepicker" /><FONT color="red">*</FONT></td>
									</tr>
									<tr>
										<th class="tl">下架时间：</th>
										<td class="tr"><input type="text" id="endTime" runat="server" readonly="readonly" class="datepicker" /><FONT color="red">*</FONT></td>
									</tr>
									-->											
								</table>
							</div>
						</div>
						<div class="frame tab">
							<div class="frame_title">商品属性</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0"class="ptable" id="prop"></table>
							</div>
						</div>
						
						<div class="frame tab">
							<div class="frame_title">商品参数</div>
							<div class="frame_content">
								<div id="para"></div>
							</div>
						</div>
						
						<div class="frame tab">
							<div class="frame_title">商品规格<input type="button" id="add_spec" class="hand" value="规格选择" /></div>
							<div class="frame_content">
								<table class="tableBorder" cellspacing="0" cellpadding="0" width="95%" align="center" border="1" id="spec_list">
									<thead>
										<tr id="spec_list_thead">
										</tr>
									</thead>
									<tbody id="spec_list_tbody">
									</tbody>									
								</table>
							</div>
							<div id="hidden_info"></div>
						</div>
						<div class="frame tab">
							<div class="frame_title">商品图片</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0" class="ptable">
									<tr>
										<th class="tl">添加水印：</th>
										<td class="tr">
											<table style="WIDTH:450px">
												<tr>
													<td valign="bottom"><asp:radiobutton id="rbNoWatermark" runat="server" GroupName="watermark" Text="不添加水印" Checked="True"></asp:radiobutton><asp:radiobutton id="rbPicWatermark" runat="server" Text="添加图片水印" GroupName="watermark"></asp:radiobutton>
														<asp:radiobutton id="rbFontWatermark" runat="server" Text="添加文字水印" GroupName="watermark"></asp:radiobutton>
														<font color="red">(文字水印只支持JPG格式图片)</font></td>
													<td valign="bottom"></td>
												</tr>
											</table>
										</td>
									</tr>
									<tr>
										<th class="tl">商品大图：</th>
										<td class="tr"><input id="File2" type="file" name="file2" runat="server"></td>
									</tr>
									<tr>
										<th class="tl">商品缩略图：</th>
										<td class="tr"><span id="ThumbnailPic" style="DISPLAY: none"><input id="File1" type="file" name="file2" runat="server"></span><asp:checkbox id="cbxFromBigPic" runat="server"></asp:checkbox>自动生成宽度为<asp:textbox id="txtPicWidth" runat="server" Width="30px">90</asp:textbox>象素的缩略图
										</td>
									</tr>
									<tr>
										<th class="tl">商品多图：</th>
										<td class="tr">
											<P id="FileCollection"><input type="file" name="File"></P>
										</td>
									</tr>
									<tr>
										<td colspan="2" class="tr"><input type="button" id="btnAddFile" value="增加(File)"></td>
									</tr>
									<tr>
										<td colspan="2" class="tr">
											<asp:datagrid id="dgRelatedImgs" runat="server" Width="50%" DataKeyField="img" AutoGenerateColumns="False"
												HeaderStyle-CssClass="summary-title">
												<Columns>
													<asp:TemplateColumn HeaderText="商品多图图片">
														<ItemTemplate>
															<a href='../upload/relatedImgs/<%# DataBinder.Eval(Container.DataItem, "img") %>' target="_blank">
																<%# DataBinder.Eval(Container.DataItem, "img") %>
															</a>
														</ItemTemplate>
													</asp:TemplateColumn>
													<asp:ButtonColumn ButtonType="LinkButton" HeaderText="删除" Text="删除" CommandName="Delete"></asp:ButtonColumn>
												</Columns>
											</asp:datagrid>
										</td>
									</tr>
								</table>
							</div>
						</div>
						<div class="frame tab">
							<div class="frame_title">商品状态</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0" class="ptable">
									<tr>
										<th class="tl">库存数量：</th>
										<td class="tr"><asp:Label ID="lblStorage" runat="server" ForeColor="blue" Text="0"></asp:Label>最新入库：<asp:textbox id="txtStorage" runat="server" Width="80px">0</asp:textbox></td>
									</tr>
									<tr>
										<th class="tl">是否库存警告：</th>
										<td class="tr">
											<asp:checkbox id="cbxNeedAlert" runat="server"></asp:checkbox>
											<SPAN id="mininum" style="DISPLAY: none">警告数量：
											<asp:textbox id="txtMininum" runat="server" Width="80px">0</asp:textbox></SPAN>
										</td>
									</tr>
									<tr>
										<th class="tl">是否发布：</th>
										<td class="tr"><asp:checkbox id="cbxForSale" runat="server" Checked="True"></asp:checkbox><asp:checkbox id="cbxIsCard" runat="server" Visible="False"></asp:checkbox><SPAN id="card" style="DISPLAY: none">虚拟卡管理</SPAN></td>
									</tr>
									<tr>
										<th class="tl">是否允许评论：</th>
										<td class="tr"><asp:checkbox id="cbxCanReview" runat="server" Checked="True"></asp:checkbox></td>
									</tr>
									<tr>
										<th class="tl">是否参与打折：</th>
										<td class="tr"><asp:checkbox id="cbxDiscount" runat="server" Checked="True"></asp:checkbox></td>
									</tr>
								</table>
							</div>
						</div>
						<div class="frame tab">
							<div class="frame_title">附件</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0" class="ptable">
									<tr>
										<td colsapn="2" class="mm">	
											选择商品：										
											<input type="button" id="btnAddFitting" value="添加附件商品" />
											<input type="hidden" id="FitPID_old" name="FitPID_old" /><%--记录数据库中已经存在的附件商品ID--%>
											<input type="hidden" id="FitPID_curr" name="FitPID_curr" /><%--记录当前页面中存在的附件商品ID--%>
											<input type="hidden" id="FitPID_new" name="FitPID_new" /><%--记录要添加到数据库中的新ID--%>
											<input type="hidden" id="FitPID_deleted" name="FitPID_deleted" /><%--记录要从数据库中删除的ID--%>
										</td>
									</tr>
									<tr>
										<td colspan="2" class="mm">
											<%BindFittings(); %>
											<table id="fitcontent" border="1" cellspacing="0" bordercolor="#000000" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" class="listresult">
												<tr>
													<th>操作</th>
													<th>商品代码</th>
													<th>商品名称</th>
												</tr>
												<asp:Repeater ID="rptFittings" runat="server">
													<ItemTemplate>
														<tr>
															<td class="delete"><img src="../images/x-gray.gif" alt="删除" /><input type="hidden" name="fitpid" value='<%#DataBinder.Eval(Container.DataItem,"ProductID") %>'></td>
															<td><%#DataBinder.Eval(Container.DataItem,"ProductNo") %></td>
															<td><%#DataBinder.Eval(Container.DataItem,"ProductName") %></td>
														</tr>
													</ItemTemplate>
												</asp:Repeater>
											</table>
										</td>
									</tr>							
								</table>								
							</div>
						</div>
						<div class="frame tab">
							<div class="frame_title">详细描述</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0" class="ptable">
									<tr>
										<th class="tl">详细描述：</th>
										<td class="tr">
											<FTB:FREETEXTBOX id="ftbContent" runat="Server" Width="900" ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" ImageGalleryPath="Upload/"></FTB:FREETEXTBOX>
										</td>
									</tr>
									<tr>
										<th class="tl">包装清单：</th>
										<td class="tr">
											<FTB:FREETEXTBOX id="ftbPackingList" runat="Server" Width="900" ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" ImageGalleryPath="Upload/"></FTB:FREETEXTBOX>
										</td>
									</tr>
									<tr>
										<th class="tl">售后服务：</th>
										<td class="tr">
											<FTB:FREETEXTBOX id="ftbAfterService" runat="Server" Width="900" ButtonOverImage="True" ButtonDownImage="True" ButtonPath="../images/ftb/officeXP/" ToolbarType="OfficeXP" ImageGalleryPath="Upload/"></FTB:FREETEXTBOX>
										</td>
									</tr>
								</table>
							</div>
						</div>
						<div class="frame tab">
							<div class="frame_title">商品标签</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0" class="ptable">
									<tr>
										<th class="tl">
											已选标签：
										</th>
										<td class="tr">
											<textarea id="txtKeyword" style="width:500px;height:150px;"></textarea>
										</td>
									</tr>
								</table>
							</div>
						</div>
						<div class="frame tab">
							<div class="frame_title">SEO优化</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0"  class="ptable">
									<tr>
										<th class="tl">页面标题：</th>
										<td class="tr">
											<asp:TextBox ID="txtTitle" runat="server" Width="300px"></asp:TextBox>
										</td>
									</tr>
									<tr>
										<th class="tl">meta_keywords：</th>
										<td class="tr">
											<asp:TextBox ID="txtMetaKeyword" runat="server" TextMode="multiLine" Rows="3" Width="300px"></asp:TextBox>
										</td>
									</tr>
									<tr>
										<th class="tl">meta_description：</th>
										<td class="tr">
											<asp:TextBox ID="txtMetaDescription" runat="server" TextMode="multiLine" Rows="3" Width="300px"></asp:TextBox>
										</td>
									</tr>
								</table>
							</div>
						</div>
						<div class="frame tab">
							<div class="frame_title">相关商品</div>
							<div class="frame_content">
								<table cellspacing="0" cellpadding="0" class="ptable">
									<tr>
										<td colspan="2" class="mm">	
											选择商品：										
											<input type="button" id="btnAddRelate" value="添加" />
											<input type="hidden" id="RltPID_old" name="RltPID_old" /><%--记录数据库中已经存在的相关商品ID--%>
											<input type="hidden" id="RltPID_curr" name="RltPID_curr" /><%--记录当前页面中存在的相关商品ID--%>
											<input type="hidden" id="RltPID_new" name="RltPID_new" /><%--记录要添加到数据库中的新ID--%>
											<input type="hidden" id="RltPID_deleted" name="RltPID_deleted" /><%--记录要从数据库中删除的ID--%>
										</td>
									</tr>
									<tr>
										<td colspan="2" class="mm">
											<%BindRltPdts(); %>
											<table id="listresult" border="1" cellspacing="0" bordercolor="#000000" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" class="listresult">
												<tr>
													<th>操作</th>
													<th>商品代码</th>
													<th>商品名称</th>
												</tr>
												<asp:Repeater ID="rptRltPdts" runat="server">
													<ItemTemplate>
														<tr>
															<td class="delete"><img src="../images/x-gray.gif" alt="删除" /><input type="hidden" name="rltpid" value='<%#DataBinder.Eval(Container.DataItem,"ProductID") %>'/></td>
															<td><%#DataBinder.Eval(Container.DataItem,"ProductNo") %></td>
															<td><%#DataBinder.Eval(Container.DataItem,"ProductName") %></td>
														</tr>
													</ItemTemplate>
												</asp:Repeater>
											</table>
										</td>
									</tr>								
								</table>								
							</div>
						</div>
					</div>
										 
					<div class="save">
						<asp:button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存"></asp:button>
						<asp:button id="btnCancel" OnClick="btnCancel_Click" runat="server" Text="取消" CausesValidation="False"></asp:button>
					</div>
				</form>
			</div>
		</div>
		<div id="ShowCategory" class="popupContact" style="z-index:2;">
            <div id="SelectCategoryHead" class="popupHead">
                <div class="popupTitle">选择商品分类</div>
                <div class="popupClose" id="SelectCategoryClose" title="关闭">关闭</div>
                <div style="clear:both;"></div>
            </div>
            <div style=" padding:10px;">
                <table cellspacing="0" cellpadding="0" class="ptable" style="width:100%">
					<tr>
						<td class="mm">
							<div id="categorys" style="width:96.5%;">
								<ul id="cul"></ul>
							</div>
						</td>
					</tr>
					<tr>
						<td class="mm"><div id="next" class="next disable popupClose"></div></td>
					</tr>
				</table>
            </div>
        </div>
		<div id="ShowSpec" class="popupContact" style="z-index:2;zoom:1;position:relative;">
			<div id="SpecHead" class="popupHead">
				<div class="popupTitle">增加规格</div>
				<div class="popupClose" id="SpecClose" title="关闭">关闭</div>
				<div style="clear:both;"></div>
			</div>
			<div style="margin:0 auto;width:98%;">
				<ul class="spec">
					<li class="spec_left">
						第一步：选择规格名称
						<ul id="spec_name">
						</ul>
					</li>
					<li class="spec_right">
						第二步：选择规格值
						<ul id="spec_value">
						</ul>
					</li>
				</ul>
			</div>
			<div style="position:absolute;left:0px;bottom:0px;width:100%;background-color:#eee;text-align:center;">
				<input type="button" class="popupClose hand" id="btnSubmit" value="确认" />
				<input type="hidden" id="PIDs" name="PIDs" value="" />
			</div>
			<div style="clear:both;"></div>
		</div>
		
		<div id="ShowRelate" class="popupContact" style="z-index:2; padding:0px;">
            <div id="RelateHead" class="popupHead">
                <div class="popupTitle">选择商品</div>
                <div class="popupClose" id="RelateClose" title="关闭">关闭</div>
                <div style="clear:both;"></div>
            </div>
			<div style="position:relative; padding:0px 5px; text-align:center;">
                <div style="width:98%;">
                    <div id="search_controls">
                        <select id="sel_searchType" name="sel_searchType">
                            <option value="1">商品编号</option>
                            <option value="2">商品名称</option>
                            <option value="3">商品关键词</option>
                        </select>
                        <input type="text" id="txtSearchKeyword" name="txtKeyword" />
                        <input type="button" id="btnSearch" name="btnSearch" value="搜索" />
                        <a href="#" id="showadvsearch">高级搜索</a>
                    </div>
                    <div id="advsearch" style="display:none; position:absolute;">
                        <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" id="search_result_head" style="padding:0px;">
                        <table cellspacing="0" cellpadding="0" class="llist">
                            <tr id="listhead"><%--id="listhead"不能少--%>
                                <th style="width:5%"><input type="checkbox" id="chkAll" name="chkAll" /></th>
                                <th style="width:30%">商品名称</th>
                                <th style="width:25%">商品代码</th>
                                <th style="width:15%">商品类别</th>
                                <th style="width:15%">商品品牌</th>
                                <th style="width:10%">会员价格</th>         
                            </tr>
                        </table>
                    </div>
                    <div class="sub_container_content" id="search_result_content" 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 style="width:5%" id="checkbox" class="ccenter"></td>
			                    <td style="width:30%" id="Name"></td>
			                    <td style="width:25%" id="ProductNo"></td>
			                    <td style="width:15%" id="Category" class="ccenter"></td>
			                    <td style="width:15%" id="Brand" class="ccenter"></td>
			                    <td style="width:10%" id="MemberPrice" class="ccenter"></td>
		                    </tr>
	                    </table>
                    </div>
                    <div class="sub_container_page" id="pageDataList1_Pager" style="position:relative;">
                        <!-- 翻页-->
                        <!-- 翻页结束-->
                    </div>
                    <div id="search_save" style=" text-align:center;">
                        <input type="button" id="btnAddPdt"  class="popupClose hand" value="确认" />
                        <input type="hidden" id="RelatePdtIds" name="RelatePdtIds" value="" /><%--商品的ID--%>
                    </div>
                    <div style="clear:both;"></div>
	            </div>
                <div style="clear:both;"></div>
            </div>
        </div>
        
		<div id="backgroundPopup" class="backgroundPopup"></div>
	</body>
</HTML>