<%@ Page Title="" Language="C#" MasterPageFile="~/Wap/Wap.Master" AutoEventWireup="true" CodeBehind="Room.aspx.cs" Inherits="Book.Wap.Room" %>


<asp:Content ID="Content12" ContentPlaceHolderID="head" runat="server">
 


</asp:content>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div  >
     <script src="../Book/date.js" type="text/javascript"></script>
    
    <script>
     
     

    function setbook(o) {
     
        $("#currentroomname").html(o["currentroomname"]);
        if (o["begintime"] == 0) {

            //如果没使用
             $("#status").html("<font color=green>（会议空闲中...）</font>");
            $("#intro").html("--");
            $("#status").html("（空闲中）");
            $("#begintime").html("0:00");
            $("#endtime").html("0:00");
            $("#contactdept").html("--");
            $("#flash").html("<img src=" + o["flash"] + " height=200>");
            $("#isclose").hide();

        }
        else {

            //如果已经使用
        
            $("#intro").html(o["intro"]);
            $("#status").html("<font color=red>（会议进行中...）</font>");
            $("#begintime").html(o["begintime"]);
            $("#endtime").html(o["endtime"]);
            $("#contactdept").html(o["contactdept"]);
            $("#flash").html("<img src=" + o["flash"] + " height=200>");
            $("#isclose").show();

            
            document.getElementById("isclose").href ="close.aspx?bookid="+o["bookid"]+"&roomid="+<%=Request.QueryString["roomid"] %>;
           

        }
    }


    function GetBook() {
         GetCurrentBook();
         GetBookList();
         setTimeout("GetBook()", 30000);
    }


    $(document).ready(function () {
        GetBook();
    });




    
</script> 
 
    
        
      
     <!--  This is content room name and date -->
 
 <style>
  .room_name{  height:40px;  width:300px ; padding-top:10px; font-size:25px;}  
 </style>
 
<fieldset class="ui-grid-a" data-inline="true"  >
	<div class="ui-block-a">
        <div id="currentroomname"  data-inline="true"  data-theme="d"  data-role="button"  class="room_name"></div>
    </div>


	<div class="ui-block-b">
    <div     class="room_name"  data-inline="true" id="bgclock"   data-theme="d" data-role="button" >
  
 


    </div></div>	   
</fieldset>


 
	


  <table>
  <tr valign="top">
  <td>

  <!-- this is meeting info  -->
   <div>
   
   <ul style=" background:#f0f0f0; width:500px;" data-role="listview" data-inset="true" data-theme="c" data-dividertheme="f"  >

   <li role="heading"  >会议室使用状态</li>
		
        
      <li data-theme="c"  data-role="list-divider"> 
      
      <a href="#">
			  <p>会议内容:</p>
             <h3> <span id="intro"></span></h3>
             <br />
	 </a>
 
      
      </li>
		 	
                
      <li data-theme="c"  data-role="list-divider"> 
      
      <a href="#">
			  <p>预定部门</p>
               <h3> <span id="contactdept"></span></h3>
                <br />
	 </a>
 
      
      </li>


          
      <li data-theme="c"  data-role="list-divider"> 
      
      <a href="#">
			  <p>会议时间:</p>
              <h1> <span id="begintime"></span> 到 <span id="endtime"></span>
               
             &nbsp;&nbsp; <span id="status"></span>
            
              </h1>

                <br />
	 </a>
 
      
      </li>

            
            
            </ul>

        

 
   
 

</div>
  <!-- /this is meeting info  -->
 
  </td>
   <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

  <td>
  <!-- meeting info  -->
 <div style=" padding-top:18px;">
  <span   id="flash" ></span>
  </div>
 
<a id="isclose" href='close.aspx' data-role='button' data-theme='a' data-rel='dialog'>会议结束</a>

 <!-- /meeting info  -->
  </td>
  </tr>
  </table> 

 

   <div id="booklist" style=" float:14px; color:Red; font-weight:bold; width:800px"></div>
  
 
</div>
     
    
     
    
     
      
     
   
    
   
    
<script>    clock();</script>


<script>

    function GetCurrentBook() {
        $.getJSON(
    "GetAjaxCurrentBook.aspx",
    { "roomid":<%=Request["roomid"] %>, random: Math.random() },

    function(d) {
        $.each(d, function(index, item) {
            setbook(item);
            return;
        });
    }
    ) 
    };
     
      
    
    function GetBookList() {
     
        $.getJSON(
    "GetAjaxBookList.aspx",
    { "roomid":<%=roomid %>, random: Math.random() },
    function(data) {
         var html = '<marquee scrollamount=10 scrolldelay=200>';

        try
        {

                $.each(data, function(i, entry) {
                   html += entry['begintime'] +' - '+entry['endtime']+"&nbsp;&nbsp;"+entry['intro']+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";         
                   
                });
        }
        catch(e)
        {
 
        }

        html += '</marquee>';


        $("#booklist").html(html);


    });
    }


  </script>



     



</asp:Content>
