<%@ page language="C#" masterpagefile="AdminIndexMaster.master" autoeventwireup="true" inherits="HL_Admin_Admin_ShopReviewManage, WebApp_deploy" title="商城评价管理" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script src="Js/Function.js" type="text/javascript"></script> 
<script type="text/javascript" src="Js/getdate.js"></script>
<script type="text/javascript">
function showsearchdate()
{
  var SelectDate = document.getElementById('ctl00_ContentPlaceHolder1_SelectDate');
  var objdate=document.getElementById('showdate');
  if(SelectDate.checked){
        objdate.style.display="";
  }
  else{
        objdate.style.display="none";
  }
  
}

</script>
<table class="adminheading" width="100%">
    <tr>
        <th class="user" align="left">评价管理</th>
        <td align="right"></td>
    </tr>
</table>
    
    <table class="nick">
    <tr><td class="ltd">高级查找：</td><td class="rtd" style="width:35%">
        <asp:DropDownList ID="QuickSearch" runat="server" OnSelectedIndexChanged="QuickSearch_SelectedIndexChanged" AutoPostBack="true">
          <asp:ListItem Text="所有评价" Value="all" />
          <asp:ListItem Text="今天的所有评价" Value="today" />
          <asp:ListItem Text="近一周的所有评价" Value="week" />
          <asp:ListItem Text="所有有效的评价" Value="legal" />
          <asp:ListItem Text="所有无效的评价" Value="illegal" />
          <asp:ListItem Text="所有卖方好评" Value="salergood" />
          <asp:ListItem Text="所有卖方中评" Value="salercom" />
          <asp:ListItem Text="所有卖方差评" Value="salerbad" />
          <asp:ListItem Text="所有买方好评" Value="buyergood" />
          <asp:ListItem Text="所有买方中评" Value="buyercom" />
          <asp:ListItem Text="所有买方差评" Value="buyerbad" /> 
          
        <%--  <asp:ListItem Text="评价次数最多的商品" Value="product_review_most" />
          <asp:ListItem Text="评价最好的10个买家" Value="buyer_review_best_top10" />
          <asp:ListItem Text="评价最差的10个买家" Value="buyer_rview_weak_top10" />
          <asp:ListItem Text="评价最好的10个卖家" Value="saler_review_best_top10" />
          <asp:ListItem Text="评价最差的10个卖家" Value="saler_rview_weak_top10" />--%>
       </asp:DropDownList>
    </td>
        <td class="ltd">快速查找：</td><td class="rtd" style="width:35%"><asp:DropDownList ID="DetailSearchType" runat="server">
          <asp:ListItem Text="评价人用户名" Value="reviewer" />
          <asp:ListItem Text="被评价人用户名" Value="review_to" />
          <asp:ListItem Text="评价标题" Value="title" />
          <asp:ListItem Text="评价内容" Value="content" />
       </asp:DropDownList>
       <asp:TextBox ID="DetailSearchText" runat="server"  Width="100px" />
       <asp:CheckBox Text="日期" runat="server" AutoPostBack="false"  ID="SelectDate"/>
       </td></tr>

       <tr id="showdate" style="display:none;"><td class="ltd">开始日期：</td><td class="rtd" style="width:35%"><asp:TextBox ID="TxtBeginDate" runat="server" Width="120px"/>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="2001-01-01"
          ControlToValidate="TxtBeginDate" ValidationExpression="\d{4}-(\d){1,2}-(\d){1,2}"/> </td>
          <td class="ltd">终止日期：</td><td class="rtd" style="width:35%"><asp:textbox ID="TxtEndDate" runat="server"  Width="120px"/>
           <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="2001-01-01" ControlToValidate="TxtEndDate" ValidationExpression="\d{4}-(\d){1,2}-(\d){1,2}"/></td></tr>
       <tr><td colspan="4" class="btm"><asp:Button  Text="查找评价" runat="server" ID="DetailSearchButton" OnClick="DetailSearchButton_Click" Width="60"/></td></tr>
   </table>

