<%@ page language="java" pageEncoding="UTF-8"
         contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String basePath = request.getContextPath();
    String resourcePath = basePath + "/resource";
%>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>消息列表</title>
    <jsp:include page="../common/head.jsp"></jsp:include>
</head>
<body>
    <jsp:include page="../common/body_header.jsp"></jsp:include>
    <div class="bi">
        <div class="bi-mid">
            <div class="bi-mid0">
                <div class="bi-top0">
                    消息列表
                </div>
                <table  class="zixun">
                    <c:if test="${outputModel !=null}">
                        <c:forEach items="${outputModel}" var="item" varStatus="status">
                            <tr>
                                <td class="td8"><a href="javascript:void(0);" onclick="fnShowDetail(this)">${item.notiTitle}</a></td>
                                <td><fmt:formatDate value="${item.publishAt}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                                <input type="hidden" value="${item.notiContent}"/>
                            </tr>
                        </c:forEach>
                    </c:if>
                    <c:if test="${outputModel ==null}">
                        暂无消息
                    </c:if>
                </table>
            </div>
            <div class="clearfix"></div>
            <jsp:include page="../common/pager.jsp">
                <jsp:param name="pageNo" value="${pager.pageNo}"/>
                <jsp:param name="pageSize" value="${pager.pageSize}"/>
                <jsp:param name="total" value="${pager.total}"/>
            </jsp:include>
        </div>
    </div>
    <jsp:include page="../common/body_footer.jsp"></jsp:include>
<%--///////////////////////////////////////--%>
    <div  id="showDetail"  style="display: none" class="fade">
        <form id="formId">
            <div class="window" id="detailId">
                <div class="tz-1"></div>
                <div class="tz-2">发布时间：</div>
                <div class="tz-3"></div>
                <button class="tz-4" onclick="fnHide()">确定</button>
            </div>
        </form>
    </div>
<%--////////////////////////////////////--%>
</body>
<script>
    function fnShowDetail(tr){
        var jqu = $('#detailId').children("div:eq(0)").append($(tr).text());
        $('#detailId').children("div:eq(1)").append($(tr).parent().next().text());
        $('#detailId').children("div:eq(2)").text($(tr).parent().parent().find("input[type='hidden']").val());
        $('#showDetail').show();
    }
    function fnHide(){
        $('#formId').resetForm();
        $('#showDetail').hide();
    }

    //分页
    $('#pager a').not(".disabled").click(function(){
        var pageNo=$(this).attr("page");
        pageSearch(pageNo);
    })
    function pageSearch(pageNo) {
        window.location.href = "<%=basePath%>/open/notification/index.htm?pageNo="+pageNo+"";
    }
</script>
</html>