<%@ Page CodeFileBaseClass="IlgharCMS.Lib.AdminPageBase" %>
<%@ Register TagPrefix="IlgharUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="IlgharUC" TagName="LanguageMenu" Src="../../language_menu.dwt.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ilghar:Get ID="Config" Object="InstanceConfig" Operation="GetBasicSettings()" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加商品</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ilghar:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ilghar:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<ilgharUC:Ime Ime="true" Eot="true" runat="server" />
<style type="text/css">
#PropertyTable,#ParameterTable,#MemberPriceTable,#CardTable,#RelatedGoodsTable,#SpecTable,#PartTable{background:#FFF}
#PropertyTable TH,#ParameterTable TH{width:100px}
#MemberPriceTable,#RelatedGoodsTable{width:400px}
#MemberPriceTable THEAD TH,#MemberPriceTable TD,#RelatedGoodsTable THEAD TH,#RelatedGoodsTable TD,#SpecTable THEAD TH,#SpecTable TD,#PartTable THEAD TH,#PartTable TD{text-align:center}
</style>
<script type="text/javascript">
var _page = "goods_add";
var _lang = "<%=ContentLang%>";
var _webPath = "<%=WebPath%>";
var _imagePath = "<%=ImagePath%>";
var _adminPath = "<%=AdminPath%>";
var _root = "<%=Manager.GetDataPath((Guid)Channel[IlgharCMS.SystemModule.Alias.Instance.ID], ContentLang) + "menu"%>";
var _thumbnailRoot = "<%=Config[GoodsThumbnailFolder]%>";
var _pictureRoot = "<%=Config[GoodsPictureFolder]%>";
var _fileRoot = "<%=Config[FileFolder]%>";
var _id;
var _guid;
var _createTime;
var _xmlProperty;
var _xmlDoc;
var _xmlParameterGroup;
var _html;
var _pageID;
var _index = 0;
var _goodsSpecs = new Array();
var _goodsSpecIndex = 0;
var _propertyHasOption = new Array();
var _specs = new Array();
var _memberPrices = new Array();
var _memberPriceIndex = 0;
var _morePictures = new Array();
var _morePictureIndex = 0;
var _properties = new Array();
var _propertyIndex = 0;
var _parameters = new Array();
var _parameterIndex = 0;
var _cards = new Array();
var _cardIndex = 0;
var _tags = new Array();
var _tagIndex = 0;
var _cards = new Array();
var _cardIndex = 0;
var _relateds = new Array();
var _relatedIndex = 0;
var _specMemberPriceIndex = 0;
var _parts = new Array();
var _partIndex = 0;
var _uploadPicture = false;
var _uploadThumbnail = false;
var _uploadFile = false;
var _goodsSpecID;
var _lang_working = "正在操作...";
var _lang_operation_fail = "操作失败！";
var _lang_operation_success = "操作成功！";
var _lang_name_empty = "名称不能空！";
var _lang_select = "选择";
var _lang_name = "名称";
var _lang_lower = "下限";
var _lang_upper = "上限";
var _lang_discount = "折扣/额度";
var _lang_amount = "折扣额";
var _lang_delete = "删除";
var _lang_browse = "浏览...";
var _lang_water_print = "水印";
var _lang_cross = "交叉相关";
var _lang_select_spec = "没有选择任何规格！";
var _lang_stock_incorrect = "库存格式不正确！";
var _lang_sale_price_incorrect = "销售价格是不正确！";
var _lang_promote_price_incorrect = "促销价格是不正确！";
var _lang_spec_name_empty = "请选择规格！";
var _lang_spec_exist = "该规格已经存在！";
var _lang_set = "设置";
var _lang_weight_incorrect = "重量格式不正确！";
var _lang_market_price_incorrect = "市场价格是不正确！";
var _lang_cost_price_incorrect = "成本价格是不正确！";
var _lang_picture_type_must_be = "大图类型应为：";
var _lang_thumbnail_type_must_be = "小图类型应为：";
var _lang_file_type_must_be = "文件类型应为：";
var _lang_type_must_be = "图片类型应为：";
var _lang_hitcount_incorrect = "人气不正确！";
var _lang_up_incorrect = "顶不正确！";
var _lang_down_incorrect = "踩不正确！";
var _lang_promote_start_incorrect = "促销开始日期格式不正确！";
var _lang_promote_end_incorrect = "促销结束日期格式不正确！";
var _lang_member_price_incorrect = "会员价格式不正确！";
var _lang_card_name_empty = "请输入虚拟卡名称！";
var _lang_card_content_empty = "请输入虚拟卡内容！";
var _lang_lower_incorrect = "下限不正确！";
var _lang_upper_incorrect = "上限格式不正确！";
var _lang_amount_incorrect = "折扣额格式不正确！";
var _lang_amount_exceed = "折扣额不能超过配件价格！";
var _lang_adding_member_price = "正在添加会员价...";
var _lang_adding_card = "正在添加虚拟卡...";
var _lang_adding_property = "正在添加属性...";
var _lang_adding_parameter = "正在添加参数...";
var _lang_adding_tag = "正在添加参数...";
var _lang_adding_related_goods = "正在添加相关商品...";
var _lang_adding_spec = "正在添加规格...";
var _lang_adding_part = "正在添加配件...";
var _lang_getting_innerid = "正在获取InnerID...";
var _lang_start_upload_picture = "开始上传大图...";
var _lang_uploading_picture = "正在上传大图...";
var _lang_start_upload_thumbnail = "开始上传小图...";
var _lang_uploading_thumbnail = "正在上传小图...";
var _lang_start_upload_file = "开始上传文件...";
var _lang_uploading_file = "正在上传文件...";
var _lang_adding_more_picture = "正在添加更多图片...";
var _lang_uploading_more_picture = "正在上传更多图片...";
var _lang_adding_tag = "正在添加标签...";
var _lang_setting_pageid = "正在设置页面ID...";
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" /></div>
	<div class="Title">添加商品</div>
	<div class="Right">
		<ilgharUC:LanguageMenu runat="server" />
		<img height="15" src="<%=ImagePath%>dropdown.gif" /> 语言：<%=CurrentLanguage%>
	</div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left"></li>
		<li class="Middle"><a href="list.aspx?Lang=<%=ContentLang%>">商品列表</a></li>
		<li class="Right"></li>
		<li class="Left Selected"></li>
		<li class="Middle Selected">添加商品</li>
		<li class="Right Selected"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../comment/list.aspx?Lang=<%=ContentLang%>">商品评论</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="replace.aspx?Lang=<%=ContentLang%>">批量替换</a></li>
		<li class="Right"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tfoot>
				<tr><td colspan="2"><input type="submit" value="添加" /></td></tr>
			</tfoot>
			<tbody>
				<tr>
					<th width="120">类别：</th>
					<td>
						<select name="CategoryID" class="<%=ContentLang%>Font">
							<option value="" Name="" PageGenerate="" PageTemplate="" PageID="" PageExtension="">未指定</option>
							<ilghar:Tree Object="GoodsCategory">
								<ilghar:Control>
									<ilghar:Space>&nbsp;&nbsp;</ilghar:Space>
									<ilghar:Line>│</ilghar:Line>
									<ilghar:TopOpen>┌</ilghar:TopOpen>
									<ilghar:Top>┌</ilghar:Top>
									<ilghar:MiddleOpen>├</ilghar:MiddleOpen>
									<ilghar:Middle>├</ilghar:Middle>
									<ilghar:BottomOpen>└</ilghar:BottomOpen>
									<ilghar:Bottom>└</ilghar:Bottom>
								</ilghar:Control>
								<ilghar:Record>
									<option value="<%=ID%>" Name="<%=Name%>" PageGenerate="<%=PageGenerate%>" PageTemplate="<%=PageTemplate%>" PageID="<%=PageID%>" PageExtension="<%=PageExtension%>"><%=Control%><%=Name%></option>
									<%=ChildRecords%>
								</ilghar:Record>
							</ilghar:Tree>
						</select>
					</td>
				</tr>
				<tr>
					<th>类型：</th>
					<td>
						<select name="TypeID" class="<%=ContentLang%>Font">
							<option value="" kind="Physical">未指定</option>
							<ilghar:List Object="Type">
								<ilghar:Record>
									<option value="<%=ID%>" kind="<%=Kind%>"><%=Name%></option>
								</ilghar:Record>
							</ilghar:List>
						</select>
					</td>
				</tr>
				<tr>
					<th>货号：</th>
					<td><input type="text" name="Number" size="30" maxlength="50" class="Text" />
						如果留空，则会自动生成
					</td>
				</tr>
				<tr>
					<th>名称：</th>
					<td><input type="text" name="Name" size="50" maxlength="50" class="Text <%=ContentLang%>Font" /></td>
				</tr>
				<tr id="StockTR">
					<th>库存：</th>
					<td><input type="text" name="Stock" value="0" size="10" maxlength="10" class="Text" /></td>
				</tr>
				<tr>
					<th>品牌：</th>
					<td>
						<select name="BrandID" class="<%=ContentLang%>Font">
							<option value="" innerID="" name="">未指定</option>
							<ilghar:List Object="Brand">
								<ilghar:Record>
									<option value="<%=ID%>" innerID="<%=InnerID%>" name="<%=Name%>"><%=Name%></option>
								</ilghar:Record>
							</ilghar:List>
						</select>
					</td>
				</tr>
				<tr>
					<th>计量单位：</th>
					<td>
						<select name="UnitID" class="<%=ContentLang%>Font">
							<option name="" value="">未指定</option>
							<ilghar:List Object="Unit">
								<ilghar:Record>
									<option name="<%=Name%>" value="<%=ID%>"><%=Name%></option>
								</ilghar:Record>
							</ilghar:List>
						</select>
					</td>
				</tr>
				<tr id="WeightTR">
					<th>重量：</th>
					<td><input type="text" name="Weight" value="0" size="10" maxlength="10" class="Text" />克（g）</td>
				</tr>
				<tr id="PropertyTR" style="display:none">
					<th>属性：</th>
					<td></td>
				</tr>
				<tr id="ParameterTR" style="display:none">
					<th>参数：</th>
					<td></td>
				</tr>
				<tr>
					<th>价格：</th>
					<td>
						市场价：<input type="text" name="MarketPrice" value="0.00" size="10" maxlength="10" class="Text" />
						<label id="SalePriceLabel">销售价：<input type="text" name="SalePrice" value="0.00" size="10" maxlength="10" class="Text" /></label>
						成本价：<input type="text" name="CostPrice" value="0.00" size="10" maxlength="10" class="Text" /><br />
						<input type="checkbox" id="Promote" /><label for="Promote">是否促销</label>
						<label id="PromotePriceLabel">促销价：<input type="text" name="PromotePrice" value="0.00" size="10" maxlength="10" class="Text" disabled="disabled" /></label>
						促销开始时间：<input type="text" name="PromoteStart" class="Text" disabled="disabled" />
						促销结束时间：<input type="text" name="PromoteEnd" class="Text" disabled="disabled" /><br />
						<%If MemberChannel == null%>
							<label for="MemberPrice" id="MemberPriceLabel" style="display:none"><input type="checkbox" name="MemberPrice" id="MemberPrice" disabled="disabled" />会员价</label>
						<%Else%>
							<label for="MemberPrice" id="MemberPriceLabel"><input type="checkbox" name="MemberPrice" id="MemberPrice" />会员价</label>
						<%EndIf%>
						<div id="MemberPriceDiv"></div>
					</td>
				</tr>
				<tr id="SpecTR">
					<th>规格：</th>
					<td>
						<input type="checkbox" id="HasSpec" /><label for="HasSpec">启用规格</label>
						<table id="SpecTable" border="0" cellpadding="4" cellspacing="1" style="display:none">
							<thead>
								<tr>
									<th width="60">货号</th>
									<th>规格</th>
									<th width="50">库存</th>
									<th width="50">销售价</th>
									<th width="50">促销价</th>
									<th width="50">会员价</th>
									<th width="40">删除</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td><input type="text" name="SpecNumber" size="8" /></td>
									<td id="SpecTD"><input type="button" value="选择" /></td>
									<td><input type="text" name="SpecStock" value="0" size="5" /></td>
									<td><input type="text" name="SpecPrice" value="0" size="5" /></td>
									<td><input type="text" name="SpecPromotePrice" value="0" size="5" /></td>
									<td>&nbsp;</td>
									<td><input type="button" id="AddSpec" value="添加" /></td>
								</tr>
							</tbody>
						</table>
					</td>
				</tr>
				<tr id="FileTR" style="display:none">
					<th>文件：</th>
					<td>
						<input id="FileTextbox" type="text" name="File" size="80" class="Text" />
						<input id="FileBrowse" type="button" value="浏览..." />
						<input id="FileSelect" type="button" value="选择..." />
						<input type="hidden" name="FileAllowedType" value="rar|zip" />
					</td>
				</tr>
				<tr id="CardTR" style="display:none">
					<th>虚拟卡：</th>
					<td>
						<input type="button" id="Card" value="增加..." class="Button" />
						<div id="CardDiv"></div>
					</td>
				</tr>
				<tr>
					<th>配件：</th>
					<td>
						<input type="button" id="PartSelect" value="选择" class="Button" />
						<div id="PartDiv"></div>
					</td>
				</tr>
				<tr>
					<th>相关商品：</th>
					<td>
						<input type="button" id="RelatedGoodsSelect" value="选择" class="Button" />
						<div id="RelatedGoodsDiv"></div>
					</td>
				</tr>
				<tr>
					<th>标签：</th>
					<td>
						<input type="button" id="TagSelect" value="选择" class="Button" />
						<div id="TagDiv"></div>
					</td>
				</tr>
				<tr>
					<th>大图：</th>
					<td>
						<input id="PictureTextbox" type="text" name="Picture" size="55" class="Text" />
						<input id="PictureBrowse" type="button" value="浏览..." />
						<input id="PictureSelect" type="button" value="选择..." />
						<input type="hidden" name="PictureAllowedType" value="gif|jpg|jpeg|png|bmp" />
						<img height="22" id="PictureView" alt="大图" style="vertical-align:bottom" />
						<input type="checkbox" id="MakeThumbnail" /><label for="MakeThumbnail">生成小图</label>
						<input type="checkbox" id="AddWaterMarkToPicture" /><label for="AddWaterMarkToPicture">水印</label>
					</td>
				</tr>
				<tr id="ThumbnailRow" style="display:none">
					<th>小图：</th>
					<td>
						<input id="ThumbnailTextbox" type="text" name="Thumbnail" size="55" class="Text" />
						<input id="ThumbnailBrowse" type="button" value="浏览..." />
						<input id="ThumbnailSelect" type="button" value="选择..." />
						<input type="hidden" name="ThumbnailAllowedType" value="gif|jpg|jpeg|png|bmp" />
						<img height="22" id="ThumbnailView" alt="小图" style="vertical-align:bottom" />
						<input type="checkbox" id="AddWaterMarkToThumbnail" /><label for="AddWaterMarkToThumbnail">水印</label>
					</td>
				</tr>
				<tr>
					<th>更多图片：</th>
					<td>
						<input type="button" id="MorePicture" value="增加..." class="Button" />
						<div id="MorePictureDiv"></div>
					</td>
				</tr>
				<tr>
					<th>选项：</th>
					<td>
						<input type="checkbox" name="IsReleased" id="IsReleased" checked="checked" /><label for="IsReleased">上架</label>
						<input type="checkbox" name="OnlyAsPart" id="OnlyAsPart" /><label for="OnlyAsPart">只做为配件</label>
						<input type="checkbox" name="IsRecommended" id="IsRecommended" /><label for="IsRecommended">推荐</label>
						<input type="checkbox" name="IsHeld" id="IsHeld" /><label for="IsHeld">置顶</label>
					</td>
				</tr>
				<tr>
					<th>简介：</th>
					<td>
						<textarea name="Introduction" cols="70" rows="6" wrap="off" class="Text <%=ContentLang%>Font"></textarea>
					</td>
				</tr>
				<tr>
					<th>详细介绍：</th>
					<td>
						<textarea id="HtmlEditor" EditorLang="<%=ContentLang%>" EditorInstanceID="<%=Channel[IlgharCMS.SystemModule.Alias.Instance.InnerID]%>" EditorUpload="<%=AdminPath%>" style="display:none;width:600px;height:400px"></textarea>
					</td>
				</tr>
				<tr>
					<th>模板：</th>
					<td>
						是否生成：
						<input type="radio" name="PageGenerate" id="PageGenerateAuto" value="" checked="checked" /><label for="PageGenerateAuto">自动</label>
						<input type="radio" name="PageGenerate" id="PageGenerateYes" value="1" /><label for="PageGenerateYes">是</label>
						<input type="radio" name="PageGenerate" id="PageGenerateNo" value="0" /><label for="PageGenerateNo">否</label>
						<br />
						
						自定模板：<input type="text" name="PageTemplate" class="Text" />可以空<br />
						页面标识：<input type="text" name="PageID" class="Text" />
						<select id="PageIDCandidate">
							<option value="">预定义</option>
							<option value="{ID}">ID</option>
							<option value="{Guid}">Guid</option>
							<option value="{YYYYMMDDhhmmss}">YYYYMMDDhhmmss</option>
							<option value="{YYYY-MM-DD/hhmmss}">YYYY-MM-DD/hhmmss</option>
							<option value="{YYYY/MM/DD/hhmmss}">YYYY/MM/DD/hhmmss</option>
							<option value="{YYYY/MM-DD/hhmmss}">YYYY/MM-DD/hhmmss</option>
						</select>可以空<br />
						扩展名称：<input type="text" name="PageExtension" class="Text" />可以空
					</td>
				</tr>
				<tr>
					<th>指标：</th>
					<td>
						人气：<input type="text" name="HitCount" value="0" size="10" maxlength="255" class="Text" />
						顶：<input type="text" name="Up" value="0" size="10" maxlength="255" class="Text" />
						踩：<input type="text" name="Down" value="0" size="10" maxlength="255" class="Text" />
					</td>
				</tr>
				<tr>
					<th>Meta：</th>
					<td>
						Keywords：<input type="text" name="MetaKeywords" size="20" maxlength="255" class="Text <%=ContentLang%>Font" />
						Description：<input type="text" name="MetaDescription" size="20" maxlength="255" class="Text <%=ContentLang%>Font" />
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script type="text/javascript" src="<%=Manager.GetModulePath(null)%><%=Instance[IlgharCMS.SystemModule.Alias.Module.Namespace]%>/alias.js"></script>
<script type="text/javascript" src="<%=CommonPath%>uploader.js"></script>
<script type="text/javascript" src="<%=CommonPath%>xmldom.js"></script>
<script type="text/javascript" src="<%=CommonPath%>IlgharHtmlEditor.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=JsPath%>shop.js"></script>
</body>
</html>