<%@ Page language="c#" Codebehind="TGShow.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.TGShow" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNavTG0" Src="Modules/LeftNavTG0.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNavTG1" Src="Modules/LeftNavTG1.ascx" %>
<%@ Register TagPrefix="uc1" TagName="LeftNavTG2" Src="Modules/LeftNavTG2.ascx" %>
<!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/encoding.inc"-->
		<title><%=newProduct.ProductName%>,<%=config.SiteTitle%></title>
		<!--#include file="../../inc/head.inc"-->
        <script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/TGShow.js" type="text/javascript"></script>
        <script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/ProductReview.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/jquery.jqzoom.min.js" type="text/javascript"></script>
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/jqzoom.css" type="text/css" rel="stylesheet" />
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/pop.css" type="text/css" rel="stylesheet" />
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/show.css" type="text/css" rel="stylesheet" />
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/jquery.easydrag.handler.beta2.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/multi_popup.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/ReceiveAddr.js" type="text/javascript"></script>
        <script type="text/javascript">
            var memberGroup= '<%=newProduct.MemberGroup%>';
		    var extend = '<%=config.html %>';
			var baseUrl="<%=webSite %>";
			var shopFolder="<%=webSite %>";
			var returnUrl='<%=Request.Url.AbsoluteUri %>';
			var preProduct="<%=GetResourceString("PreProduct")%>";
			var nextProduct="<%=GetResourceString("NextProduct")%>";
			var productID = '<%=Request.QueryString["PID"] %>';
			var hadFav = '<%=GetResourceString("HadFavourite") %>';
			var favSucc = '<%=GetResourceString("FavouriteSucc") %>';
		    var PageSize = 10;
            var CurrentPage = 1;
            var showpage = false;
			var reviewType = 3;//--回复的类型，1为普通商品，2为拍卖商品，3为团购商品,4为礼品
            var votewords = '您对我们的回复：<span class="vote_y">满意</span>(<a class="yesnum">{0}</a>)  <span class="vote_n">不满意</span>(<a class="notnum">{1}</a>)';
            var reviewvotewords = '这条评论对您：<span class="vote_y">有用</span>(<a class="yesnum">{0}</a>)  <span class="vote_n">无用</span>(<a class="notnum">{1}</a>)';
            var NotExist = '<%=GetResourceString("ProductNotExist")%>';
		    var NotForSale = '<%=GetResourceString("ProductNotForSale")%>';
		    var NotStorage = '<%=GetResourceString("ProductNotStorage")%>';
        </script>
        <script type="text/javascript">
            $(document).ready(function(){
            $(".jqzoom").jqueryzoom({
				            xzoom: 300, //zooming div default width(default width value is 200)
				            yzoom: 300, //zooming div default width(default height value is 200)
				            offset: 10, //zooming div default offset(default offset value is 10)
				            position: "right", //zooming div position(default position value is "right")
 				            preload:1,
				            lens:1
			            });
            });
       </script>
	</HEAD>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		
		<div class="xp-w clear">
		    <!--位置导航开始-->
		    <div class="path"><h5><a href="<%=webSite %><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"><%=GetResourceString("Home")%></a>&nbsp;&gt;&nbsp;<%=GetResourceString("ProductDetails")%></h5></div>
		    <!--位置导航结束-->
			<div id="content_left">
