<%@ Control Language="C#" AutoEventWireup="true"  CodeBehind="BookList.ascx.cs" Inherits="Book.UserControls.BookList" %>

 

 
 
 
 <div class="well">
 <asp:CheckBox runat="server" ID="cb_autohide" Text="隐藏已过期记录" 
    AutoPostBack="True" oncheckedchanged="cb_autohide_CheckedChanged" /> 
 </div>



  
 <asp:ListView ID="lv_lists" runat="server"     ItemContainerID="layoutTableTemplate"  
    DataKeyNames="id"   onitemdatabound="lv_lists_ItemDataBound" 
 >
 
 
    <LayoutTemplate>
 
   <table  class="table">
      <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
    </table>
  </LayoutTemplate>
     
  
   
    <ItemTemplate>
     
 
	   			
    <tr style="background-color:#f2f2f2">
    	 <td colspan=6 align="right"> 
    		 <a target="_blank" href='details.aspx?id=<%# Eval("id")%>' class="btn btn-flat btn-primary btn-sm">查看</a>  
     		 <a href='editbook.aspx?id=<%# Eval("id")%>'   class="btn btn-flat bg-green btn-sm">更新</a> 
             <a href='delete.aspx?id=<%# Eval("id")%>'   class="btn btn-flat btn-danger btn-sm">取消</a> 
       			
              
        <div style="display:none">

       

    <asp:PlaceHolder runat="server" ID="ph_yanchang">
        <a href="###"  data-bookid="<%#Eval("id") %>"  class="btn btn-flat btn-success btn-sm yanchang">延长会议</a>
    </asp:PlaceHolder>


    <asp:PlaceHolder runat="server" ID="ph_end">  
   <a href="###" data-bookid="<%#Eval("id") %>"    class="btn btn-flat btn-danger btn-sm end">结束会议</a>
</asp:PlaceHolder>

 </div>


    	 </td> 	
     </tr>
    
    
    
    
     <tr  align="left">
			 <td  width="33%"   colspan="2"><b>会议ID:</b> <%# Eval("id")%>
             (<span style=" font-size:10px">Create Date <%# DtHelper.GetDayTime(Eval("createdate"))%></span>)
			  </td>
			 <td  width="33%" colspan="2"><b>预订者:</b> <%# Eval("username")%> </td>
			  <td  width="33%" colspan="2"><b>状态(Status:)</b>  
			      <asp:Label ID="lbl_process" runat="server" Text=""></asp:Label>
			  </td>
	 </tr>
							
	  
         
       <tr  >
			 <td      colspan="2"><b>会议室：( Room)：</b><%# Eval("roomname")%></td>
			 <td   colspan="4"><b>会议主题：(Subject)：</b><div  style=" word-break:break-all; display:inline-block"><%# Eval("intro")%></div></td>
	 </tr>
	
	
	 
         
         
       <tr  align="left">
			 <td      colspan="3"><b>会议开始时间(Start)：</b><font color=#006699><%# DtHelper.GetDayTime(Eval("begintime")) %></font></td>
			 <td    colspan="3"><b>会议结束时间(End)：</b><font color=#006699><%# DtHelper.GetDayTime(Eval("endtime")) %></font></td>
	 	</tr>
	   		
	   		
	   		 
          
	   		
	   		
    </ItemTemplate>


  

</asp:ListView>   




<div>
 <asp:DataPager ID="DataPager1"   class="btn-group btn-group-sm" EnableViewState="false"
      QueryStringField="Page" PagedControlID="lv_lists" runat="server" PageSize=10>
 <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>



   <script>
        $(".end").click(
            function () {
                var that = this;
                var bookid = $(this).data("bookid");
                layer.confirm('确定结束会议吗？', {
                    btn: ['确定', '关闭']
                }, function () {

                    $.get("ajax/end_or_extend.aspx?t=end&bookid=" + bookid, function (r) {
                        layer.msg('成功结束会议', { icon: 1 });
                        $(that).hide();
                    })


                } );


            }
            );




        $(".yanchang").click(
          function () {
              var that = this;
              var bookid = $(this).data("bookid");
              layer.confirm('系统将把会议延长30分钟？', {
                  btn: ['确定', '关闭']
              }, function () {

                  $.get("ajax/end_or_extend.aspx?t=yanchang&bookid=" + bookid, function (r) {

                      layer.msg('成功结束会议', { icon: 1 });
                      $(that).hide();

                  })


              });


          }
            );


    </script>

