<%@ Page Title="" Language="C#" MasterPageFile="~/oa/oa.Master" AutoEventWireup="true" CodeBehind="memlist.aspx.cs" Inherits="oa.chat.memlist" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 
   <style>
       .smf {
        
       font-size:10px;
       }
   </style>

  <script>
      var show
      show = 1;//show

      function togglechat2() { 
          
              window.parent.oa.cols = "190px,*,320px,140px"; 
      }

  </script>

     <table class="table table-hover" style="margin:0px" cellpadding="0" cellspacing="0">
		      <tbody>
		      
		       
		   <tr  >
               <td colspan="2" width="30"><b>员工通讯录</b></td>
		    
		   </tr> 

        <asp:Repeater runat="server" ID="rpt_users">
<ItemTemplate>

		   <tr >
		    <td> 
	  
	 	 <a  onclick="togglechat2();" target="chat" href="chatlist.aspx?touid=<%#Eval("uid") %>&todisplayname=<%#Server.UrlEncode(Eval("displayname").ToString()) %>"  >
		   <img src="<%#Eval("avtor") %>"   style="margin:0px; padding:0px"   class="img-rounded" height="30px" /> 
               
         </a>
                
          
		    </td>
		 
			 
<td>
     <a   onclick="togglechat2();" target="chat" href="chatlist.aspx?touid=<%#Eval("uid") %>&todisplayname=<%#Server.UrlEncode(Eval("displayname").ToString()) %>"  >
		   <%#Eval("displayname")%>
               
         </a>
    <span class="smf" id="msg_<%#Eval("uid") %>"></span>
</td>
                
	       </tr>
		   

	</ItemTemplate>

</asp:Repeater>
		 
		 
		 
		 
	  
		     </tbody></table>
		 
 
    <script>

        function SetMsgUser()
        {
            $(".smf").html("(0)");

            $.ajax({
                url: "/oa/chat/get_unread_msg_users.aspx",
                data: { cmd:"", dt1:"" },
                cache: false,
                async: false,
                dataType: 'json',
                success: function (data) {
                    // alert(data);
                    $.each(data, function (idx, item) {
                        var uid = item.uid;
                        var c = item.c;
                        try {
                          $("#msg_" + uid).html("("+c+")");
                          $("#msg_" + uid).css("color", "red");
                        }
                        catch (e)
                        {
                        }
                       
                    });
                }
            });
             

        }

        SetMsgUser();

        setInterval("SetMsgUser()", 60000);
    </script>

     
</asp:Content>
