<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SuitAdd.aspx.cs" Inherits="XpShop.Manage.SuitAdd" %>
<!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>
	<!--#include file="inc/head.inc"-->
    <title>添加套装商品</title>
    <script type="text/javascript" src="inc/commond.js"></script>
    <script type="text/javascript" src="inc/jquery.livequery.js"></script>
    <script type="text/javascript" src="inc/SuitAdd.js"></script>
    <script src="inc/ui.datepicker.cn.js" type="text/javascript"></script>
	<link type="text/css" rel="stylesheet" href="inc/ui.datepicker.css" />
</head>
<body>
    <form id="form1" runat="server">
<%--    <input type="hidden" value="<%=suitID %>" id="suitid" name="suitid">
--%>    <input type="hidden" value="<%=selectedPids%>" id="check_product_ids" name="check_product_ids"/>
    <input type="hidden" value="<%=selectedGids%>" id="check_goods_ids" name="check_goods_ids"/>
    <input type="hidden" value="1" id="PageNo" name="PageNo"/>
    <div class="container">
	    <div class="sub_container">
            <div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img alt="" src="../images/admin_title.jpg" height="9px" width="8px" align="absmiddle" />添加套装</div>
            <div class="sub_container_content" id="sub_container">
                <div class="frame">
				    <div id="step1" class="frame_title pmt_rule_title hand">第一步：设置套装名称、时间等信息</div>
				    <div class="frame_content pmt_rule_content">
				        <table cellspacing="0" cellpadding="0" class="ptable">
							<tr>
								<th class="tl">套装名称：</th>
								<td class="tr">
									<asp:textbox id="txtSuitName" Width="500px" runat="server" Text=""></asp:textbox><em class="xp-need">*</em>
								</td>
							</tr>
	                        <tr>
	                            <th class="tl">库存：</th>
	                            <td class="tr">
	                                <asp:textbox id="txtStock" runat="server" Text=""></asp:textbox><em class="xp-need">*</em>
	                            </td>
	                        </tr>
							<tr>
	                            <th class="tl">活动开始时间：</th>
	                            <td class="tr">
	                                <asp:TextBox ID="txtTimeBegin" runat="server" Width="120px" Height="18px" style="line-height:18px;background-image:url(images/calendar.gif);background-repeat:no-repeat;padding-left:20px;" ReadOnly="true"></asp:TextBox>
	                                <select id="startHour" name="startHour" runat="server">
						                <option value="0" selected="">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option>
						            </select> 时
	                                <em class="xp-need">*</em>
	                            </td>
	                        </tr>
	                        <tr>
	                            <th class="tl">结束时间：</th>
	                            <td class="tr">
	                                <asp:TextBox ID="txtTimeEnd" runat="server" Width="120px" Height="18px" style="line-height:18px;background-image:url(images/calendar.gif);background-repeat:no-repeat;padding-left:20px;" ReadOnly="true"></asp:TextBox>
	                                <select id="endHour" name="endHour" runat="server">
						                <option value="0" selected="">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option>
						            </select> 时

	                                <em class="xp-need">*</em>
	                            </td>
	                        </tr>
	                        <tr>
	                            <th class="tl">描述：</th>
	                            <td class="tr">
	                                <asp:TextBox ID="txtRemark" Width="500px" Height="120px" TextMode="MultiLine" runat="server"></asp:TextBox>
	                            </td>
	                        </tr>
	                        <tr>
	                            <td colspan="2" class="center"><input type="button" value=" 确  定 " id="btnStep1" name="btnStep1"></td>
	                        </tr>
						</table>
				    </div>
				</div>
				<div class="frame">
				    <div id="step2" class="frame_title pmt_rule_title hand">第二步：选择套装商品</div>
				    <div id="step_2" class="frame_content pmt_rule_content hide">
				        <table>
	                        <tbody>
	                        <tr align="left">
		                        <td width="70px">商品名称：</td>
		                        <td width="180px"><input type="text" value="" id="search_name" name="search_name"></td>
		                        <td style="text-align:right">商品ID：</td>
		                        <td width="600px"><input type="text" value="" id="productids" name="productids" size="50"> 可输入多个商品id，用半角逗号隔开。</td>
	                            <td></td>
	                        </tr>
	                        <tr style="text-algin:left;height: 35px">
		                        <td width="70px">店内分类：</td>
		                        <td width="180px">
		                            <select name="subcat" id="subcat">
		                            <%=BindCategories() %>
                                    </select>
                              </td>
                              <td style="text-align:right">品    牌：</td>
		                      <td width="600px">
		                            <select id="brand" name="brand">
                                        <%=BindBrand("0")%>
                                    </select>
		                      </td>
                              <td style=text-align: right;">
		                            <input type="button" id="search_product" name="search_product" value=" 查询 ">
		                            <input type="hidden" value="0" id="is_search_product" name="is_search_product">
	                          </td>
                        </tr>
                        </tbody>
                       </table>
                       <div id="productlist"></div>
                        <div style="text-align: center"><input type="button" value=" 完成设置 " id="btnStep2" name="btnStep2"></div>
				    </div>
				</div>
				<div class="frame">
				    <div id="step3" class="frame_title pmt_rule_title hand">第三步：设置套装明细信息</div>
				    <div id="step_3" class="frame_content pmt_rule_content hide">
				        <table class="pptable">
	                        <tbody id="step3_body">
	                        <tr>
		                        <th width="14%">缩略图</th>
		                        <th width="16%">商品名称</th>
		                        <th width="10%">商品价格（元）</th>
		                        <th width="10%">套装价（元）</th>
		                        <th width="10%">积分</th>
		                        <th width="10%">数量</th>
		                        <th width="10%">排序</th>
		                        <th width="10%">是否主商品</th>
		                        <th width="10%">操作</th>
	                        </tr>
	                        <%if (dtSuitGoods != null && dtSuitGoods.Rows.Count > 0)
                           {%>
	                        <%for (int i = 0; i < dtSuitGoods.Rows.Count; i++)
                           {%>
	                        <tr id="newrow_<%=dtSuitGoods.Rows[i]["GoodsID"]%>">
		                        <td><img height="50px" width="50px" src="<%=webSite%>upload/productimg/<%=dtSuitGoods.Rows[i]["ImgFolder"]%><%=dtSuitGoods.Rows[i]["ProductImg"]%>"></td>
		                        <td><a href="<%=webSite %>products/product-<%=dtSuitGoods.Rows[i]["ProductID"]%>.<%=config.html %>" target="_blank"><%=dtSuitGoods.Rows[i]["goodsname"]%></a></td>
		                        <td><%=dtSuitGoods.Rows[i]["oldprice"]%></td>
		                        <td><input type="text" size="12" name="suitprice" value="<%=string.Format("{0:f2}",dtSuitGoods.Rows[i]["price"])%>"></td>
		                        <td><input type="text" size="12" name="scores" value="<%=dtSuitGoods.Rows[i]["Score"]%>"></td>
		                        <td><input type="text" size="12" name="suitnum" value="<%=dtSuitGoods.Rows[i]["quantity"]%>"></td>
		                        <td>
		                            <input type="text" size="5" name="sort" value="<%=dtSuitGoods.Rows[i]["Sort"]%>">
			                        <input type="hidden" value="<%=dtSuitGoods.Rows[i]["ProductID"]%>" name="pids">
			                        <input type="hidden" value="<%=dtSuitGoods.Rows[i]["GoodsID"]%>" name="gids">
		                        </td>
		                        <td>
		                            <% if (dtSuitGoods.Rows[i]["IsMaster"].ToString() == "True"){%>
		                            <input type="hidden" name="master" value="1" /><input type=radio name="ismaster" checked="checked"/>
    		                        
		                            <%}else{ %>
    		                        
		                            <input type="hidden" name="master" value="0" /><input type=radio name="ismaster"/>
		                            <%} %>
		                        </td>
		                        <td><span value="<%=dtSuitGoods.Rows[i]["GoodsID"]%>" class="step3_cancle_product hand">取消</span></td>
	                        </tr>
	                        <%}}%>
	                        <%--
		                    <tr id="newrow_1109624402" class="hide">
		                        <td><img height="50px" width="50px" src="http://img32.ddimg.cn/29/26/1109624402-1_x.jpg"></td>
		                        <td>TCL移动空调时尚风系列 KYD-32/DY 1.5P冷暧型</td>
		                        <td>3688</td>
		                        <td><input type="text" size="12" name="pmtprice" value=""></td>
		                        <td><input type="text" size="12" name="limitnum" value=""></td>
		                        <td>
		                            <input type="text" size="5" name="sort" value="">
			                        <input type="hidden" value="1109624402" name="pids">
		                        </td>
		                        <td><span value="1109624402" class="step3_Cancle_product hand">取消</span></td>
	                        </tr>
	                         --%>
	                        </tbody>
	                     </table>
	                     <div style="text-align: center;margin: 30px auto 30px auto">
	                        <asp:Button ID="btnSave" runat="server" Text=" 保存设置 " onclick="btnSave_Click" />
	                     </div>
				    </div>
				</div>
				<div class="frame">
				    <div class="frame_title">提示：</div>
				    <div class="frame_content">
	                1、一个套装最多只能选择4个商品。<br />
	                2、一个套装有且只有一个主商品，主商品的排序为1，非主商品的排序必须是大于1的整数。
	                </div>
                </div>
			</div>
		</div>
	</div>
    </form>
</body>
</html>
