<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Outlook.aspx.cs" Inherits="Book.Book.Outlook" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
   <script src="../Javascript/jquery142.js" type="text/javascript"></script>
   <script src="date.js" type="text/javascript"></script>
  <script src="daojishi.js" type="text/javascript"></script>
 <style> 
 
   body{   width:1020px;   margin:0 auto; }
   
   
   
  
  .tips1{ font-weight:bold; font-size:13px; font-family:Verdana;  margin-top:12px; margin-left:40px; color:#ee0000}
  .tips2{ font-weight:bold; font-size:13px; font-family:Verdana;  margin-top:10px; margin-left:40px; color:#3ec750}
  .bgclock{ font-weight:bold; font-size:13px; font-family:Verdana;  margin-top:5px;   }
  .currentroomname{ font-weight:bold; font-size:13px; font-family:Verdana;  margin-top:5px;}
  .meetingtime{ color:#ff0000; font-size:50px; font-weight:bold; margin-left:20px; margin-top:170px;} 

  .next{ color:#000000; font-size:30px;  font-weight:bold; text-align:right; margin-right:20px; }
  #currentbook{ margin-top:30px; margin-left:20px; margin-right:20px;}
#roomname{ text-align:center; font-size:30px; margin:10px}
  .hour{ text-align:center; font-size:20px; margin:10px;}
  .hour span{color:blue;  }
  .hour2{ text-align:center; font-size:20px; margin:10px;}
  
  #part11{    width:600px;  margin:10px 10px 10px 3px;}
  #part12{    width:600px;  margin:10px 10px 10px 3px;}
  
 
 #welcomemessage{ }
 
 .meetingkey{ font-size:14px; font-weight:normal;font-family:宋体;}
 .meetingvalue{font-size:16px; font-weight:bold; }
 
 .todaybooklist{ background-color:#ffffff;  }
 .booklist{ font-family:微软雅黑; font-size:15px; text-align:center;width:400px;  background:#ffffff;
  margin-top:20px;
 }
 .fac{ font-size:12px; }
 .passed{ color:gray}
 .current{ color:red;}
 .will{ color:#3ec750;}
.imgpos{ vertical-align:middle;}
 .pipe{ color:#666666;}
 .imgs{ vertical-align:middle;   }
 .have{ color:#000000;font-weight:bold;}
 </style>
 
<script>





    function contains(string, substr, isIgnoreCase) {
        if (isIgnoreCase) {
            string = string.toLowerCase();
            substr = substr.toLowerCase();
        }
        var startChar = substr.substring(0, 1);
        var strLen = substr.length;
        for (var j = 0; j < string.length - strLen + 1; j++) {
            if (string.charAt(j) == startChar)//如果匹配起始字符,开始查找
            {
                if (string.substring(j, j + strLen) == substr)//如果从j开始的字符与str匹配，那ok
                {
                    return true;
                }
            }
        }
        return false;
    }


    function setbook(o) {
        old = $("#part11").html();
        $("#currentroomname").html(o["currentroomname"]);
        $("#roomname").html(o["currentroomname"]);
        $("#fac").html(o["asset"]);

 

        if (o["begintime"] == 0) {
        //空闲放flash
            $("#part11").show();
            $("#part12").hide();

            $("#hour2").show();
            $("#hour").hide();

            if (!contains(old, o["flash"], true)) {
                $("#part11").html("<SPAN><EMBED src=" + o["flash"] + "  width=600 height=600 ></EMBED></SPAN>");
            }

        }
        else {

            //如果已经使用
            $("#part11").hide();
            $("#part12").show();

            $("#hour").show();
            $("#hour2").hide();

            if (o["flash"] != "" && o["flash"] != "../") {

                var logo = o["flash"];
                var fontsize = o["fontsize"];
                var fontcolor = o["fontcolor"];
                var msg = o["welcomemessage"];
                var content = "<img src=" + logo + "  >";
                $("#welcomemessage").html(content);
            }
            else {
                //$("#welcomemessage").html(o["welcomemessage"]);
            }

            
 
            Tday = new Date("" + o["ends"] + "");
            daojishi();

        }
    }


    function GetBook() {

        GetCurrentBook();
        GetBookList();
        setTimeout("GetBook()", 180000);
    }


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




    
</script> 
 
  
</head>
<body>
<br><br><br><br>
    <form id="form1" runat="server"   >   
       <img src="../images/bg.png" />
   
    
    <div > 
 
 
 
 
 
 
 
 
 
 
 <table style=" table-layout:fixed; width:1000px;  ">
 <tr valign="top" align="left">
 
 <td  width="600px"  align=left>
 
  <div id="part11" >
  </div>

  <div id="part12"   >
    <div id="welcomemessage"></div>
  </div>
  
 </td>
 
 <td  valign="top" >
 
 <!-- 会议列表 -->
 
 
  <div style=" font-family:Verdana; font-size:14px; font-weight:bold; text-align:right;  "> 
    <span id="fac" class="fac"></span>
 </div>
 
 
 
 <!-- meeting or room info -->	
 
   <div style="color:#ee0000; margin:5px; border-bottom:dotted 1px #cccccc">
      Room Name & Status
     </div> 
     
     
     <div id="roomname"></div>
     
    <div class="hour" id="hour"> 
 	 <span id="day" style=" display:none"></span>
	 <span id="hours"   class="daojishi"  ></span><span >:</span>
	 <span id="min"   class="daojishi"  ></span><span >:</span>
	 <span id="sec"    class="daojishi"  ></span>
   </div>
 
 
   <div class="hour2" id="hour2">
   Room is Free
   </div>

   <script src="daojishi.js" type="text/javascript"></script>
	 <!-- /meeting or room info -->	
		
		
 
  <div id="part2">
  
 <div class="todaybooklist">
     <div style="color:#ee0000; margin:5px; border-bottom:dotted 1px #cccccc">
      Today Meeting List
     </div> 
     <div id="booklist"> 
     </div>
      
</div>
  <!-- /会议列表 -->
 </div>
 
 
 
 </td>
 </tr>
 
 </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 <div style=" text-align:right; width:1000px; border-top:dotted 1px #111111">
 <span id="currentroomname" class="currentroomname"></span> &nbsp;&nbsp; <span id="bgclock" class="bgclock"></span>   &nbsp;&nbsp;
 </div>
 
</div>
     
     
 
    </form>
    
    
    
       <script>
           clock();
      </script>
   
   
   
   
</body>




<script>

    function GetCurrentBook() 
    {
        $.getJSON(
    "GetAjaxCurrentBook.aspx",
    { "roomid":<%=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 = '<table class=booklist><tbody>';
         html += '<th>NO.</th>';
         html += '<th>Time</th>';
         html += '<th>Department</th>';
         html += '<th>Contact People</th>';
         html += ' </tr>';

try
{

        $.each(data, function(i, entry) {
          
            html += '<td>' + entry['index'] + '</td>';            
            html += '<td>' + entry['begintime'] +' - '+entry['endtime']+ '</td>';         
            html += '<td>' + entry['contactdept'] + '</td>';
            html += '<td>' + entry['contactname'] + '</td>';
             html += '</tr>';            
        });
}
catch(e)
{
 
}

        html += '</tbody></table>';


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


    });


}
    
    </script>
    
    
    
  

</html>
