<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShopEvalList.aspx.cs" Inherits="XpShop.Supplier.ShopEvalList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagPrefix="uc1" TagName="Header" Src="Modules/Header.ascx" %>
<%@ Register TagPrefix="uc1" TagName="SupplierMenu" Src="Modules/SupplierMenu.ascx" %>
<%@	Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox"	%>
<%@ Register TagPrefix="uc1" TagName="Helper" Src="Modules/Helper.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Footer" Src="Modules/Footer.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/head.inc"-->
		<title>商家中心 <%=config.SiteTitle%></title>
        <script type="text/javascript" src="inc/PdtReviewList.js"></script>
        <script type="text/javascript" src="inc/commond.js"></script>
		<script src="inc/ui.datepicker.cn.js" type="text/javascript"></script>
		<link type="text/css" rel="stylesheet" href="style/ui.datepicker.css" />
		<script type="text/javascript">
            $(document).ready(function() {
                $("#txtStartTime").datepicker().click(function(){$(this).blur()});
                $("#txtEndTime").datepicker().click(function(){$(this).blur()});
                
                
                $("#btnReset").click(function(){
                    var len = document.Form1.elements.length;
                    for(i = 0 ; i < len ; i++){
                      if(document.Form1.elements[i].type == 'text'){
                        document.Form1.elements[i].value = '';
                      }else if(document.Form1.elements[i].type == 'select-one'){
                        document.Form1.elements[i].options[0].selected=true;
                      }
                    }
                    return false;
                  })
               
                  //查询时，判断查询条件格式是否正确
                  $("#btnSearch").click(function(){
                    var st_time =$("#txtStartTime").val();
                    var et_time =$("#txtEndTime").val();
                    if(et_time!='' && st_time>et_time){
                      alert("时间区间的开始时间大于结束时间");
                      return false;
                    }
                  });
                
   	            //给跳转按钮绑定onclick事件
	            $("#go").bind("click",function(){
		            var pageNum = $("#gopage").val();
		            var totalpage =  parseInt($("#totalpage").text());
		            if(pageNum.replace(new RegExp("(^[\\s]*)|([\\s]*$)", "g"), "") != "" ){
                        if(pageNum != "0"& !isNaN(parseInt(pageNum,10))){
                            if(pageNum > totalpage){
                                alert("输入的数字大于总页数");
                                $("#gopage").attr("value","");
                                return false;
                            }
                        }
                        else{  
                            alert("输入错误！");
                            $("#gopage").attr("value","");
                            return false;
                        }
                    }
                    else{
                        alert("请输入要跳转到的页面");
                        $("#gopage").attr("value","");
                        return false;
                    }
	            });
            });        
        </script>

	</head>
	<body>
			<uc1:Header id="Header1" runat="server"></uc1:Header>
			 <!--位置导航开始-->
			 <div class="path"><a href="<%=webSite %>supplier/default.<%=config.html%>">商家桌面</a> > 商品管理 > 商家评价管理</div>
			<!--位置导航结束-->
			<div class="xp-w clear">
				<div class="content-left">
					<!--会员中心导航开始-->
					<uc1:SupplierMenu id="SupplierMenu1" runat="server"></uc1:SupplierMenu>
					<!--会员中心导航结束-->
				</div>
				<div class="content-middle">	
                    <%--<h3>欢迎您,<%=CurrentSupplier.RealName%></h3>--%>
                    <div class="rframe">
                        <div class="tm">商家评价管理</div>
                        <div class="mm clear">
                            您可在顾客评价或回复后的一个月内作出回复，超过一个月后将不能再回复。<br>
				            显示状态为“不公开”的评价，在前台店铺页面将不会显示。

				            <hr class="itemhr" />
					        <form id="Form1" runat="server">
                                <table width=100%>
                                    <tr>
                                        <td class="right" width="10%" style="text-align:right">订单号：</td>
                                        <td width="20%">
                                        <asp:TextBox ID="txtOrderNo" runat="server" ></asp:TextBox>
                                        </td>
                                        <td class="right" width="10%" style="text-align:right">评价时间：</td>
                                        <td>
                                        <asp:TextBox id="txtStartTime" runat="server"  ></asp:TextBox>-<asp:TextBox id="txtEndTime" runat="server" ></asp:TextBox>&nbsp;</td>
                                        <td class="right" width="10%" style="text-align:right">状态：</td>
                                        <td>
                                            <asp:DropDownList ID="ddlReply" runat=server>
                                	            <asp:ListItem Value="9999">全部</asp:ListItem>	
                                	            <asp:ListItem Value="0">未回复</asp:ListItem>
                                                <asp:ListItem Value="1">已回复</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                            </table>
                            <hr class="itemhr" />
                            <div style="float:right ;padding:5px 0px">
                            <input type=hidden  id=hidePage value=""/>
                            <asp:Button  id="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click" ></asp:Button>&nbsp;&nbsp;
                            <asp:Button  id="btnReset" runat="server" Text="重置" ></asp:Button>&nbsp;&nbsp;
                            </div>
                            <div style="clear:right"></div>
                            
					        <div class="pro_hlist">
						        <asp:DataList id="dlShopEval" CellPadding="4" RepeatColumns="1" 
                                    RepeatDirection="Horizontal" Width="100%" runat="server" 
                                    ForeColor="#333333" GridLines="Both" BorderColor="#c8dcf4">
							        <AlternatingItemStyle BackColor="White" ForeColor="#284775" />
                                    <ItemStyle BackColor="#F7F6F3" ForeColor="#333333" Font-Bold="False" 
                                        Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                                        Font-Underline="False" HorizontalAlign="Center" BorderColor="#c8dcf4" />
                                    <SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle BorderColor="#c8dcf4" HorizontalAlign="center" Height="30" />
							        <HeaderTemplate>								
                                        <ItemTemplate>													
								            <table cellpadding="3" cellspacing="0" width="100%">
									            <tr>
                                                    <td width="15%" align="center">
                                                        订单号 
                          				            </td>
                                                    <td width="8%" align="center">
                                                        评价分数
										            </td>
                                                    <td width="30%" align="center">
                                                        顾客评价
										            </td>
                                                    <td width="8%" align="center">
                                                        顾客昵称
										            </td>										
                                                    <td width="16%" align="center">
                                                        评价时间
										            </td>
										            <td width="8%" align="center">
                                                        显示状态
										            </td>
                                                    <td width="8%" align="center">
                                                        回复状态
										            </td>
                                                    <td width="7%" align="center">
                                                        操作
										            </td>
									            </tr>
								            </table>
							            </ItemTemplate>								
							        </HeaderTemplate>
							        <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                        Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" />
							        <ItemTemplate>													
								        <table cellpadding="3" cellspacing="0" width="100%">
									        <tr>
                                                <td width="15%" align="center">
                                                    <a href='OrderDetailView.aspx?OrderID= <%#DataBinder.Eval(Container.DataItem, "OrderID")%> '><%#DataBinder.Eval(Container.DataItem, "OrderNo")%>
                      				            </td></a>
                                                <td width="8%" align="left">
                                                    <%# GetRating(Convert.ToInt32( DataBinder.Eval(Container.DataItem, "PingFen")))%>
									            </td>
                                                <td width="30%" align="center">
                                                    <%#DataBinder.Eval(Container.DataItem, "Title")%>
									            </td>
                                                <td width="8%" align="center">
                                                    <%#DataBinder.Eval(Container.DataItem, "MemberName")%>
									            </td>										
                                                <td width="16%" align="center">
                                                    <%#DataBinder.Eval(Container.DataItem, "AddTime")%>
									            </td>
                                                <td width="8%" align="center">
                                                    <%#Convert.ToInt32(DataBinder.Eval(Container.DataItem, "Status"))==2 ? "公开" : "不公开"%>
									            </td>
									            <td width="8%" align="center">
                                                    <%#Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsReply")) ? "已回复" : "未回复"%>
									            </td>
                                                <td width="7%" align="center">
                                                <a href='ShopEvalDetailView.aspx?seid=<%#DataBinder.Eval(Container.DataItem, "shopEvalID")%>'>[查看]</a>
									            </td>
									        </tr>
								        </table>
							        </ItemTemplate>
						        </asp:DataList>
			                    <asp:panel id="plPage" visible="true" runat="server">
			                    <!-- 翻页开始-->
			                    <div class="page clear">
				                    <div class="fpage1">
                                        <asp:Label ID="lblPagerInfo" runat="server"></asp:Label>

                                <asp:textbox id="gopage"  runat="server" class="gopage" />
                                <asp:button id="go" runat="server" text="Go" class="go" onclick="go_Click" />
                                    </div>
                                    <div class="fpage2">
                                        <span class="prepage"></span>
                                        <asp:Label ID="lbPage" runat="server"></asp:Label>
                                        <span class="nextpage"></span>
                                    </div>                                
			                    </div>
			                    <!-- 翻页结束-->
			                    </asp:panel>
			                    <asp:panel id="plNoProduct" visible="false" runat="server">
				                    <div style="margin:20px;">
					                    <h3>没有找到相应记录，请重新查询！</h3>
				                    </div>
			                    </asp:panel>
					        </div>
			                </form>
                        </div>
                    </div>
			    </div>
			</div>

		<uc1:Helper id="Helper" runat="server"></uc1:Helper>
		<uc1:Footer id="Footer" runat="server"></uc1:Footer>
	</body>
</html>