<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath(); %>
<%@ include file="/WEB-INF/jspf/common.jspf" %>
<%@ include file="/WEB-INF/jspf/boostrapSelect.jspf" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>自定义查询iframe页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv=X-UA-Compatible IE=EmulateIE7>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
    <script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
    <![endif]-->
    <script>
        var path = "${path}";
    </script>
    <style type="text/css">
        .collapse{
            height:18%!important;
            overflow-y:scroll;
        }
        .divClass{
            padding-top:0.5%;
        }
        .labelDiv{
            width:20%;
            margin-left: 5%;
            float:left;
        }
        label{
            width:100%;
            text-align: right;
            padding-top:1%;
        }
        .whereDiv{
            float:left;
            width:8%;
            height: 27px;
            padding-left: 1%;
        }
        .inputDiv{
            width:23%;
            float:left;
            padding-left: 1%;
            height:27px;
        }
        .whereDiv select{
            width:100%;
            height:100%;
        }
        .select1{
            width:100%;
        }
        .select2{
            width:100%;
            height:100%;
        }
        .select21{
            float:left;
            width:49%;
            height:100%;
        }
        .select22{
            float:left;
            width:49%;
            padding-left:2%;
            height:100%;
        }
        .btns{
            margin-left:26.5%!important;
        }
        .btn{
            margin-left:-2%;
        }
        .TableView{
            margin-left:2%;
        }
        .pagination{
            margin:0!important;
        }
    </style>
</head>
<body>
<div class="panel-group" id="accordion">
    <div class="panel">
        <div class="panel-heading">
            <h5>
                <a data-toggle="collapse" href="#b">
                    可收缩
                </a>
            </h5>
        </div>
        <div id="b" class="panel-collapse collapse in">
            <div class="panel-body" >
                    <table width="100%">
                        　　  <%
                        int i=1;
                    %>
                        　　 <c:forEach  items="${relateds}" var="related">
                        　　<%  //每行显示 四列信息
                        if (i%4==1){
                    %>
                        　　<tr>
                        　　<%}%>
                        　　<%-- 需循环部分 开始 --%>
                        　　<td width="25%">
                                <input type="hidden" id="${related.name.replace('.','')}" value="${related.columnType}">
                                <input type='checkbox' class="check" value="${related.name}"/><span>${related.columnName}</span></td>
                        　　<%--//需循环部分 结束--%>
                        　　<%if(i%4==0){%>
                        　　</tr>
                        　　<%
                        }
                        i++;
                    %>
                        　　</c:forEach>
                        　　</table>

            </div>
        </div>
    </div>
</div>
<div>
    <form id="block"></form>
</div>
<input type="hidden" id="sql">
<input type="hidden" id="approves" value="${approves}">
<input type="hidden" id="locks" value="${locks}">
<input type="hidden" id="tableThNames">
<input type="hidden" id="fields" value="${fields}">
<input type="hidden" id="fieldCns" value="${fieldCns}">
<table class="row btns"  style="clear:both;margin-left: 14%">
    <tr>
    <td><div class="btn">
        <button type="button" class="btn btn-primary" onclick="search()">开始搜索</button>
    </div></td>
        <td><div class="btn">
        <button type="button" class="btn btn-default" onclick="clearForm()">&nbsp;&nbsp;清&nbsp;&nbsp;空&nbsp;&nbsp;</button>
    </div></td>
        <td><div class="btn">
        <button type="button" class="btn btn-success" onclick="exportExcel()">导出excel</button>
    </div></td>
        <td><div class="btn">
        <button type="button" class="btn btn-warning" onclick="downloadZip()">批量下载</button>
    </div></td>
        <td><div class="btn">
        <button type="button" class="btn btn-info" onclick="downloadPdf()">下载PDF</button>
    </div></td>
        <td><div class="btn">
        <button type="button" class="btn btn-primary" onclick="borrowings()" data-toggle="modal" data-target="#myModal1">批量借阅申请</button>
    </div></td>
        <td><div class="btn">
        <button type="button" class="btn btn-danger" onclick="blocks()">批量锁定</button>
    </div></td>
    </tr>
</table>
<div id="tableDiv" class="table-responsive">
    <table id="mytab" class="table text-nowrap"></table>
</div>
<!-- 模态框1（Modal） -->
<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title">
                    申请信息
                </h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" role="form">
                    <input type="hidden" id="checks">
                    <input type="hidden" id="check">
                    <input type="hidden" id="approveId">
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">有效时间：</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control input" id="effeTime" name="effeTime">
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">申请天数：</label>
                            <div class="col-sm-7">
                                <input type="number" class="form-control input" id="effeDays" name="effeDays">
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">申请类型：</label>
                            <div class="col-sm-7">
                                <select class="form-control input" name="applyType" id="applyType">
                                    <c:forEach items="${applyTypes}" var="applyType">
                                        <option value="${applyType.code}">${applyType.name}</option>
                                    </c:forEach>
                                </select>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">申请理由：</label>
                            <div class="col-sm-7">
                                <textarea class="form-control input" id="applyReason" name="applyReason"></textarea>
                            </div>
                            <div class="col-sm-1"></div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" onclick="save()">
                    暂时保存
                </button>
                <button type="button" class="btn btn-primary" onclick="add()">
                    确认提交
                </button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="${path}/static/js/recordManage/templateSearch/searchCommomMethod.js"></script>
<script type="text/javascript" src="${path}/static/js/recordManage/templateSearch/customSearchIframe.js"></script>
</body>
</html>

