<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin_EnquiryForm" Codebehind="KS.EnquiryForm.aspx.cs" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.BLL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" Runat="Server">

<div class="content-area mt20">
	<div class="myTitle">问答管理</div>
	
   <asp:Panel ID="ListPannel" runat="server">
       <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.EnquiryForm.aspx?flag=<%=flag %>"><span>所有记录</span></a></li>
                    <li<%=KSCMS.S("logtype")=="2"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?logType=2&flag=<%=flag %>"><span>未审核</span></a></li>
                    <li<%=KSCMS.S("logtype")=="1"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?logType=1&flag=<%=flag %>"><span>已审核</span></a></li>
                    <li<%=KSCMS.S("logtype")=="3"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?logType=3&flag=<%=flag %>"><span>未解决</span></a></li>
                    <li<%=KSCMS.S("logtype")=="4"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?logType=4&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.EnquiryForm.aspx?logType=<%=logType %>"><span>所有记录</span></a></li>
                    <li<%=KSCMS.S("flag")=="1"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?flag=1&logType=<%=logType %>"><span>班级</span></a></li>
                    <li<%=KSCMS.S("flag")=="2"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?flag=2&logType=<%=logType %>"><span>课程</span></a></li>
                    <li<%=KSCMS.S("flag")=="3"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?flag=3&logType=<%=logType %>"><span>教师</span></a></li>
                    <li<%=KSCMS.S("flag")=="4"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?flag=4&logType=<%=logType %>"><span>商品</span></a></li>
                    <li<%=KSCMS.S("flag")=="5"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?flag=5&logType=<%=logType %>"><span>文章</span></a></li>
                   <li<%=KSCMS.S("flag")=="6"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?flag=6&logType=<%=logType %>"><span>下载</span></a></li>
                   <li<%=KSCMS.S("flag")=="7"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?flag=7&logType=<%=logType %>"><span>播放页</span></a></li>
                        <li<%=KSCMS.S("flag")=="8"?" class='active'":string.Empty %>><a href="KS.EnquiryForm.aspx?flag=8&logType=<%=logType %>"><span>空间</span></a></li>
                       </ul>
            </div>
        </div>
    </div>
        <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="30px" />
                <itemtemplate>
                    <input type="checkbox"  name="ids" id="ids" value="<%#Eval("TopicID") %>" />
               </itemtemplate>
              </asp:TemplateField>
                 <asp:TemplateField HeaderText="类型">
                  <itemstyle horizontalalign="Center"  />
                 <ItemTemplate>
                 <%# GetType(Convert.ToInt16(Eval("flag"))) %>
                    
                 </ItemTemplate>  
                </asp:TemplateField>
                 <asp:TemplateField HeaderText="咨询内容">
                  <itemstyle horizontalalign="Center"  />
                 <ItemTemplate>
                 <%# Utils.CutStr(Convert.ToString(Eval("Content")),60) %>
                    
                 </ItemTemplate>  
                </asp:TemplateField>


                <asp:BoundField DataField="UserName" HeaderText="咨询人">
                  <itemstyle horizontalalign="Center" />
                </asp:BoundField>
                
                <asp:BoundField DataField="AddDate" HeaderText="时间">
                <itemstyle horizontalalign="Center" />
                </asp:BoundField>
              
                <asp:TemplateField HeaderText="状态">
                <itemstyle horizontalalign="Center" />
             <itemtemplate>
                <%# Convert.ToString(Eval("verify"))=="1"?"<span class='greenFont'>已审核</span>":"<span class='redFont'>未审核</span>" %>
                <%# Convert.ToString(Eval("IsSolve"))=="1"?"&nbsp;&nbsp;&nbsp;<span class='greenFont'>已解决</span>":"&nbsp;&nbsp;&nbsp;<span class='redFont'>未解决</span>" %>
               </itemtemplate>
            </asp:TemplateField>
 
                <asp:TemplateField HeaderText="查看回复">
                <itemstyle horizontalalign="Center" />
             <itemtemplate>
           <%--  <asp:LinkButton runat="server" id="showBtn" CssClass="showBtn" title="查看/回复" commandargument=<%#Eval("TopicID") %> commandname="show"></asp:LinkButton>--%>
                 <a id="showBtn"  CssClass="showBtn" href="?action=show&id=<%#Eval("TopicID") %>">查看/回复</a>
               </itemtemplate>
            </asp:TemplateField>
             <asp:TemplateField HeaderText="删除">
                <itemstyle horizontalalign="Center" width="30px"/>
               <itemtemplate>
                     <asp:LinkButton runat="server" id="delete" ToolTip="删除" CssClass="delete" commandargument=<%#Eval("TopicID") %> 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="删除选中的咨询回复" onmouseover="this.className='button_on';" onmouseout="this.className='button';" class="button" onclick="if (GetIDS('del')){this.form.action='?action=del';this.form.submit()}" />
            &nbsp;&nbsp;<asp:Button
                ID="Button2" runat="server" CssClass="button" Text="批量审核咨询回复" onclick="Button2_Click"  />
          <asp:Button ID="Button3" runat="server" CssClass="button" Text="批量取消审核" onclick="Button3_Click" />
            <asp:Button ID="Button6" runat="server" CssClass="button" Text="批量设置已解决" onclick="Button6_Click" />
          </div>
          </asp:Panel>   

         <br />
        <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"> 

             <% if (Convert.ToInt16(dr["flag"]) == 10004) { %>
                 
                 <tr>
                     <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>课程名：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=DataFactory.GetOnlyValue("select Name from KS_Course where CourseID="+Utils.StrToInt(dr["courseid"].ToString())) %>
                 
                 </td>
             </tr>
                 
                <% }%>
		   
          
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>名称：</strong></td>
                 <td class="righttd" style="height: 30px;"><%=dr["title"].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["Imgids"].ToString())){ %>
              <tr>
                 <td align="right" class="lefttd" style="width: 109px;"><strong>咨询配图：</strong></td>
                 <td class="righttd">
                    <link rel="stylesheet" href="/ks_inc/Swipebox/swipebox.css">
		            <script src="/ks_inc/Swipebox/jquery.swipebox.js"></script>
		            <script type="text/javascript">
		                jQuery(function ($) {
		                    $(".swipebox").swipebox();
		                });
		            </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["Imgids"].ToString();
                    var picArr = PhotoUrls.Split(',');
                    foreach (string p in picArr)
                    {
                        if (!string.IsNullOrEmpty(p))
                        {
                                 var pic = Utils.SplitString(p + "###", "###");
                            Response.Write("<li><img class='swipebox' href='" + pic[0].ToString() + "' src='" + pic[0].ToString() + "' /></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;">
                 <%if (dr["IsSolve"].ToString() == "1")
                   {
                       Response.Write("<span style='color:green'>已解决</span>");
                   }
                   else
                   {
                       Response.Write("<span style='color:red'>未解决</span>");
                   }     
                  %>
                  
                   <asp:Button ID="Button4" CssClass="button ml15" runat="server" Text="设置为已解决" OnClick="Button4_Click" OnClientClick="return(confirm('确定设置为已解决么？已解决问题不可回复！'))" />
                 </td>
             </tr>
              <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>是否审核：</strong></td>
                 <td class="righttd" style="height: 30px;">
                 <%if (dr["verify"].ToString() == "1")
                     {
                         Response.Write("<span style='color:green'>已审核</span>");
                     }
                     else
                     {
                         Response.Write("<span style='color:red'>未审核</span>");
                     }
                  %>
                   <asp:Button ID="Button5" CssClass="button ml15" runat="server" Text="设置为审核" OnClick="Button5_Click"  />
                 </td>
             </tr>
              <asp:Label ID="replay" runat="server" Text="Label"></asp:Label>
             <%if (dr["IsSolve"].ToString() == "0")
            { %>
		    <tr>
                 <td align="right" class="lefttd" style="width: 109px; height: 30px"><strong>回复内容：</strong></td>
                 <td class="righttd" style="height: 30px;">

                 <asp:TextBox ID="TxtReplyContent" Width="90%" Height="300" TextMode="MultiLine" runat="server"></asp:TextBox>
                         <% Kesion.APPCode.EditorAPI.EchoEditor("editor", this.TxtReplyContent.ClientID, "Basic");%>
                 </td>
             </tr>
             <%} %>
		 </table>

         <div class="main-button">
          <asp:HiddenField ID="HidAskId" runat="server" />
             <%if (dr["IsSolve"].ToString() == "0")
                 { %>
          <asp:Button Text="提交回复" runat="server" ID="BtnSubmit" CssClass="button" 
                 onclick="BtnSubmit_Click" />
             <%} %>
          <%--<input type="button" name="backBtn" class="button" value=" 返 回 " onclick="history.back()" />--%>
            <a name="backBtn" class="button" href="KS.EnquiryForm.aspx"> 返 回 </a>
         </div>

		</asp:Panel>

	</div>
    
</asp:Content>
