<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
    <title>管理日历</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function() {
            laydate.render({
                elem: '#year-month', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
            });
        });
    </script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox">
        <%--<div class="ibox-title">
            <h5>管理日历 </h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
                <a class="dropdown-toggle" data-toggle="dropdown" href="javascript:void(0)">
                    <i class="fa fa-wrench"></i>
                </a>
                <ul class="dropdown-menu dropdown-user">
                    <li><a href="javascript:void(0)">选项1</a>
                    </li>
                    <li><a href="javascript:void(0)">选项2</a>
                    </li>
                </ul>
                <a class="close-link">
                    <i class="fa fa-times"></i>
                </a>
            </div>
        </div>--%>

        <div class="ibox-content">
            <sys:message content="${message}"/>

            <!-- 查询条件 -->
            <div class="row">
                <div class="col-sm-12">
                    <form:form id="searchForm" modelAttribute="report" action="${ctx}/oa/manageCalendar/getManageCalendarInfoByMonth?date=${param.date}" method="get" class="form-inline">
                        <input type="hidden" name="userId" value="${user.id}"/>
                        <a href="#" id="moresee" class="fa fa-chevron-down" style="float: right;">更多</a>
                        <div class="form-group">
                            <label>创建时间：</label>
                            <input id="year-month"  name="date"  type="text" readonly="readonly" maxlength="20" style="width:240px;" class="laydate-icondate form-control layer-date input-sm"
                                   value="<fmt:formatDate value="${report.date}" pattern="yyyy-MM-dd HH:mm:ss"/>">
                        </div>
                    </form:form>
                    <br/>
                </div>
            </div>
            <!-- 工具栏 -->
            <div class="row">
                <div class="col-sm-12">
                    <div class="pull-left">
                        <button class="btn btn-white btn-sm " data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i> 刷新</button>
                    </div>
                    <div class="pull-right">
                        <button  class="btn btn-primary btn-rounded btn-outline btn-sm " onclick="search()" ><i class="fa fa-search"></i> 查询</button>
                        <button  class="btn btn-primary btn-rounded btn-outline btn-sm " onclick="reset()" ><i class="fa fa-refresh"></i> 重置</button>
                    </div>
                </div>
            </div>
            <!--表格-->
            <table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
                <thead>
                <tr>
                    <th style="text-align: center" class="sort-column remarks">日期</th>
                    <th style="text-align: center" class="sort-column versions">记录</th>
                    <th style="text-align: center" class="sort-column content">操作</th>
                </tr>
                </thead>
                <tbody>
                <c:choose>
                    <c:when test="${empty thisMonthRecordList}">
                        <tr>
                            <td colspan="3" align="center">无记录</td>
                        </tr>
                    </c:when>
                    <c:otherwise>
                        <c:forEach items="${thisMonthRecordList}" var="report">
                            <c:if test="${report.reportNum >= 0}">
                                <tr>
                                    <td>
                                            ${report.date}
                                    </td>
                                    <td>
                                            ${report.reportNum}&nbsp;条
                                    </td>
                                    <td>
                                        <div style="text-align: center">
                                        <a target="_self" href="${ctx}/oa/manageCalendar/getManageCalendarInfoByDate?userId=${user.id}&date=${report.date}">查看详情</a>
                                        </div>
                                    </td>
                                </tr>
                            </c:if>
                        </c:forEach>
                    </c:otherwise>
                </c:choose>
                </tbody>

            </table>

        <br/>
        <br/>
        </div>
        </div>
    </div>
<div>
</div>
</body>
</html>