<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>

<head>

    <title>通讯录</title>
    <meta name="decorator" content="default"/>
    
     <link href="${ctxStatic}/common/css/animate.css" rel="stylesheet">


	<script type="text/javascript">
	
		function search(n,s){
			$("#searchForm").attr("action","${ctx}/iim/contact/index");
			$("#searchForm").submit();
	    	return false;
	    }

	    function deleteFriend(id){
            top.layer.confirm('确认要删除好友吗?', {icon: 3, title:'系统提示'}, function(index){
                window.location = "${ctx}/iim/contact/delFriend?id="+id;
                top.layer.close(index);
            });
	    }
	    function friendAudit(id){
            top.layer.confirm('确认要添加好友吗?', {icon: 1, title:'系统提示'}, function(index){
                window.location = "${ctx}/iim/contact/friendAudit?id="+id;
                top.layer.close(index);
            });
	    }
	    function friendAuditNo(id){
            top.layer.confirm('确认要拒绝好友吗?', {icon: 1, title:'系统提示'}, function(index){
                window.location = "${ctx}/iim/contact/friendAuditNo?id="+id;
                top.layer.close(index);
            });
	    }
	</script>
    <style>
        body{
            background-color:transparent;
            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
            color:#ffffff;
            background-color:rgba(255,255,255,0);
            height:100%;
        }
        .contact-box{
            padding-left:35px;
            padding-right:35px;
            height:260px;
        }
        .contact-box a,
        .contact-box a:hover{
            color:#333333;
        }
        address{
            margin-top: 10px;
            margin-bottom: 0px;
        }
        .edit-friend{
            position: absolute;
            top:130px;
            right:50px;
            width:30px;
        }

    </style>
</head>

<body>
<div class="wrapper wrapper-content">
    <div class="layui-row">
        <div class="full-width fl">
            <div id="queryDiv">
            </div>
        </div>
        <div class="full-width fl">
            <div class="contentShadow layui-form contentDetails">

            <br class="row">
            <c:forEach var="user" items="${listAudit}">

               <div class="col-sm-4" style="padding: 0">
                   <div style="padding: 0 15px 15px 15px;">
                       <div class="contact-box">
                           <a href="javascript:void(0)">
                               <div style="height:100px;">
                                   <div class="text-center" style="width:100px;height: 100%;">
                                       <img alt="image" class="img-circle" style="max-height: 100%;max-width: 100%;height:100%;" src="<c:out value="${user.photo}" />">
                                   </div>
                               </div>
                               <div>
                                   <address>
                                       <span>姓名：</span><c:out value="${user.name}" /><br>
                                       <span>状态：</span>[待审批]<br>
                                       <span>公司：</span><c:out value="${user.company.name}" /><br>
                                       <span>部门：</span><c:out value="${user.office.name}" /><br>
                                       <span>电子邮件：</span><c:out value="${user.email}" /><br>
                                       <span>固定电话：</span><c:out value="${user.phone}" /><br>
                                       <span title="Phone">手机：</span> <c:out value="${user.mobile}" />
                                   </address>
                               </div>
                               <div class="edit-friend">
                                   <c:if test="${user.friendType == 1}">
                                       <a class="hidden pull-right close-link btn btn-outline  btn-default btn-circle"   onclick="friendAudit('${user.id}')"><i class="fa fa-edit"></i>
                                       </a>
                                       <a class="hidden pull-right close-link btn btn-outline  btn-default btn-circle"   onclick="friendAuditNo('${user.id}')"><i class="fa fa-times"></i>
                                       </a>
                                   </c:if>
                               </div>
                               <div class="clearfix"></div>
                           </a>
                       </div>
                   </div>
               </div>
            </c:forEach>

            <c:forEach var="user" items="${list}">
     		
                <div class="col-sm-4" style="padding: 0">
                    <div style="padding: 0 15px 15px 15px;">
                        <div class="contact-box">
                            <a href="javascript:void(0)">
                                <div style="height:100px;">
                                    <div class="text-center" style="width:100px;height: 100%;">
                                        <img alt="image" class="img-circle" style="max-height: 100%;max-width: 100%;height:100%;" src="<c:out value="${user.photo}" />">
                                    </div>
                                </div>
                                <div>
                                    <address>
                                        <span>姓名：</span><c:out value="${user.name}" /><br>
                                        <span>状态：</span>好友<br>
                                        <span>公司：</span><c:out value="${user.company.name}" /><br>
                                        <span>部门：</span><c:out value="${user.office.name}" /><br>
                                        <span>电子邮件：</span><c:out value="${user.email}" /><br>
                                        <span>固定电话：</span><c:out value="${user.phone}" /><br>
                                        <span title="Phone">手机：</span> <c:out value="${user.mobile}" />
                                    </address>
                                </div>
                                  <div class="edit-friend">
                                    <a class="hidden pull-right close-link btn btn-outline  btn-default btn-circle"   onclick="deleteFriend('${user.id}')"><i class="fa fa-times"></i>
                                    </a>
                                  </div>
                                <div class="clearfix"></div>
                            </a>
                        </div>
                    </div>
                </div>
            </c:forEach>
            <div class="col-sm-4"  style="padding: 0">
                <div style="padding: 0 15px 15px 15px;">
                    <div class="contact-box">
                        <a href="javascript:void(0)" onclick="searchFriend()">
                            <div class="">
                                <div class="text-center">
                                    <img alt="image" style="height:140px;width:140px" class="img-circle" src="${ctxStatic}/images/add_user.jpg">
                                    <div class="m-t-xs font-bold"></div>
                                </div>
                            </div>
                            <div class="">
                                <br/>
                                <br/>
                                <h1 class="text-center"><strong>添加好友</strong></h1>
                            </div>
                            <div class="clearfix"></div>
                        </a>
                    </div>
                </div>
            </div>
                <div style="clear: both;"></div>
        </div>
        </div>
    </div>
</div>
<script>
    resizeListWindow3();
    $(window).resize(function(){
        resizeListWindow3();
    });
</script>
    <!-- 全局js -->

    <script>
	    $(document).ready(function () {
	        $('.contact-box').each(function () {
	            animationHover(this, 'pulse');
	        });

	    });

	    function searchFriend(){
			top.layer.open({
			    type: 2,  
			    area: ['95%','95%'],
			    title:"添加好友",
			    name:'friend',
                skin:"two-btns",
			    content: "${ctx}/iim/contact/searchUsers" ,
			    btn: ['确定', '关闭'],
			    yes: function(index, layero){
			    	 var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
			    	 var ids = iframeWin.getSelectedIds();

			    	 if(ids == "-1"){
				    	 return;
			    	 }
			    	 window.location = "${ctx}/iim/contact/addFriend?ids="+ids;
					 top.layer.close(index);//关闭对话框。
				  },
				  cancel: function(index){ 
	    	       }
			}); 
		};
	</script>

    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--统计代码，可删除-->

</body>

</html>