<%@ Page Title="" Language="C#" MasterPageFile="~/Portal/default.master" AutoEventWireup="true" CodeBehind="Msg_Mgr.aspx.cs" Inherits="Portal.Portal.Msg_Mgr" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


    
    
  <table class="thetable">
  <tr  valign="top" >
  


   <td width="230px">    
 
 

<div class="sidebar" id="sidebar"> 
     
<div id="nav_head" class="text-center"  >
	<span class="menu-text"> <asp:Label runat="server" ID="lbl_pagetitle"  ></asp:Label></span> 
</div>



  <ul id="slidenews"  class="nav nav-list">
         <asp:Repeater runat="server" ID="rpt_msg_nav"   >
                            <ItemTemplate> 
                            
                                    <li>
                                    <a   href="default.aspx?tabid=<%=_tabid %>&msgcatid=<%#Eval("id") %>" >
                                     ▶ <%#Eval("catname") %> </a>
                                </li>
                            </ItemTemplate>
                         

                        </asp:Repeater>  
	      
         
        <li><a href="Msg_Mgr.aspx?tabid=<%=_tabid %>"   >★管理</a> </li>  
    
  </ul>
   
    </div>	 
    
   </td>
  
  
<td>	
    <div class="thecontent">	 
 <!--  start  -->

         
      <ul class="breadcrumb fontbt">
               <li><a href=../>首页</a></li> <li>管理留言</a> 
   </ul>
       
       <div class="item-lists-box">
      
    <div  class="item-lists news-lists">
          

           
        <div class="well">




        筛选： <asp:CheckBox runat="server" ID="cb_needreply" Text="待回复" AutoPostBack="true" />
        <asp:CheckBox runat="server" ID="cb_needaudit" Text="待审批"  AutoPostBack="true" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button runat="server" ID="btnDel" Text="删除" OnClientClick="if(isselect()) return true; return false;" CssClass="btn btn-flat btn-sm btn-danger" OnClick="btnDel_Click" />
        <asp:Button CssClass="btn btn-flat btn-sm  bg-green"  OnClientClick="if(isselect()) return true; return false;" runat="server" ID="btnPass"  Text="审批通过" OnClick="btnPass_Click" />
        </div>

     <asp:ListView runat="server" ID="lv_audit" DataSourceID="SqlDataSource1" DataKeyNames="itemid">
         
   

         <ItemTemplate>
             <tr  >
                 <td>
                     <input type="checkbox" class="ck_item" value='<%# Eval("itemid") %>' > 
                 </td>

                   <td>
                    <%# Eval("catname") %>
                 </td>
                

                  <td>
                     <a target="_blank" href="msg_detail.aspx?itemid=<%#Eval("itemid") %>&msgcatid=<%#Eval("catid") %>&tabid=<%=_tabid %>"><%# Eval("title") %></a>
                  </td>

                  
                   <td> <%# Eval("username") %>
                   
                 </td>

                    <td class="xs-adddate">
                     <%# Eval("tel") %>
                 </td>

                 <td class="xs-adddate">
                     <%# Eval("email") %>
                 </td>

                
                 <td class="xs-adddate">
                     <%#Eval("adddate") %>
                  
                 </td>
                 
                  <td class="xs-adddate">
                    <%#getstatus(Eval("needaudit"),Eval("ispass")) %>
                  
                 </td>
                 
               
                 
             </tr>
         </ItemTemplate>
         <LayoutTemplate>
   
                         <table id="itemPlaceholderContainer" runat="server" 
                             class="table table-hover" >
                             <tr runat="server" >
                                 <th   style="width:60px"> 
                                     <input type="checkbox" onclick="selectall(this)" />全选

                                 </th>
                                
                                  <th  >类别</th>
                                 <th  style="width:200px;">标题</th>
                                 <th runat="server" >姓名</th>
                                 <th   style="width:80px;">电话</th> 
                                 <th  style="width:150px;">邮件</th> 
                                  <th  style="width:90px;">日期</th> 
                                  <th  style="width:30px;">状态</th> 
                             </tr>
                             <tr id="itemPlaceholder" runat="server">
                             </tr>
                           

                         </table>
                     
                       
                    
         </LayoutTemplate>
        
         


     </asp:ListView>

       <asp:DataPager ID="DataPager1" PagedControlID="lv_audit" PageSize="20" runat="server">
                             <Fields>
                                 <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" ShowLastPageButton="True" />
                             </Fields>
</asp:DataPager>

    <asp:SqlDataSource ID="SqlDataSource1"
         ConnectionString="<%$ ConnectionStrings:connectionString %>"
        SelectCommand=" select itemid, catname,needaudit, title,adddate, tel,email, catid,ip , username ,ispass from portal_messages inner join
        portal_messagecat on portal_messages.catid=portal_messagecat.id
        where (pid=0) and (isdeleted=0) and (@needreply='' or reply<=0)  and (@needaudit='' or ( needaudit=1 and ispass=0  ))  order by itemid desc "
        
         runat="server" ProviderName="System.Data.SqlClient">
        <SelectParameters>
            <asp:ControlParameter  ConvertEmptyStringToNull="false" ControlID="cb_needreply" Name="needreply" />
            <asp:ControlParameter  ConvertEmptyStringToNull="false" ControlID="cb_needaudit" Name="needaudit" />
           
        </SelectParameters>




    

    </asp:SqlDataSource>



            
    <input type="hidden" name="hf_ids" id="hf_ids" /> 


















    
    </div>  

        </div>
   </div>
         
 
    </td>
      </tr>
      </table>







</asp:Content>