<script type="text/javascript" language="javascript">showsearchdate();</script>

   <asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound" AutoGenerateColumns="False"
          DataKeyNames="ReviewsID" CssClass="adminlist"  AllowPaging="false">
        <Columns>
             <asp:TemplateField  HeaderText="ID" ItemStyle-Width="30" >
               <HeaderTemplate>
                  <input id="chkAll" onclick="SelectAllCheckboxes(this,'chk_select');" runat="server" type="checkbox" />
               </HeaderTemplate>
               <ItemTemplate>
                  <input type="checkbox" id="chk_select" name="chk_select" value='<%# Eval("ReviewsID") %>' />                        
               </ItemTemplate>
               <HeaderStyle Width="30" />
            </asp:TemplateField>
            <asp:HyperLinkField DataTextField="ProductName" ItemStyle-HorizontalAlign="Left" DataNavigateUrlFields="ProductID" HeaderText="商品名称" DataNavigateUrlFormatString="../Shop/Auction/Auction.aspx?ProductID={0}" Target="_blank" >
                </asp:HyperLinkField>
            <asp:BoundField DataField="UserName" HeaderText="评价人" >
                <HeaderStyle Width="10%" />
            </asp:BoundField>
            <asp:TemplateField  HeaderText="被评价人" >
               <ItemTemplate>
                  <asp:HyperLink ID="ReviewsTo" runat="server" Text='<%# Eval("ReviewerName") %>' NavigateUrl='<%# "Admin_UserDetail.aspx?UserID="+Eval("ReviewerID") %>'  />
                  <asp:HiddenField ID="ReviewsToID" runat="server" Value='<%# Eval("ReviewerID") %>' />
               </ItemTemplate>
               <HeaderStyle Width="10%" />            
            </asp:TemplateField> 
            <asp:TemplateField  HeaderText="标题" >
               <ItemTemplate>
                  <asp:HyperLink ID="Title" runat="server" Text='<%# Eval("ReviewTitle") %>' NavigateUrl="#" ToolTip='<%# Eval("ReviewContent") %>' />
               </ItemTemplate>
               <HeaderStyle Width="20%" />            
            </asp:TemplateField>           
            <asp:BoundField DataField="ReviewStar" HeaderText="评价"  >
                <HeaderStyle Width="10%" />
            </asp:BoundField>
            <asp:BoundField DataField="ReviewDate" HeaderText="日期"  >
                <HeaderStyle Width="10%" />
            </asp:BoundField>            
        </Columns> 
        <EmptyDataTemplate>
                <tr>
                    <th>ID</th>
                    <th>编号</th>
                    <th>商品</th>
                    <th>评价人</th>
                    <th>被评价人</th>
                    <th>标题</th>
                    <th>评价</th>
                    <th>日期</th>
                </tr>
                <tr><td colspan="8">暂无信息！</td></tr>
        
        </EmptyDataTemplate>
   </asp:GridView>
    <div class="page">
        <asp:Label ID="PagePanel" runat="server" />
    </div>
    <div class="div_btm">
          <asp:Button ID="deleteButton" runat="server" Text="删除并扣评分" CommandName="delete_substract" OnCommand="ReviewButton_OnCommon" OnClientClick="return confirm('确定删除评价,并扣除被被评价人的评分!')"/>
          <asp:Button ID="Button1" runat="server" Text="删除不扣评分" CommandName="delete" OnCommand="ReviewButton_OnCommon" OnClientClick="return confirm('确定删除评价,但不扣除被被评价人的评分!')"/>        
          <asp:Button ID="illegalButton" runat="server" Text="设为无效评价" CommandName="illegal" OnCommand="ReviewButton_OnCommon" OnClientClick="return confirm('设为无效评价后,并扣除被被评价人的评分!')"/>
          <asp:Button ID="legalButton" runat="server" Text="设为有效评价" CommandName="legal" OnCommand="ReviewButton_OnCommon" OnClientClick="return confirm('设为有效评价后,并增加被被评价人的评分!')"/>
    </div>

</asp:Content>
