<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pmtrule_tg.aspx.cs" Inherits="XpShop.Manage.pmtrule_tg" %>
<!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/head2.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/pmtrule_tg.js"></script>
    <script type="text/javascript" src="inc/pmt_limit_time.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="<%=pmtID %>" id="pmtid" name="pmtid">
    <input type="hidden" value="0" id="promotion_id" name="promotion_id">
    <input type="hidden" value="102" id="promotion_type" name="promotion_type">
    <input type="hidden" value="60" id="promo_product_max_num" name="promo_product_max_num">
    <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" /><a href='pmtrule_list.aspx'>促销活动管理</a><img alt="" src="../images/admin_title.jpg" height="9px" width="8px" align="absmiddle" /><label id="">商城团购</label></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="txtRuleName" 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="txtRuleNo" Width="50px" runat="server" Text=""></asp:textbox><em class="xp-need">*</em>
								</td>
							</tr>
							<tr>
								<th class="tl">最低团购数：</th>
								<td class="tr">
									<asp:textbox id="txtMinValue" Width="50px" runat="server" Text=""></asp:textbox><em class="xp-need">*</em>
								</td>
							</tr>
							<tr>
								<th class="tl">最高团购数：</th>
								<td class="tr">
									<asp:textbox id="txtMaxValue" Width="50px" runat="server" Text=""></asp:textbox><em class="xp-need">*</em>
								</td>
							</tr>
							<tr>
	                            <th class="tl">允许参加会员等级：</th>
	                            <td class="tr"><asp:CheckBoxList ID="chkListMemberGroup" runat="server" RepeatDirection="Horizontal" nane="chkListMemberGroup"></asp:CheckBoxList> </td>
	                        </tr>
	                        <tr>
	                            <th class="tl">是否允许使用优惠券：</th>
	                            <td class="tr">
	                                <asp:RadioButton ID="rbtnCanUseCouponOn" runat="server" Text="是" Checked="true" GroupName="UseCoupon" />
                                    <asp:RadioButton ID="rbtnCanUseCouponOff" runat="server" Text="否" GroupName="UseCoupon" />
	                            </td>
	                        </tr>
	                        <tr>
	                            <th class="tl">商品是否首页显示：</th>
	                            <td class="tr">
	                                <asp:RadioButton ID="rbtHomeShowOn" runat="server" Text="是" Checked="true" GroupName="HomeShow" />
                                    <asp:RadioButton ID="rbtHomeShowOff" runat="server" Text="否" GroupName="HomeShow" />
	                            </td>
	                        </tr>
	                        <tr>
	                            <th class="tl">所属银行：</th>
	                            <td class="tr">
                                    <asp:DropDownList ID="ddlBank" runat="server">   
                                        <asp:ListItem Value="-1">选择银行</asp:ListItem>                                     
                                        <asp:ListItem Value="2">工商银行</asp:ListItem>
                                        <asp:ListItem Value="5">招商银行</asp:ListItem>
                                        <asp:ListItem Value="1">中国银行</asp:ListItem>
                                        <asp:ListItem Value="3">建设银行</asp:ListItem>
                                        <asp:ListItem Value="4">农业银行</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">
	                                <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> 时

						            <select id="startMinute" name="startMinute" 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><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option>
						                <option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="34">34</option><option value="35">35</option><option value="36">36</option><option value="37">37</option><option value="38">38</option><option value="39">39</option><option value="40">40</option><option value="41">41</option><option value="42">42</option><option value="43">43</option><option value="44">44</option><option value="45">45</option><option value="46">46</option><option value="47">47</option><option value="48">48</option><option value="49">49</option><option value="50">50</option><option value="51">51</option><option value="52">52</option><option value="53">53</option><option value="54">54</option><option value="55">55</option><option value="56">56</option><option value="57">57</option><option value="58">58</option><option value="59">59</option>
						            </select>分

						            <select id="startSecond" name="startSecond" 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><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option>
						                <option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="34">34</option><option value="35">35</option><option value="36">36</option><option value="37">37</option><option value="38">38</option><option value="39">39</option><option value="40">40</option><option value="41">41</option><option value="42">42</option><option value="43">43</option><option value="44">44</option><option value="45">45</option><option value="46">46</option><option value="47">47</option><option value="48">48</option><option value="49">49</option><option value="50">50</option><option value="51">51</option><option value="52">52</option><option value="53">53</option><option value="54">54</option><option value="55">55</option><option value="56">56</option><option value="57">57</option><option value="58">58</option><option value="59">59</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> 时

						            <select id="endMinute" name="endMinute" 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><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option>
						                <option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="34">34</option><option value="35">35</option><option value="36">36</option><option value="37">37</option><option value="38">38</option><option value="39">39</option><option value="40">40</option><option value="41">41</option><option value="42">42</option><option value="43">43</option><option value="44">44</option><option value="45">45</option><option value="46">46</option><option value="47">47</option><option value="48">48</option><option value="49">49</option><option value="50">50</option><option value="51">51</option><option value="52">52</option><option value="53">53</option><option value="54">54</option><option value="55">55</option><option value="56">56</option><option value="57">57</option><option value="58">58</option><option value="59">59</option><option value="60">60</option>
						            </select>分

						            <select id="endSecond" name="endSecond" 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><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option>
						                <option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="34">34</option><option value="35">35</option><option value="36">36</option><option value="37">37</option><option value="38">38</option><option value="39">39</option><option value="40">40</option><option value="41">41</option><option value="42">42</option><option value="43">43</option><option value="44">44</option><option value="45">45</option><option value="46">46</option><option value="47">47</option><option value="48">48</option><option value="49">49</option><option value="50">50</option><option value="51">51</option><option value="52">52</option><option value="53">53</option><option value="54">54</option><option value="55">55</option><option value="56">56</option><option value="57">57</option><option value="58">58</option><option value="59">59</option><option value="60">60</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="6%">缩略图</th>
		                        <th width="16%">商品名称</th>
		                        <th width="10%">商品价格（元）</th>
		                        <th width="12%">团购价格（元）</th>
		                        <%--<th width="12%">团购数量</th>--%>
		                        <th width="12%">每账户限制数量</th>
		                        <th width="8%">排序</th>
		                        <th width="6%">操作</th>
	                        </tr>
	                        <%if (dtPmtGoods != null && dtPmtGoods.Rows.Count > 0)
                           {%>
                            <%for(int i=0;i<dtPmtGoods.Rows.Count;i++){%>
	                        <tr id="newrow_<%=dtPmtGoods.Rows[i]["ProductID"]%>">
		                        <td><img height="50px" width="50px" src="<%=webSite%>upload/productimg/<%=dtPmtGoods.Rows[i]["ImgFolder"]%><%=dtPmtGoods.Rows[i]["ProductImg"]%>"></td>
		                        <td><a href="<%=webSite %>tgproduct-<%=dtPmtGoods.Rows[i]["ID"]%>.<%=config.html %>" target="_blank"><%=dtPmtGoods.Rows[i]["ProductName"]%></a></td>
		                        <td><%=dtPmtGoods.Rows[i]["MemberPrice"]%></td>
		                        <td><input type="text" size="12" name="pmtprice" value="<%=string.Format("{0:f2}",dtPmtGoods.Rows[i]["PmtPrice"])%>"/></td>
		                        <td class="hide"><input type="hidden" size="12" name="pmtnum" value="<%=dtPmtGoods.Rows[i]["PmtNumber"]%>"/></td>
		                        <td><input type="text" size="12" name="limitnum" value="<%=dtPmtGoods.Rows[i]["LimitedNumber"]%>"/></td>
		                        <td>
		                            <input type="text" size="5" name="sort" value="<%=dtPmtGoods.Rows[i]["Sort"]%>"/>
		                            <input type="hidden" value="<%=dtPmtGoods.Rows[i]["ID"]%>" name="ids"/>
			                        <input type="hidden" value="<%=dtPmtGoods.Rows[i]["ProductID"]%>" name="pids"/>
			                        <input type="hidden" value="<%=dtPmtGoods.Rows[i]["GoodsID"]%>" name="gids"/>
		                        </td>
		                        <td><span value="<%=dtPmtGoods.Rows[i]["GoodsID"]%>" 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、支持VIP价格的商品，参加单品促销后，不再享受VIP价格且不再赠送积分。<br>
	                2、每个商品同一时间只能参加一种单品促销。
	                </div>
                </div>
			</div>
		</div>
	</div>
    </form>
</body>
</html>