<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true" CodeBehind="PhotoMgr.aspx.cs" Inherits="oa.admin.PhotoMgr" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    

    <style>
        .__img {
         height:60px;
        }
    </style>


    
    <div class="action form-inline">
        <asp:Button runat="server" ID="btn_del"    OnClientClick="if(isselect()) return true; return false;" Text="删除Photo" CssClass="btn btn-danger" OnClick="btn_del_Click" />

          &nbsp;&nbsp;&nbsp;&nbsp;
             <asp:Button ID="btnGen"    
                  CssClass="btn btn-success"
                  runat="server" Text="生成焦点图片"   OnClientClick="if(isselect()) return true; return false;"   onclick="btnGen_Click" /> 
           

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
           过滤 <asp:DropDownList runat="server" ID="ddl_cat" CssClass="form-control"
               Width="200" 
               
                AppendDataBoundItems="true" AutoPostBack="true">
           <asp:ListItem Text="请选择类别" Value=""></asp:ListItem>

          </asp:DropDownList>
    </div>



    <asp:ListView ID="lv_lists" runat="server" DataKeyNames="itemid" DataSourceID="SqlDataSource1">
       
        <ItemTemplate>
            <tr style="">
                <td >
                   
                      <input type="checkbox" value="<%# Eval("itemid") %>"  class="ck_item" />
                     <asp:Label ID="itemidLabel" runat="server" Text='<%# Eval("itemid") %>' />
                </td>
                 
             
                <td>
                    <img src='<%# Eval("thumpath") %>'  class="img-rounded __img" >

                </td>


                <td>
                    <a href="Photo_Delete.aspx?itemid=<%# Eval("itemid") %>" target="_blank">
                 <%# Eval("title") %>   </a>
                </td>
              
                  <td>
                   <%# Eval("catname") %>
                </td>
             
                <td>
                 <%# DateTime.Parse(Eval("createdate").ToString()).ToString("yyyy-MM-dd") %> 
                </td>


                <td>
                    <asp:Label ID="usernameLabel" runat="server" Text='<%# Eval("username") %>' />
                </td>

                   <td>
                    <a target="_blank" href="../UploadImgWithThum.aspx?groupid=<%# Eval("groupid") %>&catid=<%# Eval("catid") %>&id=<%# Eval("itemid") %>" >增加子图</a>
                     
                </td>
            </tr>
        </ItemTemplate>



        <LayoutTemplate>
           
      <table id="itemPlaceholderContainer" runat="server"  class="table table-hover">
                            <tr runat="server" >
                                <th runat="server" width="90px">ID
                                     <input type="checkbox"  class="ck_all" onclick="selectall(this);"  />


                                </th>
                                    
                              
                              <th  width="85px" >图片</th>
                                <th >标题</th>
                           
                                


                                   <th   width="120px">类别</th>

                                  <th runat="server" width="100px">发布日期</th>
                                <th runat="server" width="120px">发布人</th>
                                  <th runat="server" width="120px">增加子图</th>

                            </tr>
                            <tr id="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                   
        </LayoutTemplate>
        
    </asp:ListView>





    
<div>
 <asp:DataPager ID="DataPager1"   class="btn-group btn-group-sm" EnableViewState="false"
      QueryStringField="Page" PagedControlID="lv_lists" runat="server" PageSize=8>
 <Fields>
           
     
            <asp:NextPreviousPagerField 
                PreviousPageText="<" 
                FirstPageText="|<" 
                ShowPreviousPageButton="true"
                ShowFirstPageButton="true" 
                ShowNextPageButton="false" 
                ShowLastPageButton="false"
                ButtonCssClass="btn btn-default" 
                RenderNonBreakingSpacesBetweenControls="false" 
                RenderDisabledButtonsAsLabels="false" />

            <asp:NumericPagerField 
                ButtonType="Link" 
                CurrentPageLabelCssClass="btn btn-primary disabled"  
                RenderNonBreakingSpacesBetweenControls="false"
                NumericButtonCssClass="btn btn-default" 
                ButtonCount="10" 
                NextPageText="..." 
                NextPreviousButtonCssClass="btn btn-default" />
            
           <asp:NextPreviousPagerField 
               NextPageText=">" 
               LastPageText=">|" 
               ShowNextPageButton="true"
               ShowLastPageButton="true" 
               ShowPreviousPageButton="false" 
               ShowFirstPageButton="false"
               ButtonCssClass="btn btn-default" 
               RenderNonBreakingSpacesBetweenControls="false" 
               RenderDisabledButtonsAsLabels="false"/>
      

  </Fields> 
</asp:DataPager>
</div>




    <asp:SqlDataSource ID="SqlDataSource1" 
         SelectCommand=" select thumpath, click,itemid, groupid, title, username, createdate, catid,  catname from v_photoes  where istop=1  and   (@catid='' or catid=@catid) order by itemid desc "
         ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        
        runat="server"  >

        <SelectParameters>
            <asp:ControlParameter ControlID="ddl_cat" ConvertEmptyStringToNull="false"  Name="catid"/>
        </SelectParameters>


    </asp:SqlDataSource>


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







</asp:Content>