<%--				<uc1:LeftNavTG0 id="LeftNavTG01" runat="server"></uc1:LeftNavTG0>
				<uc1:LeftNavTG1 id="LeftNavTG11" runat="server"></uc1:LeftNavTG1>
				<uc1:LeftNavTG2 id="LeftNavTG21" runat="server"></uc1:LeftNavTG2>--%>
                <div class="lframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm">
                        <div class="title">等待团购的商品</div>
                        <div class="more"><a href="<%=webSite %>tg/products-0-1-2-0-1.<%=config.html%>">更多>>></a></div>
                    </div>
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm">
                        <ul class="ul_style_8">
                            <asp:Repeater Runat="server" ID="rptPdts1">
                                <ItemTemplate>
                                    <li>
                                        <a href='<%=webSite %>tgproduct-<%#DataBinder.Eval(Container.DataItem,"ID")%>.<%=config.html%>' target="_blank"><%#DataBinder.Eval(Container.DataItem,"ProductName")%></a>
                                    </li>
		                        </ItemTemplate>
	                        </asp:Repeater>
                        </ul>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>
                <div class="lframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm">
                        <div class="title">正在团购的商品</div>
                        <div class="more"><a href="<%=webSite %>tg/products-0-1-2-0-2.<%=config.html%>">更多>>></a></div>
                    </div>
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm">
                        <ul class="ul_style_8">
                            <asp:Repeater Runat="server" ID="rptPdts2">
                                <ItemTemplate>
                                    <li>
                                        <a href='<%=webSite %>tgproduct-<%#DataBinder.Eval(Container.DataItem,"ID")%>.<%=config.html%>' target="_blank"><%#DataBinder.Eval(Container.DataItem,"ProductName")%></a>
                                    </li>
		                        </ItemTemplate>
	                        </asp:Repeater>
                        </ul>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>		
                <div class="lframe">
                    <div class="tl"></div>
                    <div class="tr"></div>
                    <div class="tm">
                        <div class="title">结束团购的商品</div>
                        <div class="more"><a href="<%=webSite %>tg/products-0-1-2-0-3.<%=config.html%>">更多>>></a></div>
                    </div>
                    <div class="ml"></div>
                    <div class="mr"></div>
                    <div class="mm">
                        <ul class="ul_style_8">
                            <asp:Repeater Runat="server" ID="rptPdts3">
                                <ItemTemplate>
                                    <li>
                                        <a href='<%=webSite %>tgproduct-<%#DataBinder.Eval(Container.DataItem,"ID")%>.<%=config.html%>' target="_blank"><%#DataBinder.Eval(Container.DataItem,"ProductName")%></a>
                                    </li>
		                        </ItemTemplate>
	                        </asp:Repeater>
                        </ul>
                    </div>
                    <div class="bl"></div>
                    <div class="br"></div>
                    <div class="bm"></div>
                </div>						
				<%=GetAD(33)%>
			</div>
			<div id="content_right">
				<div id="product">
				    <div class="pdtinfo-title" style="height:50px;">
			            <div class="pdtname"><%=dtTGPdt.Rows[0]["ProductName"]%></div>
			        </div>
					<div  class="picture">
					    <div class="clear">
					        <div id="thumbnail_bimg">
					            <div class="clear jqzoom" style=" margin:0px auto; text-align:center; overflow:hidden;">
					                <img id="thumbnail_img" src="<%=webSite %>upload/ProductImg/<%=dtTGPdt.Rows[0]["ImgFolder"]%><%=dtTGPdt.Rows[0]["Img2"]%>"  jqimg="<%=webSite %>upload/ProductImg/<%=dtTGPdt.Rows[0]["ImgFolder"]%><%=dtTGPdt.Rows[0]["Img2"]%>" onload="if(this.width > this.height && this.width>350)this.width=350;if(this.height > this.width && this.height>350)this.height=350;" />
					            </div>
					        </div>
							<div class="picture_div"><%=GetTagImg(7,0,0)%></div>
						</div>
						<%--<a id="product_img" href='<%=webSite %><%=config.Path%>upload/<%=newProduct.Picture%>' class="highslide" onclick="return hs.expand(this, {captionId: 'caption1'})"><div class="viewimg"></div></a>--%>
					</div>
					<!--商品信息开始-->
					<div class="info">
						<form id="Form1" name="pDetails" runat="server">
						    <input type="hidden" id="rid" value="<%=dtTGPdt.Rows[0]["ruleid"]%>"/>
						    <input type="hidden" id="pid" value="<%=dtTGPdt.Rows[0]["productid"]%>"/>
						    <input type="hidden" id="gid" value="<%=dtTGPdt.Rows[0]["goodsid"]%>"/>
						    <table align="left" cellpadding="5" cellspacing="0" border="0" class="tgsubinfo">
                                <tr class="hide">
								    <th><%=GetResourceString("ProductNo")%>:</th>
								    <td></td>
							    </tr>
							    <tr>
								    <th><%=GetResourceString("TogetherPurchasePrice")%>:</th>
								    <td style="color:#fd0002; font-weight:bold; font-size:16px;"><%=GetCurrencySign()%><%=string.Format("{0:f}",dtTGPdt.Rows[0]["PmtPrice"])%></td>
							    </tr>
							    <tr>
								    <th><%=GetResourceString("LeastNumber")%>:</th>
								    <td><%=dtTGPdt.Rows[0]["MinValue"]%><span style="color:#0201ff; margin-left:10px;">(<%=GetResourceString("TheQuantityPurchased")%>:<%=dtTGPdt.Rows[0]["AlreadyJoin"]%>)</span></td>
							    </tr>
                            <%--<div class="xp-qg-time" id='time<%=dtTGPdt.Rows[0]["ID"]%>>'</div>
			                <script type="text/javascript">
				                var t=new calculagraph();
				                t._id='time<%=dtTGPdt.Rows[0]["ID"]%>';
				                t._cT='<%=DateTime.Now%>';
				                t._sT='<%=dtTGPdt.Rows[0]["BeginTime"]%>';
				                t._eT='<%=dtTGPdt.Rows[0]["EndTime"]%>';
				                t._interval();
			                </script>--%>
			                <%if (dtTGPdt.Rows[0]["TagStatus"].ToString()== "0"){%>
					            <tr>
					                <th>开始时间：</th>
					                <td><%=dtTGPdt.Rows[0]["EndTime"]%></td>
					            </tr>
			                    <%} else if(dtTGPdt.Rows[0]["TagStatus"].ToString()=="1"){%>
					            <tr>
						            <th><%=GetResourceString("RemainingTime")%>:</th>
<%--						            <td><%=GetRemainingTime(dtTGPdt.Rows[0]["BeginTime"].ToString())%></td>--%>
					            </tr>
			                    <%}
                                 else if (dtTGPdt.Rows[0]["TagStatus"].ToString()=="2")
                                 {%>
					            <tr>
						            <th><%=GetResourceString("RemainingTime")%>:</th>
						            <td><span style="color:Red;"><%=GetResourceString("ThisProductHasExpired") %></span></td>
					            </tr>
					            <%} %>
							    <tr>
								    <th>会员级别:</th>
								    <td style="color:#0200fb"><%=BindMemberGroup(dtTGPdt.Rows[0]["GroupIDs"].ToString())%></td>
							    </tr>
			                    <%if (dtTGPdt.Rows[0]["TagStatus"].ToString()=="1"){%>
							    <tr>
								    <th>
									    <%=GetResourceString("ReceiverAddress")%>:
									</th>
									<td>
									    <asp:textbox id="txtRAddress" runat="server" Width="280px"></asp:textbox><font color="red">*</font><span id="ShowAddress" style="cursor:pointer; color:Blue; text-decoration:underline;">从地址簿选择</span>
								    </td>
							    </tr>
							    <tr>
								    <th>
									    <%=GetResourceString("ReceiverName")%>:
									</th>
									<td>
									    <asp:textbox id="txtRName" runat="server" Width="80px"></asp:textbox><font color="red">*</font>
								    </td>
							    </tr>
							    <tr>
							        <th>
									 <%=GetResourceString("ReceiverPostalcode")%>:
									</th>
									<td>
									    <asp:textbox id="txtRPostalcode" runat="server" Width="80px"></asp:textbox><font color="red">*</font>
								    </td>
							    </tr>
							    <tr>
								    <th>
									    收货人电话或手机:
									</th>
									<td>
									    <asp:textbox id="txtRPhone" runat="server" Width="80"></asp:textbox>或
									    <asp:textbox id="txtRMobile" runat="server" Width="80"></asp:textbox><font color="red">*</font>
								    </td>
							    </tr>
							    <tr>
								    <th>
									    <%=GetResourceString("Quantity")%>:
									</th>
									<td>
									    <asp:textbox id="txtQuantity" runat="server" Width="80"></asp:textbox><font color="red">*</font>
								    </td>
							    </tr>
							    <%} %>
                            </table>
                            <div class="clear" style="margin-left:100px; display:<%=dtTGPdt.Rows[0]["TagStatus"].ToString()=="1" ? "block": "none" %>"><input type="button" ID="btnSure" value="购买" class="tuangou"/></div>
                        </form>
				    </div>
				    <!--商品信息结束-->
			    </div>
			
			    <div class="show_mmframe">
                    <div class="tl1">
                        详细介绍
                    </div>
			        <div class="tm"></div>
                    <div class="mm">                                    
                        <%=dtTGPdt.Rows[0]["Description"]%>
                    </div>
	            </div>	
    		    
	            <div class="show_mmframe">
                    <div class="tl">
                        参与记录
                    </div>
			        <div class="tm"></div>
                    <div class="mm">
                	    <%=BindRecord()%>
                        <asp:datagrid id="dgList" runat="server" AutoGenerateColumns="False" Width="100%" HorizontalAlign="Center" BorderWidth="1">
                            <ItemStyle BackColor="White"></ItemStyle>
                            <HeaderStyle BackColor="#e4e3df" Height="20px"></HeaderStyle>
                            <Columns>
                                <asp:TemplateColumn HeaderText="序号">
                                    <HeaderStyle HorizontalAlign="Center" Height="20px"></HeaderStyle>
                                    <ItemStyle HorizontalAlign="Center" Width="60px"></ItemStyle>
                                    <ItemTemplate>
                                        <%# Container.ItemIndex + 1%>
                                    </ItemTemplate>
                                </asp:TemplateColumn>											    
                                <asp:TemplateColumn HeaderText="参与会员">
                                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                    <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "MemberName") %>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:TemplateColumn HeaderText="参与时间">
                                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                    <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "Times", "{0:yyyy-MM-dd HH:mm}") %>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:TemplateColumn HeaderText="购买数量">
                                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                    <ItemStyle HorizontalAlign="Center" Height="20px"></ItemStyle>
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "BuySum") %>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                            </Columns>
                        </asp:datagrid>
                    </div>
	            </div>
    		    
	            <div class="show_mmframe hide">
                    <div class="tl">
                        商品评论
                    </div>
			        <div class="tm"></div>
                    <div class="mm">                                    
                        <!--用户评论开始-->
                        <div id="ReviewContent" class="ReviewContent">
                            <div class="item" id="reviewtemplate">
                                <div class="rev">
                                    <div class="userinfo">
                                        <div class="icon" ><img src='#' alt=''/></div>
                                        <div class="username">admin</div>
                                        <div class="groupname">钻石会员</div>
                                        <div class="area">(广东)</div>
                                    </div>
                                    <div class="revinfo">
                                        <div class="revhead">
                                            <div class="revtitle">标题</div>
                                            <div class="revscore"></div>
                                            <div class="revtime">时间</div>
                                        </div>
                                        <div class="revbody">评论内容</div>
                                        <div class="btns">
                                            <div class="btnreply btnbg hand">我要回复</div>
                                            <div class="btnviewrep btnbg hand">查看回复</div>
                                            <div class="revvote"><div class="ques">这条评论对您有用吗?</div><div class="vote_y btnbg hand">有用(<span class="yesnum">1</span>)</div><div class="vote_n btnbg hand">没用(<span class="notnum">1</span>)</div></div>
                                        </div>
                                    </div>
                                </div>
                                <div class="reply" style="display:block;">
                                    <div id="reptemplate" class="reptemplate" style="display:none;">
                                        <div class="repname">wolanda：</div>
                                        <div class="repbody">回复内容</div>
                                        <div class="reptime">回复时间</div>
                                        <div class="separateline"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--回复框开始-->
                        <div id="ReplySumbit" style="display:none; width:100%;">
                            <form id="frmReply" action="">
                                <textarea id="txtReply" name="txtReply" cols="50" rows="5"></textarea>
                                <input type="hidden" id="hidden_reviewID" name="hidden_reviewID" value="0" />
                                <br />
                                <input type="button" id="btnReply" name="btnSubmit" value="提交回复" /><input type="button" id="btnCancel" value="取消" />
                            </form>
                        </div>
                        <!--回复框结束-->
                        <div class="clear" style="border-top:dotted 1px #666; padding-top:2px;">
                            <div style="border:solid 1px #999; width:70px; height:20px; float:left; text-align:center; line-height:20px;"><a href='<%=webSite %>PTReview-<%=newProduct.NewProductID%>-3-1.<%=config.html %>'>发表评论</a></div>
                            <div style="border:solid 1px #999; width:100px; height:20px; float:left; text-align:center; line-height:20px; margin-left:5px;"><a href='<%=webSite %>PTReview-<%=newProduct.NewProductID%>-3.<%=config.html %>'>查看所有评论</a></div>
                    	    <div class="clear"></div>
                        </div>
                        <!--用户评论结束-->
                    </div>
	            </div>
			</div>
		</div>
		<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
		<uc1:Footer id="Footer1" runat="server"></uc1:Footer>
		
		<div class="lframe popTip" id="PopAddress">
	        <div class="tl"></div>
	        <div class="tr"></div>
	        <div class="tm" id="popupHead">
	            <div class="poptitle">选择地址</div>
	            <div id="closepop" class="hand popclose">关闭</div>
	        </div>
	        <div class="ml"></div>
	        <div class="mr"></div>
	        <div class="mm tipcontent" style="text-align:center; overflow-y:auto; overflow-x:hidden; height:300px;">
	            <table id="AddressList" class="ptable">
	                <tr>
	                    <td>收货地点</td>
	                    <td>收货人姓名</td>
	                    <td>电话号码</td>
	                    <td>邮政编码</td>
	                    <td>选择</td>
	                </tr>
	                <tr id="al_template" style="display:none;">
	                    <td class="al_addr"></td>
	                    <td class="al_receiver"></td>
	                    <td class="al_phone"></td>
	                    <td class="al_zip"></td>
	                    <td class="al_select"><a href='#'>选择</a></td>
	                </tr>
	            </table>
	        </div>
	        <div class="bl"></div>
	        <div class="br"></div>
	        <div class="bm"></div>
        </div>
	</body>
</HTML>