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

<html>
<head>
    <title>管理日历每日统计</title>
    <meta name="decorator" content="default"/>
    <style type="text/css">
        img{width: 50px; height: 50px;}
    </style>
    <script type="text/javascript">
        $(function () {
            $("img").each(function () {
                var num = 1 ;

                $(this).click(function () {
                    var flag = num%2;
                    if(flag == 1){
                        $(this).css("width","100%");
                        $(this).css("height","100%");
                        num++;
                    }else if(flag ==0){
                        $(this).css("width","50px");
                        $(this).css("height","50px");
                        num++;
                    }
                })
            });
        })
    </script>
    <script type="text/javascript">
        $(function () {

            $(".diffSelect").bind("change",function () {
                var selectVal = $(".diffSelect").val();
                if(0==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).show();
                    });
                }
                if(1==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("报告")>=0?$(this).show():$(this).hide();
                    })
                }
                if(2==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("外勤")>=0?$(this).show():$(this).hide();
                    })
                }
                if(3==selectVal){
                    $("table:eq(1) tr").each(function () {
                        ($(this).find("td:eq(3)").text().indexOf("考勤")>=0
                            || $(this).find("td:eq(3)").text().indexOf("正常上班")>=0
                            || $(this).find("td:eq(3)").text().indexOf("正常下班")>=0
                            || $(this).find("td:eq(3)").text().indexOf("早退")>=0
                            || $(this).find("td:eq(3)").text().indexOf("迟到")>=0
                        ) ?$(this).show():$(this).hide();
                    })
                }
                if(4==selectVal){
                    $("table:eq(1) tr").each(function () {
                        ($(this).find("td:eq(3)").text().indexOf("审核")>=0
                            || $(this).find("td:eq(3)").text().indexOf("用印")>=0
                            || $(this).find("td:eq(3)").text().indexOf("请假")>=0
                            || $(this).find("td:eq(3)").text().indexOf("出差")>=0
                            || $(this).find("td:eq(3)").text().indexOf("加班")>=0
                            || $(this).find("td:eq(3)").text().indexOf("外出")>=0
                        ) ?$(this).show():$(this).hide();
                    })
                }
                if(31==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("迟到")>=0?$(this).show():$(this).hide();
                    })
                }
                if(32==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("正常上班")>=0?$(this).show():$(this).hide();
                    })
                }
                if(33==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("早退")>=0?$(this).show():$(this).hide();
                    })
                }
                if(34==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("正常下班")>=0?$(this).show():$(this).hide();
                    })
                }
                if(41==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("用印")>=0?$(this).show():$(this).hide();
                    })
                }
                if(42==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("请假")>=0?$(this).show():$(this).hide();
                    })
                }
                if(43==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("出差")>=0?$(this).show():$(this).hide();
                    })
                }
                if(44==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("加班")>=0?$(this).show():$(this).hide();
                    })
                }
                if(45==selectVal){
                    $("table:eq(1) tr").each(function () {
                        $(this).find("td:eq(3)").text().indexOf("外出")>=0?$(this).show():$(this).hide();
                    })
                }
            })

        })



    </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">
            <table class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
                <tr>
                    <td>分类查看</td>
                    <td>
                        <select class="diffSelect">
                            <option value="0">查看所有</option>
                            <option value="1">工作日志列表</option>
                            <option value="2">外勤签到列表</option>
                            <option value="3">考勤列表</option>
                            <option value="4">审核列表</option>
                            <option value="31">当天迟到人员列表</option>
                            <option value="32">当天正常上班人员列表</option>
                            <option value="33">当天早退人员列表</option>
                            <option value="34">当天正常下班人员列表</option>
                            <option value="41">当天用印人员列表</option>
                            <option value="42">当天请假人员列表</option>
                            <option value="43">当天出差人员列表</option>
                            <option value="44">当天加班人员列表</option>
                            <option value="45">当天外出人员列表</option>
                        </select>
                    </td>
                </tr>
            </table>
        </div>
        <div class="ibox-content">
        <table class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
            <tr>
                <th style="text-align: center;" class="">图片</th>
                <th style="text-align: center;" class="">用户</th>
                <th style="text-align: center;" class="">类型</th>
                <th style="text-align: center;" class="">创建时间</th>
                <th style="text-align: center;" class="">更新时间</th>
                <th style="text-align: center;" class="">详情</th>
            </tr>
        <c:forEach items="${manageCalendarDetailsList}" var="details">
            <!-- 工作日志-->
            <c:if test="${!empty details.workReports}">
                <c:forEach items="${details.workReports.workReport}" var="wr" varStatus="id_workReport">
                    <tr>
                        <td hidden="hidden">
                                ${wr.userId}
                        </td>
                        <td>
                            <img src="${wr.photo}" >
                        </td>
                        <td>
                                ${wr.userName}
                        </td>
                        <td>
                            工作日志
                        </td>
                        <td>
                            <fmt:formatDate value="${wr.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${wr.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <a onclick="openDialogView('查看工作日志', '${ctx}/work/report/workReport/form?id=${wr.workReportBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs"><i class="fa fa-search-plus"></i>查看详情</a>
                            </div>
                            <%--<input value="${wr.workReportBean.id}" hidden="hidden">--%>
                        </td>
                    </tr>
                </c:forEach>
            </c:if>
            <!-- 外勤签到-->
            <c:if test="${!empty details.workOutSignIns}">
                <c:forEach items="${details.workOutSignIns.workOutSignIn}" var="sign">
                    <tr>
                        <td hidden="hidden">
                            ${sign.userId}
                        </td>
                        <td>
                            <img src="${sign.photo}" >
                        </td>
                        <td>
                            ${sign.userName}
                        </td>
                        <td>
                            外勤签到
                        </td>
                        <td>
                            <fmt:formatDate value="${sign.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${sign.updateDate}" pattern="yyyy-MM-dd HH:mm:ss" />
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${sign.workOutSignInBean}" hidden="hidden"/>
                            <a onclick="openDialogView('查看外勤签到信息', '${ctx}/workoutsignin/workOutSignIn/form?id=${sign.workOutSignInBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs"> 查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
            </c:if>

            <!-- 审核-->
            <c:if test="${!empty details.audits}">
                <c:forEach items="${details.audits.workSealFrom}" var="seal">
                    <tr>
                        <td hidden="hidden">
                                ${seal.userId}
                        </td>
                        <td>
                            <img src="${seal.photo}" >
                        </td>
                        <td>
                                ${seal.userName}
                        </td>
                        <td>
                            用印
                        </td>
                        <td>
                            <fmt:formatDate value="${seal.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${seal.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${seal.workSealFormBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看用印信息', '${ctx}/oa/manageCalendar/workSealForm?id=${seal.workSealFormBean.id}','80%','80%')" class="btn btn-info btn-xs"> 查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
                <c:forEach items="${details.audits.leave}" var="lev">
                    <tr>
                        <td hidden="hidden">
                                ${lev.userId}
                        </td>
                        <td>
                            <img src="${lev.photo}" >
                        </td>
                        <td>
                                ${lev.userName}
                        </td>
                        <td>
                            请假
                        </td>
                        <td>
                            <fmt:formatDate value="${lev.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${lev.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${lev.leaveBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看请假信息', '${ctx}/oa/manageCalendar/leaveForm?id=${lev.leaveBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs"> 查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
                <c:forEach items="${details.audits.oaEvection}" var="evection">
                    <tr>
                        <td hidden="hidden">
                                ${evection.userId}
                        </td>
                        <td>
                            <img src="${evection.photo}" >
                        </td>
                        <td>
                                ${evection.userName}
                        </td>
                        <td>
                            出差
                        </td>
                        <td>
                            <fmt:formatDate value="${evection.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${evection.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${evection.oaEvectionBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看出差信息', '${ctx}/oa/manageCalendar/evectionForm?id=${evection.oaEvectionBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs"> 查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
                <c:forEach items="${details.audits.workOvertimeForm}" var="workOvertime">
                    <tr>
                        <td hidden="hidden">
                                ${workOvertime.userId}
                        </td>
                        <td>
                            <img src="${workOvertime.photo}" >
                        </td>
                        <td>
                                ${workOvertime.userName}
                        </td>
                        <td>
                            加班
                        </td>
                        <td>
                            <fmt:formatDate value="${workOvertime.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${workOvertime.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${workOvertime.workOvertimeFormBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看加班信息', '${ctx}/oa/manageCalendar/workOvertimeForm?id=${workOvertime.workOvertimeFormBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs"> 查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
                <c:forEach items="${details.audits.workGoOut}" var="out">
                    <tr>
                        <td hidden="hidden">
                                ${out.userId}
                        </td>
                        <td>
                            <img src="${out.photo}" >
                        </td>
                        <td>
                                ${out.userName}
                        </td>
                        <td>
                            外出
                        </td>
                        <td>
                            <fmt:formatDate value="${out.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${out.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${out.goOutBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看外出信息', '${ctx}/oa/manageCalendar/goOutForm?id=${out.goOutBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs"> 查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
            </c:if>
            <!-- 考勤-->
            <c:if test="${!empty details.attendances}">
                <c:forEach items="${details.attendances.late}" var="lat">
                    <tr>
                        <td hidden="hidden">
                                ${lat.userId}
                        </td>
                        <td>
                            <img src="${lat.photo}" >
                        </td>
                        <td>
                                ${lat.userName}
                        </td>
                        <td>
                            迟到
                        </td>
                        <td>
                            <fmt:formatDate value="${lat.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${lat.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input   value="${lat.oaAttendanceBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看考勤信息', '${ctx}/oa/oaAttendance/form?id=${lat.oaAttendanceBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs">查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
                <c:forEach items="${details.attendances.onDuty}" var="on">
                    <tr>
                        <td hidden="hidden">
                                ${on.userId}
                        </td>
                        <td>
                            <img src="${on.photo}" >
                        </td>
                        <td>
                                ${on.userName}
                        </td>
                        <td>
                            正常上班
                        </td>
                        <td>
                            <fmt:formatDate value="${on.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${on.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${on.oaAttendanceBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看考勤信息', '${ctx}/oa/oaAttendance/form?id=${on.oaAttendanceBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs">查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
                <c:forEach items="${details.attendances.leaveEarly}" var="early">
                    <tr>
                        <td hidden="hidden">
                                ${early.userId}
                        </td>
                        <td>
                            <img src="${early.photo}" >
                        </td>
                        <td>
                                ${early.userName}
                        </td>
                        <td>
                            早退
                        </td>
                        <td>
                            <fmt:formatDate value="${early.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${early.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${early.oaAttendanceBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看考勤信息', '${ctx}/oa/oaAttendance/form?id=${early.oaAttendanceBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs">查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
                <c:forEach items="${details.attendances.offDut}" var="off">
                    <tr>
                        <td hidden="hidden">
                                ${off.userId}
                        </td>
                        <td>
                            <img src="${off.photo}" >
                        </td>
                        <td>
                                ${off.userName}
                        </td>
                        <td>
                            正常下班
                        </td>
                        <td>
                            <fmt:formatDate value="${off.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <fmt:formatDate value="${off.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <div style="text-align: center">
                            <input  value="${off.oaAttendanceBean.id}" hidden="hidden"/>
                            <a onclick="openDialogView('查看考勤信息', '${ctx}/oa/oaAttendance/form?id=${off.oaAttendanceBean.id}&readAttr=disabled','80%','80%')" class="btn btn-info btn-xs">查看详情</a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
            </c:if>
        </c:forEach>
        </table>
        </div>
    </div>
</div>
</body>
</html>
