<%@ Page language="c#" Codebehind="ProductReview.aspx.cs" AutoEventWireup="true" Inherits="XpShop.WebUI.ProductReview" %>
<%@ 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="LeftNavTop2Level" Src="Modules/LeftNavTop2Level.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>
		<!--#include file="../../inc/encoding.inc"-->
		<!--#include file="../../inc/show_head.inc"-->
		<link rel="stylesheet" href="<%=webSite %>store/style/skin.css" type="text/css"/>
		<link href="<%=webSite %>Template/<%=config.TemplateFolder%>/style/PageBar.css" rel="stylesheet" type="text/css"/>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/PageBar.js" type="text/javascript"></script>
		<script src="<%=webSite %>Template/<%=config.TemplateFolder%>/inc/ProductReview.js" type="text/javascript"></script>
		<script type="text/javascript">
		    var baseUrl="<%=webSite %>";
			var shopFolder="<%=webSite %>";
		    var returnUrl='<%=Request.Url.AbsoluteUri %>';
		    var productID = '<%=Request.QueryString["PID"] %>';
		    var PageSize = 10;
            var CurrentPage = 1;
            var showpage = true;
			var reviewType = '<%=Request.QueryString["ReviewType"]%>';
            var reviewvotewords = '这条评论对您：<span class="vote_y">有用</span>(<a class="yesnum">{0}</a>)  <span class="vote_n">无用</span>(<a class="notnum">{1}</a>)';
		</script>
	</head>
	<body>
		<uc1:Header id="Header1" runat="server"></uc1:Header>
		<div class="xp-w clear">
		    <!--位置导航开始-->
		    <div class="path"><a href="<%=webSite %><%if(config.html==""){%>default.aspx<%}else{%>Index.<%=config.html%><%}%>"><%=GetResourceString("Home")%></a>&nbsp;&gt;&nbsp;商品评论</div>
		    <!--位置导航结束-->
			<div id="content_left">
		        <!--商品信息开始-->
		        <div class="lframe">
			        <div class="tl"></div>
			        <div class="tr"></div>
			        <div class="tm">
				        商品信息
			        </div>
			        <div class="ml"></div>
			        <div class="mr"></div>
			        <div class="mm clearfix">
				        <ul style="width: 190px;">
					        <li style="line-height: 20px; overflow: hidden; text-align: center;"><img id="thumbnail_img" src="<%=webSite %>upload/ProductImg/<%=product.ImgFolder%><%=product.ThumbnailImg%>"/></li>
					        <li style="line-height: 20px; overflow: hidden;"><b><%=product.ProductName %></b></li>
					        <li style="line-height: 20px; overflow: hidden;">市场价：<%=product.MarketPrice %></li>
					        <li style="line-height: 20px; overflow: hidden;">会员价：<%=product.MemberPrice %></li>
					        <li style="line-height: 20px; overflow: hidden;">
						        <table>
							        <tbody><tr>
								        <td>商品评分：</td>
										<td><div class="pingfen<%=Convert.ToInt32(product.PingFen)==0 ? 5 : Convert.ToInt32(product.PingFen)%>"></div></td>
							        </tr>
						        </tbody></table>
					        </li>
					        <li style="line-height: 20px; overflow: hidden;">评论数：<%=product.Reviews %></li>
					        <li>
						        <form target="_blank" method="post" action="/cart.html?pid=<%=product.ProductID %>" name="pDetails">
						        <div id="product" style="margin-top: 5px; text-align: center;">
							        <input type="hidden" value=<%=product.ProductID %> name="GID" id="GID">
							        <input type="hidden" value="" name="spectext" id="spectext">
							        <input type="hidden" value="" name="spectdesc" id="specdesc">
							        <input type="submit" value="" id="btnBuy" class="buy">
						        </div>
						        </form>
					        </li><li>
				        </li>
				        </ul>
			        </div>
			        <div class="bl"></div>
			        <div class="br"></div>
			        <div class="bm"></div>
		        </div>
		        <!--商品信息结束-->
			</div>
			<div id="content_right">
			    
				<div class="mframe">
					<div class="tl"></div>
					<div class="tr"></div>
					<div class="tm">
					    所有评论内容
					</div>
					<div class="ml"></div>
					<div class="mr"></div>
					<div class="mm">
				        <div id="ReviewContent" class="ReviewContent" style="width:100%;">
	                        <div class="item" id="reviewtemplate" style="display:none;">
	                            <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">
	                                <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="sub_container_page clear" id="pageDataList1_Pager"><!-- 翻页--><!-- 翻页结束--></div>
				        
				    </div>
				<div class="bl"></div>
				<div class="br"></div>
				<div class="bm"></div>
			</div>
			
			<div class="mframe">
					<div class="tl"></div>
					<div class="tr"></div>
					<div class="tm">
					    发表评论
					</div>
					<div class="ml"></div>
					<div class="mr"></div>
					<div class="mm">
				        <%if(CurrentUser != null && CurrentUser.Name != "anonymous") {%>
				            <% if(canReview){%>
				            <form id="Form1" method="post" runat="server">
		                        <table>
		                            <tr>
		                                <td>评论标题</td>
		                                <td><asp:TextBox runat="server" ID="txtTitle" Columns="80"></asp:TextBox></td>
		                            </tr>
		                            <tr>
		                                <td valign="top">评论内容</td>
		                                <td><asp:TextBox id="txtContent" runat="server" TextMode="MultiLine" Columns="80" Rows="5"></asp:TextBox></td>
		                            </tr>
		                            <tr>
		                                <td>评分</td>
		                                <td>
		                                    <asp:RadioButtonList id="rblScore" runat="server" RepeatDirection="Horizontal">
			                                    <asp:ListItem Value="5" Selected="true">5分 </asp:ListItem>
			                                    <asp:ListItem Value="4">4分 </asp:ListItem>
			                                    <asp:ListItem Value="3">3分 </asp:ListItem>
			                                    <asp:ListItem Value="2">2分 </asp:ListItem>
			                                    <asp:ListItem Value="1">1分 </asp:ListItem>
		                                    </asp:RadioButtonList>
		                                </td>
		                            </tr>
		                            <tr>
		                                <td></td>
		                                <td>
		                                    <asp:Button id="btnSubmit" onclick="btnSubmit_Click" runat="server" Text="提交"></asp:Button>
		                                </td>
		                            </tr>
		                        </table>
	                        </form>
	                        <%}  %>
	                        <%else
                            {%>
                            <h2>您暂不能对该商品进行评价，可能有以下原因：</h2>
                            1.您可能没有购买过该商品；<br />
                            2.购买时间已经超过半年；<br />
                            3.您已经评价过该商品。 <br />
                            <%
                            }%>
	                    <%} else {%>
	                        <div class="clear">只有购买过此商品的用户才可以评论 <a href='../Login.aspx?ReturnUrl=<%=webSite %>store/ProductReview.aspx?pid=<%=Request.QueryString["PID"] %>&reviewtype=<%=Request.QueryString["ReviewType"] %>'>请先登录</a></div>
	                    <%} %>
				    </div>
				<div class="bl"></div>
				<div class="br"></div>
				<div class="bm"></div>
			</div>
			    
			</div>
			<div style="clear:both;"></div>
		</div>
		<uc1:Helper id="Helper1" runat="server"></uc1:Helper>
		<uc1:Footer id="Footer1" runat="server"></uc1:Footer>			
	</body>
</html>