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

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

<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>

<asp:PlaceHolder ID="ListPanel" runat="server">
    
    <table class="nick">
    <tr>
            <td colspan="4" class="tit"><b>商城评价</b></td>
        </tr>
    <tr><td class="ltd" style="width:10%">高级查找：</td><td class="rtd" style="width:24%">
        <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:DropDownList>
    </td>
        <td class="ltd" style="width:10%">快速查找：</td><td class="rtd" style="width:25%">
        <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="200px" />
       <asp:CheckBox Text="日期" runat="server" AutoPostBack="false"  ID="SelectDate"/>
       </td></tr>
       <tr id="showdate" style="display:none;"><td class="ltd" style="width:10%">开始日期：</td><td class="rtd" style="width:24%"><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" style="width:10%">终止日期：</td><td class="rtd" style="width:25%"><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 ItemStyle-Width="4%" >
               <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>
            </asp:TemplateField>
            <asp:TemplateField  HeaderText="评价标题" ItemStyle-HorizontalAlign="Left">
               <ItemTemplate>
                  <asp:HyperLink ID="Title" runat="server" Text='<%# Eval("ReviewTitle") %>' NavigateUrl='<%# "?id="+Eval("ReviewsID") %>' />
               </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField  HeaderText="评价人"  HeaderStyle-Width="15%" >
               <ItemTemplate>
                  <asp:HyperLink ID="Reviewsname" runat="server" Text='<%# Eval("UserName") %>' NavigateUrl='<%# "Admin_UserDetail.aspx?UserID="+Eval("UserID") %>'  />
               </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField  HeaderText="被评人"  HeaderStyle-Width="15%" >
               <ItemTemplate>
                  <asp:HyperLink ID="ReviewsTo" runat="server" Text='<%# Eval("ReviewerName") %>' NavigateUrl='<%# "Admin_UserDetail.aspx?UserID="+Eval("ReviewerID") %>'  />
               </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField  HeaderText="评价打分"  HeaderStyle-Width="10%" >
               <ItemTemplate>
                  <asp:Literal ID="TextReviewStar" runat="server" Text='<%# (Eval("ReviewStar").ToString()=="1")?"好评":((Eval("ReviewStar").ToString()=="0")?"中评":"差评") %>'  />
               </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ReviewDate" HeaderText="日期" HeaderStyle-Width="15%" />
            <asp:TemplateField  HeaderText="有效"  HeaderStyle-Width="10%" >
               <ItemTemplate>
                  <asp:Literal ID="TextReviewStatus" runat="server" Text='<%# (Eval("ReviewStatus").ToString()=="1")?"有效":"无效" %>'  />
               </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="操作" HeaderStyle-Width="10%">
                <ItemTemplate>
                    <asp:HyperLink runat="server" ID="LinkButton1" Text="详细" NavigateUrl='<%# "?id="+Eval("ReviewsID") %>' />
                    <asp:LinkButton runat="server" ID="del" Text="删除" OnCommand="Delete_OnCommand" OnClientClick="return confirm('确定删除吗？')" CommandArgument='<%# Eval("ReviewsID") %>' />
                </ItemTemplate>
            </asp:TemplateField>
        </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="删除并扣评分" Visible="false" 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:PlaceHolder>


<asp:PlaceHolder ID="ViewPanel" runat="server">
    <asp:FormView ID="FormView1" DataKeyNames="ReviewsID" runat="server" Width="100%">
        <ItemTemplate>
        <table class="nick">
            <tr>
                <td class="ltd">评论标题：</td>
                <td class="rtd"><asp:Literal ID="Literal1" Text='<%#Eval("ReviewTitle") %>' runat="server" /></td>
            </tr>
            <tr>
                <td class="ltd">评论内容：</td>
                <td class="rtd"><asp:Literal ID="Literal2" Text='<%#Eval("ReviewContent") %>' runat="server" /></td>
            </tr>
            <tr>
                <td class="ltd">评论类型：</td>
                <td class="rtd"><asp:Literal ID="Literal3" Text='<%#(Eval("TransSize").ToString()=="1")?"卖家评论":"买家评论" %>' runat="server" /></td>
            </tr>
            <tr>
                <td class="ltd">平分：</td>
                <td class="rtd">
                    <asp:RadioButtonList ID="RadioStart" SelectedValue='<%#Eval("ReviewStar") %>' runat="server" RepeatDirection="Horizontal"  CssClass="RadioSelectStyle" RepeatLayout="Flow">
                    <asp:ListItem Value="-1"><img src="../Images/bad_review.gif" />差评</asp:ListItem>
                    <asp:ListItem Value="0"><img src="../Images/common_review.gif" />中评</asp:ListItem>
                    <asp:ListItem Value="1" Selected="True"><img src="../Images/good_review.gif" />好评</asp:ListItem>
             </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td class="ltd">评论人：</td>
                <td class="rtd"><asp:HyperLink ID="Literal5"  Target="_blank" NavigateUrl='<%# "/Shop/index.aspx?uid=" + Eval("UserID") %>' Text='<%#Eval("UserName") %>' runat="server" /></td>
            </tr>
            <tr>
                <td class="ltd">被评人：</td>
                <td class="rtd"><asp:HyperLink ID="Literal6" Target="_blank" NavigateUrl='<%# "/Shop/index.aspx?uid=" + Eval("ReviewerID") %>' Text='<%#Eval("ReviewerName") %>' runat="server" /></td>
            </tr>
            <tr>
                <td class="ltd">&nbsp;</td>
                <td class="rtd">
                    <input type="button" id="Button2" value=" 返 回 " onclick="history.back()" />
                </td>
            </tr>
        </table>
        </ItemTemplate>
    </asp:FormView>
</asp:PlaceHolder>

</asp:Content>
