<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin_Comment" Codebehind="KS.Comment.aspx.cs" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.Publics" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">
<div class="content-area">
	<div class="myTitle">评价管理</div>
	<div class="quickSearch clearfix">
        <div class="SearchBox fl">
            <asp:DropDownList ID="DrpSearchType" runat="server" style="margin-right:8px;">
             <asp:ListItem Value="1">用户名称</asp:ListItem>
             <asp:ListItem Value="2">评价内容</asp:ListItem>
            </asp:DropDownList>
            <asp:TextBox ID="TxtKey"  CssClass="textbox" runat="server" Width="200px"></asp:TextBox> 
            <asp:Button ID="Button1" runat="server" Text="开始搜索" CssClass="button" OnClick="Button1_Click" />
        </div>
        <div class="property">
            <div class="name button ml15">筛选</div>
            <div class="propertyBox">
                <ul class="tabs clearfix">
                    <span class="screen fl">审核状态：</span>
                    <li<%=KSCMS.S("logtype")==""?" class='active'":string.Empty %>><a href="KS.Comment.aspx?flag=<%=flag %>"><span>所有记录</span></a></li>
                    <li<%=KSCMS.S("logtype")=="2"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?logType=2&flag=<%=flag %>"><span>未审核</span></a></li>
                    <li<%=KSCMS.S("logtype")=="1"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?logType=1&flag=<%=flag %>"><span>已审核</span></a></li>
                    
                </ul>
                <ul class="tabs clearfix">
                    <span class="screen fl">评价等级：</span>
                    <li<%=KSCMS.S("logtype")=="3"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?logType=3&flag=<%=flag %>"><span>好评</span></a></li>
                    <li<%=KSCMS.S("logtype")=="4"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?logType=4&flag=<%=flag %>"><span>中评</span></a></li>
                    <li<%=KSCMS.S("logtype")=="5"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?logType=5&flag=<%=flag %>"><span>差评</span></a></li>
                </ul>
                 <ul class="tabs clearfix">
                    <span class="screen fl">类型：</span>
                    <li<%=KSCMS.S("flag")==""||KSCMS.S("flag")=="0"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?logType=<%=logType %>"><span>所有记录</span></a></li>
                    <li<%=KSCMS.S("flag")=="1"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?flag=1&logType=<%=logType %>"><span>班级</span></a></li>
                    <li<%=KSCMS.S("flag")=="2"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?flag=2&logType=<%=logType %>"><span>课程</span></a></li>
                    <li<%=KSCMS.S("flag")=="3"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?flag=3&logType=<%=logType %>"><span>教师</span></a></li>
                    <li<%=KSCMS.S("flag")=="4"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?flag=4&logType=<%=logType %>"><span>商品</span></a></li>
                     <li<%=KSCMS.S("flag")=="5"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?flag=5&logType=<%=logType %>"><span>文章</span></a></li>
                    <li<%=KSCMS.S("flag")=="6"?" class='active'":string.Empty %>><a href="KS.Comment.aspx?flag=6&logType=<%=logType %>"><span>下载</span></a></li>
                </ul>
            </div>
        </div>
    </div>
   <asp:Panel ID="ListPannel" runat="server">
        <KS:KSGV ID="LogDeliveryView" cssclass="CTable" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="FieldID" GridLines="None"
            OnRowDataBound="FieldListView_RowDataBound" Width="99%" 
            EnableTheming="True"  EmptyDataText="没有找到任何评价记录!" 
            onrowcommand="LogDeliveryView_RowCommand">
            <Columns>
               <asp:TemplateField HeaderText="选择">
                <itemstyle horizontalalign="Center" width="35px" />
                <itemtemplate>
                    <input type="checkbox"  name="ids" id="ids" value="<%#Eval("id") %>" />
               </itemtemplate>
              </asp:TemplateField>
                 <asp:TemplateField HeaderText="类型">
                  <itemstyle horizontalalign="Left"/>
                 <ItemTemplate>
                    <%#GetType(Utils.StrToInt(Eval("ChannelID").ToString())) %>
                 </ItemTemplate>  
                </asp:TemplateField>
                 <asp:TemplateField HeaderText="评价内容">
                  <itemstyle horizontalalign="Left"  />
                 <ItemTemplate>
                 <%# Utils.CutStr(Convert.ToString(Eval("Content")),60) %>
                     标题:<%#GetProductTitle(Utils.StrToInt(Eval("ProID")),Utils.StrToInt(Eval("OrderType")),Utils.StrToInt(Eval("flag")),Utils.StrToInt(Eval("ChannelID")))%>
                 </ItemTemplate>  
                </asp:TemplateField>
                <asp:BoundField DataField="UserName" HeaderText="评价人">
                  <itemstyle horizontalalign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="AddDate" HeaderText="时间">
                <itemstyle horizontalalign="Center" />
                </asp:BoundField>
                <asp:BoundField DataField="CmtType" HeaderText="评价">
                <itemstyle horizontalalign="Center" />
                </asp:BoundField>
              
               <asp:TemplateField HeaderText="星星">
                  <itemstyle horizontalalign="Center"  />
                 <ItemTemplate>
                 <img src="../../SysImg/star/star-<%#Eval("StarNum") %>.jpg" title="<%# Eval("StarNum") %>颗星"/>
                 </ItemTemplate>  
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="状态">
                <itemstyle horizontalalign="Center" />
             <itemtemplate>
                <%# Convert.ToString(Eval("status"))=="1"?"<span class='greenFont'>已审核</span>":"<span class='redFont'>未审核</span>" %>
               <%-- <%# Convert.ToString(Eval("isreply"))=="1"?"<span class='greenFont'>已回复</span>":"" %>--%>
               </itemtemplate>
            </asp:TemplateField>
 
            <asp:TemplateField HeaderText="查看">
                <itemstyle horizontalalign="Center" />
             <itemtemplate>
             <asp:LinkButton runat="server" id="showBtn" CssClass="showBtn" title="查看" CommandArgument='<%# Eval("id")+","+Eval("ordertype") %>' commandname="show"></asp:LinkButton>
               </itemtemplate>
            </asp:TemplateField>
                 <asp:TemplateField HeaderText="删除">
                <itemstyle horizontalalign="Center" width="30px"/>
               <itemtemplate>
                     <asp:LinkButton runat="server" id="delete" ToolTip="删除" CssClass="delete" commandargument=<%#Eval("id")+","+Eval("ordertype") %> commandname="del"></asp:LinkButton>
               </itemtemplate>
            </asp:TemplateField>
            </Columns>
            <HeaderStyle CssClass="CTitle" />
            <EmptyDataRowStyle CssClass="emptycss" />
        </KS:KSGV>
        <br />

        
          <KS:Page ID="Page1" runat="server" />
         <asp:Panel ID="Panel1" runat="server" Height="30px">
             <div class="listedit">
                 <input type="checkbox" name="chkall" id="chkall" onclick="CheckAll(this.form);"/><label for="chkall">全选</label>
                 <input type="button" value="删除选中的评价" class="button" onclick="if (GetIDS('del')){this.form.action='?action=del';this.form.submit()}" />
                 <asp:Button ID="Button2" runat="server" CssClass="button" Text="批量审核评价" onclick="Button2_Click"/>
                 <asp:Button ID="Button3" runat="server" CssClass="button" Text="批量取消审核" onclick="Button3_Click" />
             </div>
          </asp:Panel>   

        <script type="text/javascript">
		showtips('<span class="state"><strong>说明：</strong><br /></span>对商品的评价内容进行审核，删除等操作!');
		</script>
		</asp:Panel>
		
		<asp:Panel runat="server" ID="showPannel" Visible="false">
		 <table width="99%" border="0" cellpadding="0" cellspacing="0" class="CTable no-borderTable"> 
		    
             <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>标题：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=GetProductTitle(Utils.StrToInt(dr["ProID"].ToString()),Utils.StrToInt(dr["OrderType"].ToString()),Utils.StrToInt(dr["flag"].ToString()),Utils.StrToInt(dr["ChannelID"].ToString())) %>
                 </td>
             </tr>
             
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>评价人：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=dr["UserName"].ToString() %>
                 </td>
             </tr>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>评价时间：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=dr["AddDate"].ToString()%>
                 </td>
             </tr>
           
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>评价内容：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=dr["Content"].ToString().Replace("\n","<br/>")%>
                 </td>
             </tr>
              <%if (!string.IsNullOrEmpty(dr["photourls"].ToString())){ %>
              <tr>
                 <td align="right" class="lefttd" style="width: 109px;"><strong>评价晒图：</strong></td>
                 <td class="righttd">
		            <script type="text/javascript">
		                jQuery(function ($) {
		                    $(".imglist").click(function () {
		                        var src = '';
		                        $(".imglist").find("img").each(function () {
		                            if (src == '') {
		                                src = $(this).attr("big");
		                            } else {
		                                src +='|'+$(this).attr("big");
		                            }
		                        })
		                        top.initialPrettyPhotoPicStr(src);
		                    })
		                });
		            </script>

                     <style>
                         .imglist {
                         }
                         .imglist li {width:260px;float:left;height:260px;
                         }
                          .imglist li img {
                            width:250px;height:250px;border:1px solid #ccc;cursor:pointer;
                          }
                     </style>
                     <div class="imglist"><ul>
                     <%
                         var PhotoUrls = dr["PhotoUrls"].ToString();
                         var picArr = PhotoUrls.Split('§');
                         foreach (string p in picArr)
                         {
                             var s = "";
                             var b = "";
                             if (p.IndexOf('|') != -1)
                             {
                                 s = p.Split('|')[0];
                                 b = p.Split('|')[1];
                             }else
                             {
                                 s = p;
                                 b = p;
                             }
                             Response.Write("<li><img class='swipebox' big='"+b+"' src='" + s + "' /></li>");
                         }
                          %></ul></div>
                 </td>
             </tr>
             <%} %>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>评价星星：</strong></td>
                 <td class="righttd" style="height: 30px;"><img src="../../SysImg/star/star-<%=dr["StarNum"].ToString()%>.jpg" title="<%=dr["StarNum"].ToString() %>颗星"/> </td>
             </tr>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>评价等级：</strong></td>
                 <td class="righttd" style="height: 30px;">
                 <%
                     if (dr["CmtType"].ToString() == "0")
                     {
                         Response.Write("<span style='color:Green'>好评</span>");
                     }
                     else if (dr["CmtType"].ToString() == "1")
                     {
                         Response.Write("<span style='color:Purple'>中评</span>");
                     }
                     else
                     {
                         Response.Write("<span style='color:blue'>差评</span>");
                     }
                  %>
                 </td>
             </tr>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>状态：</strong></td>
                 <td class="righttd" style="height: 30px;">
                 <asp:RadioButtonList ID="RdbStatus" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                     <asp:ListItem Value="0" Selected="True">未审核</asp:ListItem>
                     <asp:ListItem Value="1">已审核</asp:ListItem>
                 </asp:RadioButtonList>
                 </td>
             </tr>
             <tbody>
             <asp:Label ID="replay" runat="server" Text="Label"></asp:Label>
             <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>回复内容：</strong></td>
                 <td class="righttd" style="height: 30px;">
                   <asp:TextBox ID="TxtReplyContent" runat="server" TextMode="MultiLine" Width="90%" Height="300"></asp:TextBox>
                       <% Kesion.APPCode.EditorAPI.EchoEditor("editor", this.TxtReplyContent.ClientID, "Basic");%>
                 </td>
             </tr>
<%--             <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>回复人：</strong></td>
                 <td class="righttd" style="height: 30px;">
                   <asp:TextBox ID="TxtReplyUser" runat="server" CssClass="textbox" Width="450"></asp:TextBox>
                 </td>
             </tr>
             <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>回复时间：</strong></td>
                 <td class="righttd" style="height: 30px;">
                   <asp:TextBox ID="TxtReplyDate" runat="server" CssClass="textbox Wdate" Width="450" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});"></asp:TextBox>
                 </td>
             </tr>--%>
            </tbody>
		 </table>

         <div class="main-button">
             <asp:HiddenField ID="HidId" Value="0" runat="server" />
            <asp:Button ID="BtnSubmit" runat="server" CssClass="button" Text="保存" OnClick="BtnSubmit_Click" />
          <input type="button" name="backBtn" class="button" value=" 返 回 " onclick="history.back()" />
         </div>

		</asp:Panel>

	</div>
    
</asp:Content>
